]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP2050227: Improve IDL format
[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" relteype="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                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7179                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7180                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7181                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7182                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7183                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7184                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7185                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7186                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7187                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7188                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7189                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7190                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7191                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7192                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7193                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7194                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7195                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7196                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7206                 </fields>
7207                 <links>
7208                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7209                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7210                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7211                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7212                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7213                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7214                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7215                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7216                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7217                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7218                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7219                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7220                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7221                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7222                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7223                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7224                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7225                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7226                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7227                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7228                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7229                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7230                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7231                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7232                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7233                 </links>
7234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7235             <actions>
7236                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7237                 <retrieve/>
7238                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7239                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7240             </actions>
7241         </permacrud>
7242         </class>
7243         <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">
7244                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7245                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7246                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7247                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7248                 </fields>
7249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7250                         <actions>
7251                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7252                                 <retrieve/>
7253                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7254                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7255                         </actions>
7256                 </permacrud>
7257         </class>
7258         <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">
7259                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7260                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7261                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7262                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
7263                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7264                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7265                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true"/>
7266                 </fields>
7267                 <links>
7268                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7269                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7270                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7271                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7272                 </links>
7273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7274                         <actions>
7275                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7276                                 <retrieve/>
7277                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7278                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true"/>
7279                         </actions>
7280                 </permacrud>
7281         </class>
7282         <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">
7283                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7284                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7285                         <field name="btype" reporter:datatype="text"/>
7286                         <field name="id" reporter:datatype="id"/>
7287                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7288                         <field name="description" reporter:datatype="text"/>
7289                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7290                         <field name="pub" reporter:datatype="bool"/>
7291                         <field name="create_time" reporter:datatype="timestamp"/>
7292                         <field name="owning_lib" reporter:datatype="org_unit"/>
7293                 </fields>
7294                 <links>
7295                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7296                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7297                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7298                 </links>
7299                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7300                         <actions>
7301                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7302                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7303                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7304                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7305                         </actions>
7306                 </permacrud>
7307         </class>
7308         <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">
7309                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7310                         <field name="id" reporter:datatype="id"/>
7311                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7312                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7313                 </fields>
7314                 <links>
7315                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7316                 </links>
7317         </class>
7318         <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">
7319                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7320                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7321                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7322                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7323                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7324                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7325                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7326                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7327                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7328                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7329                 </fields>
7330                 <links>
7331                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7332                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7333                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7334                 </links>
7335                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7336                         <actions>
7337                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7338                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7339                 <retrieve/>
7340                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7341                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7342             </actions>
7343                 </permacrud>
7344         </class>
7345         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7346                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7347                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7348                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
7349                         <field reporter:label="Card ID" name="id" reporter:datatype="id"/>
7350                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7351                 </fields>
7352                 <links>
7353                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7354                 </links>
7355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7356                         <actions>
7357                                 <retrieve permission="VIEW_USER user_request.view">
7358                                         <context link="usr" field="home_ou"/>
7359                                 </retrieve>
7360                         </actions>
7361                 </permacrud>
7362         </class>
7363     <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">
7364         <fields oils_persist:primary="field">
7365             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
7366             <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
7367             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7368         </fields>
7369         <links/>
7370         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7371             <actions>
7372                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7373                 <retrieve/>
7374                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7375                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7376             </actions>
7377         </permacrud>
7378     </class>
7379         <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">
7380                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7381                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7382                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7383                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7384                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7385                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7386                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
7387                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7388                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7389                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7390                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7391                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7392                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7393                 </fields>
7394                 <links>
7395                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7396                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7397                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7398                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7399                 </links>
7400         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7401             <actions>
7402                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7403                 <retrieve/>
7404                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7405                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7406             </actions>
7407         </permacrud>
7408         </class>
7409         <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">
7410                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7411                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7412                         <field name="id" reporter:datatype="id"/>
7413                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7414                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7415                 </fields>
7416                 <links>
7417                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7418                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7419                 </links>
7420         </class>
7421         <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">
7422                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7423                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7424                         <field name="btype" reporter:datatype="text"/>
7425                         <field name="id" reporter:datatype="id"/>
7426                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7427                         <field name="description" reporter:datatype="text"/>
7428                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
7429                         <field name="pub" reporter:datatype="bool"/>
7430                         <field name="create_time" reporter:datatype="timestamp"/>
7431                         <field name="owning_lib" reporter:datatype="org_unit"/>
7432                 </fields>
7433                 <links>
7434                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7435                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7436                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7437                 </links>
7438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7439                         <actions>
7440                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7441                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7442                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7443                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7444                         </actions>
7445                 </permacrud>
7446         </class>
7447         <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">
7448                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7449                         <field name="id" reporter:datatype="id"/>
7450                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7451                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7452                 </fields>
7453                 <links>
7454                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7455                 </links>
7456         </class>
7457         <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">
7458                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7459                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7460                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7461                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7462                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7463                         <field reporter:label="Payment Note" name="note" reporter:datatype="text"/>
7464                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7465                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7466                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7467                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7468                 </fields>
7469                 <links>
7470                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7471                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7472                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7473                 </links>
7474         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7475             <actions>
7476                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7477                     <context link="xact" jump="usr" field="home_ou"/>
7478                 </retrieve>
7479                         </actions>
7480                 </permacrud>
7481         </class>
7482         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7483                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7484                         <field name="id" reporter:datatype="id"/>
7485                         <field name="ind1"/>
7486                         <field name="ind2"/>
7487                         <field name="record" oils_obj:required="true"/>
7488                         <field name="subfield"/>
7489                         <field name="tag" oils_obj:required="true"/>
7490                         <field name="value" oils_obj:required="true"/>
7491                 </fields>
7492                 <links>
7493                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7494                 </links>
7495         </class>
7496         <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">
7497                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7498                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
7499                         <field name="source" reporter:label="Source Record" reporter:datatype="link" oils_obj:required="true"/>
7500                         <field name="target" reporter:label="Target Record" reporter:datatype="link" oils_obj:required="true"/>
7501                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" oils_obj:required="true"/>
7502                 </fields>
7503                 <links>
7504                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7505                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7506                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7507                 </links>
7508         </class>
7509         <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">
7510                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7511                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7512                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7513                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7514                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7515                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
7516                 </fields>
7517                 <links>
7518                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7519                 </links>
7520         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7521             <actions>
7522                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7523                 <retrieve/>
7524                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7525                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7526             </actions>
7527         </permacrud>
7528
7529         </class>
7530         <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">
7531                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7532                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7533                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7534                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7535                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" oils_obj:required="true"/>
7536                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7537                         <field reporter:label="Type Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7538                         <field reporter:label="OPAC Label" name="opac_label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7539                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7540                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7541                 </fields>
7542                 <links>
7543                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7544                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7545                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7546                 </links>
7547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7548             <actions>
7549                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7550                 <retrieve/>
7551                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7552                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7553             </actions>
7554         </permacrud>
7555         </class>
7556         <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">
7557                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7558                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7559                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7560                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7561                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7562                         <field reporter:label="Note ID" name="id" reporter:datatype="id"/>
7563                         <field reporter:label="Bib Record" name="record" reporter:datatype="link" oils_obj:required="true"/>
7564                         <field reporter:label="Note" name="value" reporter:datatype="text" oils_obj:required="true"/>
7565                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7566                 </fields>
7567                 <links>
7568                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7569                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7570                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7571                 </links>
7572                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7573                 <actions>
7574                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7575                     <retrieve/>
7576                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7577                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7578                 </actions>
7579              </permacrud>
7580         </class>
7581         <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">
7582                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7583                         <field name="balance_owed" reporter:datatype="money"/>
7584                         <field name="total_owed" reporter:datatype="money"/>
7585                         <field name="total_paid" reporter:datatype="money"/>
7586                         <field name="usr" reporter:datatype="link"/>
7587                 </fields>
7588                 <links>
7589                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7590                 </links>
7591         </class>
7592     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7593                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7594                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link" oils_obj:required="true"/>
7595                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7596                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7597                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7598                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp"/>
7599                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp"/>
7600                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7601                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7602                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7603                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7604                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7605                 </fields>
7606                 <links>
7607                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7608                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7609                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7610                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7611                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7612                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7613                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7614                 </links>
7615         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7616             <actions>
7617                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7618             </actions>
7619         </permacrud>
7620         </class>
7621         <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">
7622                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7623                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7624                         <field name="quality" reporter:datatype="int"/>
7625                         <field name="source" reporter:datatype="text" oils_obj:required="true"/>
7626                         <field name="transcendant" reporter:datatype="bool"/>
7627                         <field name="can_have_copies" reporter:datatype="bool"/>
7628                 </fields>
7629                 <links/>
7630         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7631             <actions>
7632                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7633                 <retrieve/>
7634                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7635                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7636             </actions>
7637         </permacrud>
7638         </class>
7639         <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">
7640                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7641                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
7642                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
7643                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7644                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7645                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7646                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7647                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7648                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7649                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7650                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7651                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7652                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7653                 </fields>
7654                 <links>
7655                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7656                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7657                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7658                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7659                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7660                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7661                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7662                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7663                 </links>
7664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7665                         <actions>
7666                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7667                                         <context link="usr" field="home_ou"/>
7668                                 </retrieve>
7669                         </actions>
7670                 </permacrud>
7671         </class>
7672         <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">
7673                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7674                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
7675                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7676                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7677                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
7678                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7679                 </fields>
7680                 <links>
7681                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7682                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7683                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7684                 </links>
7685                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7686                         <actions>
7687                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7688                     <context link="stat_cat" field="owner"/>
7689                 </create>
7690                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7691                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7692                     <context link="stat_cat" field="owner"/>
7693                 </update>
7694                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7695                     <context link="stat_cat" field="owner"/>
7696                 </delete>
7697                         </actions>
7698                 </permacrud>
7699         </class>
7700         <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">
7701                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7702                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id"/>
7703                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link" oils_obj:required="true"/>
7704                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
7705                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
7706                 </fields>
7707                 <links>
7708                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7709                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7710                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7711                 </links>
7712         </class>
7713         <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">
7714                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7715                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7716                         <field name="id" reporter:datatype="id"/>
7717                         <field name="target_user" reporter:datatype="link" oils_obj:required="true"/>
7718                         <field name="create_time" reporter:datatype="timestamp"/>
7719                         <field name="pos" reporter:datatype="int"/>
7720                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7721                 </fields>
7722                 <links>
7723                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7724                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7725             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7726                 </links>
7727                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7728                         <actions>
7729                                 <retrieve permission="ADMIN_USER_BUCKET">
7730                     <context link="bucket" field="owning_lib"/>
7731                 </retrieve>
7732             </actions>
7733         </permacrud>
7734         </class>
7735         <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">
7736                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7737                         <field name="id" reporter:datatype="id"/>
7738                         <field name="staff" reporter:datatype="link" oils_obj:required="true"/>
7739                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
7740                         <field name="target" reporter:datatype="int" oils_obj:required="true"/>
7741                         <field name="hold_type" reporter:datatype="text"/>
7742                         <field name="run_date" reporter:datatype="timestamp"/>
7743                         <field name="cancelled" reporter:datatype="timestamp"/>
7744                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link"/>
7745                 </fields>
7746                 <links>
7747                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7748                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7749                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7750                 </links>
7751                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7752                         <actions>
7753                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7754                 <retrieve/>
7755                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7756                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7757             </actions>
7758         </permacrud>
7759         </class>
7760         <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">
7761                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7762                         <field name="id" reporter:datatype="id"/>
7763                         <field name="batch_hold_event" reporter:datatype="link" oils_obj:required="true"/>
7764                         <field name="hold" reporter:datatype="link" oils_obj:required="true"/>
7765                 </fields>
7766                 <links>
7767                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7768                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7769                 </links>
7770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7771                         <actions>
7772                 <retrieve/>
7773             </actions>
7774         </permacrud>
7775         </class>
7776         <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">
7777                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7778                         <field name="id" reporter:datatype="id"/>
7779                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
7780                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
7781                 </fields>
7782                 <links>
7783                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7784                 </links>
7785         </class>
7786         <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">
7787                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7788                         <field name="balance_owed" reporter:datatype="money"/>
7789                         <field name="total_owed" reporter:datatype="money"/>
7790                         <field name="total_paid" reporter:datatype="money"/>
7791                         <field name="usr" reporter:datatype="link"/>
7792                 </fields>
7793                 <links>
7794                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7795                 </links>
7796                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7797                         <actions>
7798                                 <retrieve permission="VIEW_USER">
7799                                         <context link="usr" field="home_ou"/>
7800                                 </retrieve>
7801                         </actions>
7802                 </permacrud>
7803         </class>
7804         <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">
7805                 <fields oils_persist:primary="code" oils_persist:sequence="">
7806                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7807                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7808                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7809                 </fields>
7810                 <links/>
7811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7812             <actions>
7813                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7814                 <retrieve/>
7815                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7816                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7817             </actions>
7818         </permacrud>
7819         </class>
7820         <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">
7821                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7822                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7823                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7824                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7825                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7826                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7827                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7828                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7829                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7830                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7831                 </fields>
7832                 <links>
7833                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7834                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7835                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7836                 </links>
7837         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7838             <actions>
7839                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7840                     <context link="xact" jump="usr" field="home_ou"/>
7841                 </retrieve>
7842                         </actions>
7843                 </permacrud>
7844         </class>
7845         <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">
7846                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7847                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7848                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7849                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7850                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7851                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7852                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7853                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7854                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7855                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7856                 </fields>
7857                 <links>
7858                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7859                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7860                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7861                 </links>
7862         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7863             <actions>
7864                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7865                     <context link="xact" jump="usr" field="home_ou"/>
7866                 </retrieve>
7867                         </actions>
7868                 </permacrud>
7869         </class>
7870         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7871                 <fields oils_persist:primary="id" oils_persist:sequence="">
7872                         <field name="checkin_lib" reporter:datatype="link"/>
7873                         <field name="checkin_staff" reporter:datatype="link"/>
7874                         <field name="checkin_time" reporter:datatype="timestamp"/>
7875                         <field name="circ_lib" reporter:datatype="org_unit"/>
7876                         <field name="circ_staff" reporter:datatype="link"/>
7877                         <field name="desk_renewal" reporter:datatype="bool"/>
7878                         <field name="due_date" reporter:datatype="timestamp"/>
7879                         <field name="duration" reporter:datatype="interval"/>
7880                         <field name="duration_rule" reporter:datatype="link"/>
7881                         <field name="fine_interval" reporter:datatype="interval"/>
7882                         <field name="id" reporter:datatype="id"/>
7883                         <field name="max_fine" reporter:datatype="money"/>
7884                         <field name="max_fine_rule" reporter:datatype="link"/>
7885                         <field name="opac_renewal" reporter:datatype="bool"/>
7886                         <field name="phone_renewal" reporter:datatype="bool"/>
7887                         <field name="recurring_fine" reporter:datatype="money"/>
7888                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7889                         <field name="renewal_remaining" reporter:datatype="int"/>
7890             <field name="grace_period" reporter:datatype="interval"/>
7891                         <field name="stop_fines" reporter:datatype="text"/>
7892                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7893                         <field name="target_copy" reporter:datatype="link"/>
7894                         <field name="usr" reporter:datatype="link"/>
7895                         <field name="xact_finish" reporter:datatype="timestamp"/>
7896                         <field name="xact_start" reporter:datatype="timestamp"/>
7897                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7898                         <field name="auto_renewal" reporter:datatype="bool"/>
7899                         <field name="auto_renewal_remaining" reporter:datatype="int"/>
7900                 </fields>
7901                 <links>
7902                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7903                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7904                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7905                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7906                 </links>
7907         </class>
7908         <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">
7909                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7910                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
7911                         <field name="id" reporter:datatype="id"/>
7912                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
7913                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
7914                 </fields>
7915                 <links>
7916                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7917                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7918                 </links>
7919         </class>
7920         <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">
7921                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7922                         <field name="high" reporter:datatype="money" oils_obj:required="true"/>
7923                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7924                         <field name="low" reporter:datatype="money" oils_obj:required="true"/>
7925                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
7926                         <field name="normal" reporter:datatype="money" oils_obj:required="true"/>
7927                         <field name="recurrence_interval" reporter:datatype="interval"/>
7928             <field name="grace_period" reporter:datatype="interval"/>
7929                 </fields>
7930                 <links/>
7931         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7932             <actions>
7933                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7934                 <retrieve/>
7935                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7936                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7937             </actions>
7938         </permacrud>
7939         </class>
7940         <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">
7941                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7942                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7943                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7944                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7945                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7946                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" oils_obj:required="true"/>
7947                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7948                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7949                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7950                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7951                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7952                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7953                 </fields>
7954                 <links>
7955                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7956                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7957                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7958                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7959                 </links>
7960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7961             <actions>
7962                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7963                     <context link="xact" jump="usr" field="home_ou"/>
7964                 </retrieve>
7965                         </actions>
7966                 </permacrud>
7967         </class>
7968         <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">
7969                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7970                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link" oils_obj:required="true"/>
7971                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
7972                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" oils_obj:required="true"/>
7973                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7974                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
7975                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7976                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7977                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link" oils_obj:required="true"/>
7978                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7979                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7980                 </fields>
7981                 <links>
7982                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7983                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7984                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7985                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7986                 </links>
7987         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7988             <actions>
7989                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7990                     <context link="xact" jump="usr" field="home_ou"/>
7991                 </retrieve>
7992                         </actions>
7993                 </permacrud>
7994         </class>
7995         <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">
7996                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7997                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7998                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7999                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
8000                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link" oils_obj:required="true"/>
8001                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8002                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8003                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8004                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8005                         <field reporter:label="Item Number on Volume" name="copy_number" reporter:datatype="text"/>
8006                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8007                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8008                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8009                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8010                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8011                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8012                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8013                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8014                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8015                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8016                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8017                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int" oils_obj:required="true"/>
8018                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool"/>
8019                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8020                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int" oils_obj:required="true"/>
8021                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8022                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
8023                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8024                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8025                         <field reporter:label="Item Status" name="status" reporter:datatype="link"/>
8026                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8027                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8028                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8029                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8030                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8031                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8032                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8033                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8034                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8035                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8036                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8037                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8038                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8039                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8040                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8041                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8042                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8043                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8044                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8045                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8046                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8047                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8048                 </fields>
8049                 <links>
8050                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8051                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8052                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8053                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8054                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8055                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8056                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8057                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8058                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8059                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8060                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8061                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8062                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8063                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8064                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8065                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8066                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8067                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8068                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8069                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8070                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8071                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8072                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8073                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8074                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8075                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8076                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8077                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8078                 </links>
8079         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8080             <actions>
8081                 <create permission="CREATE_COPY">
8082                     <context link="call_number" field="owning_lib"/>
8083                 </create>
8084                 <retrieve/>
8085                 <update permission="UPDATE_COPY">
8086                     <context link="call_number" field="owning_lib"/>
8087                 </update>
8088                 <delete permission="DELETE_COPY">
8089                     <context link="call_number" field="owning_lib"/>
8090                 </delete>
8091             </actions>
8092         </permacrud>
8093         </class>
8094
8095         <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">
8096                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8097                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8098                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8099                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8100                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8101                 </fields>
8102                 <links>
8103                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8104                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8105                 </links>
8106                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8107                         <actions>
8108                 <create permission="STAFF_LOGIN"/>
8109                 <retrieve/>
8110                 <update permission="STAFF_LOGIN"/>
8111                 <delete permission="STAFF_LOGIN"/>
8112                         </actions>
8113                 </permacrud>
8114         </class>
8115
8116         <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">
8117                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8118             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8119                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8120                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8121                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8122                 </fields>
8123                 <links>
8124                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8125                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8126                 </links>
8127         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8128             <actions>
8129                                 <retrieve/>
8130             </actions>
8131         </permacrud>
8132         </class>
8133
8134         <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">
8135                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8136                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8137                         <field reporter:label="Scope Org Unit" name="scope_org" reporter:datatype="org_unit" oils_obj:required="true"/>
8138                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
8139                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8140                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8141                         <field reporter:label="Event" name="event" reporter:datatype="text"/>
8142                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool"/>
8143                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8144                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8145                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8146                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8147                 </fields>
8148                 <links>
8149                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8150                 </links>
8151         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8152             <actions>
8153                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8154                 <retrieve/>
8155                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8156                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8157             </actions>
8158         </permacrud>
8159         </class>
8160
8161         <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">
8162                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8163                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8164                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
8165                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8166                 </fields>
8167                 <links>
8168                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8169                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8170                 </links>
8171         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8172             <actions>
8173                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8174                 <retrieve/>
8175                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8176                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8177             </actions>
8178         </permacrud>
8179         </class>
8180
8181         <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">
8182                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8183                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8184                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" oils_obj:required="true"/>
8185                         <field reporter:label="Copy" name="copy" reporter:datatype="link" oils_obj:required="true"/>
8186                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8187                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8188                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link" oils_obj:required="true"/>
8189                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8190                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8191                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8192                 </fields>
8193                 <links>
8194                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8195                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8196                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8197                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8198                 </links>
8199         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8200             <actions>
8201                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8202                     <context link="copy" field="circ_lib"/>
8203                 </create>
8204                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8205                     <context link="copy" field="circ_lib"/>
8206                                 </retrieve>
8207                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8208                     <context link="copy" field="circ_lib"/>
8209                                 </update>
8210                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8211                     <context link="copy" field="circ_lib"/>
8212                                 </delete>
8213             </actions>
8214         </permacrud>
8215         </class>
8216
8217         <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">
8218                 <fields oils_persist:primary="id">
8219                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8220                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link"/>
8221                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8222                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool"/>
8223                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
8224                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8225                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8226                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp"/>
8227                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8228                 </fields>
8229                 <links>
8230                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8231                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8232                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8233                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8234                 </links>
8235         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8236             <actions>
8237                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8238                     <context link="copy" field="circ_lib"/>
8239                 </create>
8240                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8241                     <context link="copy" field="circ_lib"/>
8242                                 </retrieve>
8243                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8244                     <context link="copy" field="circ_lib"/>
8245                                 </update>
8246                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8247                     <context link="copy" field="circ_lib"/>
8248                                 </delete>
8249             </actions>
8250         </permacrud>
8251         </class>
8252
8253         <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">
8254                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8255                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
8256                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8257                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
8258                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
8259                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8260                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8261                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8262                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8263                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8264                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8265                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8266                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8267                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8268                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8269                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8270                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8271                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8272                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8273                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8274                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8275                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8276                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8277                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8278                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8279                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8280                 </fields>
8281                 <links>
8282                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8283                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8284                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8285                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8286                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8287                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8288                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8289                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8290                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8291                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8292                 </links>
8293                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8294                         <actions>
8295                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8296                                 <retrieve/>
8297                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8298                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8299                         </actions>
8300                 </permacrud>
8301         </class>
8302
8303         <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">
8304                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8305                         <field reporter:label="Item Age" name="age" reporter:datatype="interval" oils_obj:required="true"/>
8306                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8307                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8308                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" oils_obj:required="true"/>
8309                 </fields>
8310                 <links/>
8311         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8312             <actions>
8313                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8314                 <retrieve/>
8315                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8316                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8317             </actions>
8318         </permacrud>
8319         </class>
8320         <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">
8321                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8322                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8323                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8324                         <field reporter:label="Rule Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8325                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8326                 </fields>
8327                 <links/>
8328         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8329             <actions>
8330                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8331                 <retrieve/>
8332                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8333                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8334             </actions>
8335         </permacrud>
8336         </class>
8337         <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">
8338                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8339                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8340                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8341                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8342                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8343                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8344                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8345                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8346                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8347                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8348                 </fields>
8349                 <links>
8350                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8351                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8352                 </links>
8353         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8354             <actions>
8355                 <create permission="CREATE_PERM" global_required="true"/>
8356                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8357                 <update permission="UPDATE_PERM" global_required="true"/>
8358                 <delete permission="DELETE_PERM" global_required="true"/>
8359             </actions>
8360         </permacrud>
8361         </class>
8362         <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">
8363                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8364                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8365                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true" oils_obj:required="true"/>
8366                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8367                         <field reporter:label="Org Unit" name="org" reporter:datatype="link" oils_obj:required="true"/>
8368                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
8369                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8370                 </fields>
8371                 <links>
8372                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8373                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8374                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8375                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8376                 </links>
8377                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8378                         <actions>
8379                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8380                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8381                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8382                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8383                         </actions>
8384                 </permacrud>
8385         </class>
8386         <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">
8387                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8388                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8389                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text" oils_obj:required="true"/>
8390                         <field reporter:label="Answer ID" name="id" reporter:datatype="id"/>
8391                         <field reporter:label="Question" name="question" reporter:datatype="link" oils_obj:required="true"/>
8392                 </fields>
8393                 <links>
8394                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8395                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8396                 </links>
8397         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8398             <actions>
8399                 <create permission="ADMIN_SURVEY">
8400                     <context link="question" jump="survey" field="owner"/>
8401                 </create>
8402                 <retrieve/>
8403                 <update permission="ADMIN_SURVEY">
8404                     <context link="question" jump="survey" field="owner"/>
8405                 </update>
8406                 <delete permission="ADMIN_SURVEY">
8407                     <context link="question" jump="survey" field="owner"/>
8408                 </delete>
8409             </actions>
8410         </permacrud>
8411         </class>
8412         <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">
8413                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8414                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8415                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8416                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8417                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link" oils_obj:required="true"/>
8418                         <field reporter:label="Patron" name="patron" reporter:datatype="link" oils_obj:required="true"/>
8419                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link" oils_obj:required="true"/>
8420                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8421                 </fields>
8422                 <links>
8423                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8424                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8425                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8426                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8427                 </links>
8428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8429                         <actions>
8430                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8431                         </actions>
8432                 </permacrud>
8433         </class>
8434         <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">
8435                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8436                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
8437                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8438                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id"/>
8439                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8440                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8441                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8442                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8443                 </fields>
8444                 <links>
8445                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8446                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8447                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8448                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8449                 </links>
8450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8451                         <actions>
8452                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib"/>
8453                         </actions>
8454                 </permacrud>
8455         </class>
8456         <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">
8457                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8458                         <field name="balance_owed" reporter:datatype="money"/>
8459                         <field name="total_owed" reporter:datatype="money"/>
8460                         <field name="total_paid" reporter:datatype="money"/>
8461                         <field name="usr" reporter:datatype="link"/>
8462                 </fields>
8463                 <links>
8464                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8465                 </links>
8466         </class>
8467         <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">
8468                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8469                         <field reporter:label="Non-fulfilling Library" name="circ_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
8470                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link" oils_obj:required="true"/>
8471                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8472                         <field reporter:label="Hold" name="hold" reporter:datatype="link" oils_obj:required="true"/>
8473                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
8474                 </fields>
8475                 <links>
8476                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8477                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8478                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8479                 </links>
8480         </class>
8481         <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">
8482                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8483                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8484                         <field name="id" reporter:datatype="id"/>
8485                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8486                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8487                 </fields>
8488                 <links>
8489                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8490                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8491                 </links>
8492         </class>
8493         <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">
8494                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8495                         <field name="field" reporter:datatype="link" oils_obj:required="true"/>
8496                         <field name="id" reporter:datatype="id"/>
8497                         <field name="source" reporter:datatype="link" oils_obj:required="true"/>
8498                         <field name="value" reporter:datatype="text" oils_obj:required="true"/>
8499                 </fields>
8500                 <links>
8501                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8502                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8503                 </links>
8504         </class>
8505         <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">
8506                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8507                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
8508                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8509                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text" oils_obj:required="true"/>
8510                         <field reporter:label="User" name="target_usr" reporter:datatype="link" oils_obj:required="true"/>
8511                 </fields>
8512                 <links>
8513                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8514                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8515                 </links>
8516         </class>
8517         <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">
8518                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8519                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8520                         <field name="grantable" reporter:datatype="bool"/>
8521                         <field name="grp" reporter:datatype="link" oils_obj:required="true"/>
8522                         <field name="id" reporter:datatype="id"/>
8523                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8524                 </fields>
8525                 <links>
8526                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8527                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8528                 </links>
8529         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8530             <actions>
8531                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8532                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8533                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8534                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8535             </actions>
8536         </permacrud>
8537         </class>
8538         <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">
8539                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8540                         <field name="items" oils_persist:virtual="true"/>
8541                         <field name="btype" reporter:datatype="text"/>
8542                         <field name="id" reporter:datatype="id"/>
8543                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
8544                         <field name="description" reporter:datatype="text"/>
8545                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
8546                         <field name="pub" reporter:datatype="bool"/>
8547                         <field name="create_time" reporter:datatype="timestamp"/>
8548                         <field name="owning_lib" reporter:datatype="org_unit"/>
8549                 </fields>
8550                 <links>
8551                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8552                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8553                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8554                 </links>
8555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8556                         <actions>
8557                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8558                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8559                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8560                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8561                         </actions>
8562                 </permacrud>
8563         </class>
8564         <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">
8565                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8566                         <field name="id" reporter:datatype="id"/>
8567                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8568                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8569                 </fields>
8570                 <links>
8571                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8572                 </links>
8573         </class>
8574         <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">
8575                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8576                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int"/>
8577                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
8578                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link" oils_obj:required="true"/>
8579                 </fields>
8580                 <links>
8581                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8582                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8583                 </links>
8584         </class>
8585         <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">
8586                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8587                         <field name="depth" reporter:datatype="int" oils_obj:required="true"/>
8588                         <field name="grantable" reporter:datatype="bool"/>
8589                         <field name="id" reporter:datatype="id"/>
8590                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8591                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8592                 </fields>
8593                 <links>
8594                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8595                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8596                 </links>
8597         </class>
8598         <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">
8599                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8600                         <field name="object_id" reporter:datatype="text" oils_obj:required="true"/>
8601                         <field name="grantable" reporter:datatype="bool"/>
8602                         <field name="id" reporter:datatype="id"/>
8603                         <field name="perm" reporter:datatype="link" oils_obj:required="true"/>
8604                         <field name="usr" reporter:datatype="link" oils_obj:required="true"/>
8605                         <field name="object_type" reporter:datatype="text" oils_obj:required="true"/>
8606                 </fields>
8607                 <links>
8608                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8609                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8610                 </links>
8611         </class>
8612         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8613                 <fields oils_persist:primary="id" oils_persist:sequence="">
8614                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8615                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8616                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8617                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8618                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8619                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8620                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8621                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8622                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8623                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8624                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8625                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8626                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8627                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8628                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8629                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8630                 </fields>
8631                 <links>
8632                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8633                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8634                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8635                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8636                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8637                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8638                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8639                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8640                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8641                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8642                 </links>
8643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8644             <actions>
8645                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8646                     <context link="xact" jump="usr" field="home_ou"/>
8647                 </retrieve>
8648                         </actions>
8649                 </permacrud>
8650         </class>
8651         <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">
8652                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8653                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8654                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
8655                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8656                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8657                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text" oils_obj:required="true"/>
8658                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8659                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
8660                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8661                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8662                         <field name="billing" reporter:datatype="link"/>
8663                 </fields>
8664                 <links>
8665                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8666                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8667                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8668                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8669                 </links>
8670                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8671                         <actions>
8672                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8673                                         <context link="xact" field="usr_home_ou"/>
8674                                 </retrieve>
8675                         </actions>
8676                 </permacrud>
8677         </class>
8678         <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">
8679                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8680                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8681                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8682                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8683                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8684                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8685                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8686                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8687                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8688                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8689                         <field name="billing" reporter:datatype="link"/>
8690                 </fields>
8691                 <links>
8692                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8693                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8694                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8695                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8696                 </links>
8697         </class>
8698
8699         <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">
8700                 <fields oils_persist:primary="id" oils_persist:sequence="">
8701                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8702                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8703                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8704                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8705                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8706                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8707                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8708                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8709                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8710                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8711                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8712                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8713                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8714                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8715                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8716                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8717                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8718                 </fields>
8719                 <links>
8720                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8721                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8722                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8723                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8724                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8725                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8726                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8727                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8728                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8729                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8730                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8731                 </links>
8732                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8733                         <actions>
8734                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8735                                         <context link="xact" jump="usr" field="home_ou"/>
8736                                 </retrieve>
8737                         </actions>
8738                 </permacrud>
8739         </class>
8740         <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">
8741                 <fields oils_persist:primary="id" oils_persist:sequence="">
8742                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8743                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8744                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8745                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8746                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8747                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8748                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8749                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8750                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8751                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8752                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8753                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8754                 </fields>
8755                 <links>
8756                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8757                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8758                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8759                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8760                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8761                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8762                 </links>
8763         </class>
8764         <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">
8765                 <fields oils_persist:primary="id" oils_persist:sequence="">
8766                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8767                         <field reporter:label="Payment ID" name="id" reporter:datatype="id"/>
8768                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8769                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8770                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8771                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8772                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8773                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8774                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8775                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8776                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8777                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8778                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8779                 </fields>
8780                 <links>
8781                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8782                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8783                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8784                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8785                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8786                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8787                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8788                 </links>
8789         </class>
8790         <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">
8791                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8792                         <field name="bucket" reporter:datatype="link" oils_obj:required="true"/>
8793                         <field name="id" reporter:datatype="id"/>
8794                         <field name="target_biblio_record_entry" reporter:datatype="link" oils_obj:required="true"/>
8795                         <field name="create_time" reporter:datatype="timestamp"/>
8796                         <field name="pos" reporter:datatype="int"/>
8797                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8798                 </fields>
8799                 <links>
8800                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8801                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8802             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8803                 </links>
8804                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8805                         <actions>
8806                                 <retrieve permission="ADMIN_COPY_BUCKET">
8807                     <context link="bucket" field="owning_lib"/>
8808                 </retrieve>
8809             </actions>
8810         </permacrud>
8811         </class>
8812         <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">
8813                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8814                         <field name="id" reporter:datatype="id"/>
8815                         <field name="item" reporter:datatype="link" oils_obj:required="true"/>
8816                         <field name="note" reporter:datatype="text" oils_obj:required="true"/>
8817                 </fields>
8818                 <links>
8819                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8820                 </links>
8821         </class>
8822         <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">
8823                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8824                         <field reporter:label="Entry ID" name="id" reporter:datatype="int"/>
8825                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
8826                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
8827                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
8828                 </fields>
8829                 <links>
8830                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8831                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8832                 </links>
8833                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8834                         <actions>
8835                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8836                     <context link="stat_cat" field="owner"/>
8837                 </create>
8838                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8839                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8840                     <context link="stat_cat" field="owner"/>
8841                 </update>
8842                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8843                     <context link="stat_cat" field="owner"/>
8844                 </delete>
8845                         </actions>
8846                 </permacrud>
8847         </class>
8848     <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">
8849         <fields oils_persist:primary="field">
8850             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name" oils_obj:required="true"/>
8851             <field reporter:label="Field Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
8852             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8853         </fields>
8854         <links/>
8855         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8856             <actions>
8857                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8858                 <retrieve/>
8859                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8860                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8861             </actions>
8862         </permacrud>
8863     </class>
8864         <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">
8865                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8866                         <field reporter:label="Cause ID" name="id" reporter:datatype="id"/>
8867                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8868                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool"/>
8869                 </fields>
8870                 <links/>
8871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8872             <actions>
8873                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8874                 <retrieve/>
8875                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8876                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8877             </actions>
8878         </permacrud>
8879         </class>
8880
8881
8882         <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">
8883                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8884                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8885                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8886                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8887                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8888                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8889                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8890                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8891                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8892                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8893                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8894                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8895                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8896                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8897                 </fields>
8898                 <links>
8899                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8900                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8901                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8902                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8903                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8904                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8905                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8906                 </links>
8907         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8908             <actions>
8909                 <create permission="TRANSIT_COPY">
8910                     <context link="target_copy" field="owner"/>
8911                 </create>
8912                 <retrieve/>
8913                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8914                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8915             </actions>
8916         </permacrud>
8917         </class>
8918         <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">
8919                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8920                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link" oils_obj:required="true"/>
8921                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit" oils_obj:required="true"/>
8922                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8923                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8924                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
8925                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8926                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8927                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit" oils_obj:required="true"/>
8928                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8929                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link" oils_obj:required="true"/>
8930                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8931                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8932                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8933                 </fields>
8934                 <links>
8935                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8936                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8937                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8938                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8939                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8940                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8941                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8942                 </links>
8943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8944             <actions>
8945                 <create permission="TRANSIT_COPY" context_field="owner">
8946                     <context link="target_copy" field="circ_lib"/>
8947                 </create>
8948                 <retrieve/>
8949                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8950                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8951             </actions>
8952         </permacrud>
8953         </class>
8954         <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">
8955                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8956                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8957                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8958                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8959                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8960                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8961                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8962                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
8963                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8964                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8965                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8966                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8967                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8968                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
8969                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8970                 </fields>
8971                 <links>
8972                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8973                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8974                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8975                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8976                 </links>
8977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8978             <actions>
8979                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8980                     <context link="xact" jump="usr" field="home_ou"/>
8981                 </retrieve>
8982                         </actions>
8983                 </permacrud>
8984         </class>
8985         <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">
8986                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8987                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
8988                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp" oils_obj:required="true"/>
8989                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8990                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8991                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp" oils_obj:required="true"/>
8992                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text" oils_obj:required="true"/>
8993                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
8994                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8995                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8996                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool" oils_obj:required="true"/>
8997                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8998                         <field reporter:label="Transaction" name="xact" reporter:datatype="link" oils_obj:required="true"/>
8999                         <field reporter:label="Type" name="btype" reporter:datatype="link" oils_obj:required="true"/>
9000                 </fields>
9001                 <links>
9002                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9003                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9004                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9005                 </links>
9006                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9007                         <actions>
9008                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9009                                         <context link="xact" field="usr_home_ou"/>
9010                                 </retrieve>
9011                         </actions>
9012                 </permacrud>
9013         </class>
9014         <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">
9015                 <fields oils_persist:primary="id" oils_persist:sequence="">
9016                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9017                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9018                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9019                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9020                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9021                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9022                         <field reporter:label="Billing ID" name="id" reporter:datatype="id"/>
9023                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9024                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9025                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9026                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9027                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9028                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9029                 </fields>
9030                 <links>
9031                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9032                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9033                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9034                 </links>
9035         </class>
9036         <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">
9037                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9038                         <field name="grp" oils_obj:required="true"/>
9039                         <field name="id" reporter:datatype="id"/>
9040                         <field name="usr" oils_obj:required="true"/>
9041                 </fields>
9042                 <links>
9043                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9044                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9045                 </links>
9046         </class>
9047         <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">
9048                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9049                         <field name="id" reporter:datatype="id"/>
9050                         <field name="fq_field" reporter:datatype="text" oils_obj:required="true"/>
9051                         <field name="identity_value" reporter:datatype="text" oils_obj:required="true"/>
9052                         <field name="translation" reporter:datatype="text" oils_obj:required="true"/>
9053                         <field name="string" reporter:datatype="text" oils_obj:required="true"/>
9054                 </fields>
9055                 <links>
9056                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9057                 </links>
9058         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9059             <actions>
9060                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9061                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9062                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9063                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9064             </actions>
9065         </permacrud>
9066         </class>
9067         <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">
9068                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9069                         <field name="id" reporter:label="ID" reporter:datatype="id"/>
9070                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9071                         <field name="field" reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9072                         <field name="owner" reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9073                         <field name="string" reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9074                 </fields>
9075                 <links>
9076                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9077                 </links>
9078         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9079             <actions>
9080                 <create permission="ADMIN_FIELD_DOC" context_field="owner"/>
9081                 <retrieve/>
9082                 <update permission="ADMIN_FIELD_DOC" context_field="owner"/>
9083                 <delete permission="ADMIN_FIELD_DOC" context_field="owner"/>
9084             </actions>
9085         </permacrud>
9086         </class>
9087         <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">
9088                 <fields oils_persist:primary="code">
9089                         <field name="code" reporter:datatype="id" oils_obj:required="true"/>
9090                         <field name="marc_code" reporter:datatype="text" oils_obj:required="true"/>
9091                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9092                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9093                         <field name="rtl" reporter:datatype="bool"/>
9094                 </fields>
9095                 <links/>
9096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9097             <actions>
9098                 <create permission="CREATE_LOCALE" global_required="true"/>
9099                 <retrieve/>
9100                 <update permission="UPDATE_LOCALE" global_required="true"/>
9101                 <delete permission="DELETE_LOCALE" global_required="true"/>
9102             </actions>
9103         </permacrud>
9104         </class>
9105         <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">
9106                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9107                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9108                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9109                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9110                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9111                 </fields>
9112                 <links>
9113                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9114                 </links>
9115         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9116             <actions>
9117                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9118                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9119                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9120                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9121             </actions>
9122         </permacrud>
9123         </class>
9124
9125         <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">
9126                 <fields oils_persist:primary="id">
9127                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9128                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9129                 </fields>
9130                 <links/>
9131         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9132             <actions>
9133                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9134                 <retrieve/>
9135                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9136                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9137             </actions>
9138         </permacrud>
9139         </class>
9140
9141         <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">
9142                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9143                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9144                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
9145                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9146                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9147                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" oils_obj:required="true"/>
9148                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9149                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9150                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9151                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9152                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9153                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9154                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9155                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9156                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9157                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9158                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9159                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9160                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9161                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9162                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9163                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9164                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9165                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9166                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9167                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9168                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9169                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9170                 </fields>
9171                 <links>
9172                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9173                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9174                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9175                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9176                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9177                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9178                 </links>
9179         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9180             <actions>
9181                 <create permission="user_request.create">
9182                     <context link="usr" field="home_ou"/>
9183                                 </create>
9184                 <retrieve permission="user_request.view">
9185                     <context link="usr" field="home_ou"/>
9186                                 </retrieve>
9187                 <update permission="user_request.update">
9188                     <context link="usr" field="home_ou"/>
9189                                 </update>
9190                 <delete permission="user_request.delete">
9191                     <context link="usr" field="home_ou"/>
9192                                 </delete>
9193             </actions>
9194         </permacrud>
9195         </class>
9196
9197         <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">
9198         <oils_persist:source_definition><![CDATA[
9199             SELECT r.*, CASE
9200                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9201                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9202                         WHEN l.state = 'received' THEN 5 -- Received
9203                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9204                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9205                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9206                         WHEN l.id IS NULL THEN 1 -- New
9207                         ELSE 0 -- Error
9208                     END AS request_status
9209                     ,u.home_ou
9210             FROM      acq.user_request r
9211             JOIN actor.usr u ON (r.usr = u.id)
9212             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9213             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9214             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9215         ]]></oils_persist:source_definition>
9216                 <fields oils_persist:primary="id">
9217                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9218                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
9219                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link"/>
9220                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool"/>
9221                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
9222                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text"/>
9223                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text"/>
9224                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool"/>
9225                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9226                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link"/>
9227                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp"/>
9228                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp"/>
9229                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text"/>
9230                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text"/>
9231                         <field reporter:label="UPC" name="upc" reporter:datatype="text"/>
9232                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9233                         <field reporter:label="Volume" name="volume" reporter:datatype="text"/>
9234                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9235                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text"/>
9236                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text"/>
9237                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text"/>
9238                         <field reporter:label="Publication Location" name="location" reporter:datatype="text"/>
9239                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text"/>
9240                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text"/>
9241                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text"/>
9242                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9243                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9244                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link"/>
9245                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9246                 </fields>
9247                 <links>
9248                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9249                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9250                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9251                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9252                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9253                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9254                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9255                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9256                 </links>
9257         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9258             <actions>
9259                 <retrieve permission="user_request.view">
9260                     <context link="usr" field="home_ou"/>
9261                                 </retrieve>
9262             </actions>
9263         </permacrud>
9264         </class>
9265
9266         <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">
9267                 <fields oils_persist:primary="id">
9268                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector="label"/>
9269                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9270                 </fields>
9271                 <links/>
9272         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9273             <actions>
9274                 <retrieve/>
9275             </actions>
9276         </permacrud>
9277         </class>
9278
9279         <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">
9280                 <fields oils_persist:primary="code">
9281                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
9282                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9283                 </fields>
9284                 <links/>
9285         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9286             <actions>
9287                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9288                 <retrieve/>
9289                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9290                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9291             </actions>
9292         </permacrud>
9293         </class>
9294
9295         <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">
9296                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9297                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id"/>
9298                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" oils_obj:required="true"/>
9299                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" oils_obj:required="true"/>
9300                         <field reporter:label="Ratio" name="ratio" oils_obj:required="true"/>
9301                 </fields>
9302                 <links>
9303                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9304                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9305                 </links>
9306                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9307                         <actions>
9308                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9309                                 <retrieve/>
9310                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9311                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9312                         </actions>
9313                 </permacrud>
9314         </class>
9315
9316         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9317                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9318                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9319                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9320                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9321                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9322                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9323                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text"/>
9324                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9325                         <field reporter:label="SAN" name="san" reporter:datatype="text"/>
9326                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link"/>
9327                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9328                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
9329                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
9330                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9331                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9332                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9333                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link"/>
9334                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int"/>
9335                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link"/>
9336                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link"/>
9337                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link"/>
9338                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link"/>
9339                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
9340                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link"/>
9341                         <field reporter:label="Buyer SAN" name="buyer_san" reporter:datatype="text"/>
9342                 </fields>
9343                 <links>
9344                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9345                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9346                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9347                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9348                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9349                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9350                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9351                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9352                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9353                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9354                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9355                 </links>
9356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9357             <actions>
9358                 <create permission="ADMIN_PROVIDER" context_field="owner"/>
9359                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9360                 <update permission="ADMIN_PROVIDER" context_field="owner"/>
9361                 <delete permission="ADMIN_PROVIDER" context_field="owner"/>
9362             </actions>
9363         </permacrud>
9364         </class>
9365
9366         <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">
9367                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9368                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
9369                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9370                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
9371                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
9372                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9373                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
9374                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
9375                 </fields>
9376                 <links>
9377                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9378                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9379                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9380                 </links>
9381         </class>
9382
9383         <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">
9384                 <fields oils_persist:primary="code">
9385                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9386                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9387                 </fields>
9388                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9389             <actions>
9390                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9391                 <retrieve/>
9392                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9393                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9394             </actions>
9395                 </permacrud>
9396         </class>
9397
9398         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9399                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9400                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9401                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9402                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9403                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9404                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp"/>
9405                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9406                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text"/>
9407                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" oils_obj:required="true"/>
9408                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text"/>
9409                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link"/>
9410                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9411                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp"/>
9412                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link"/>
9413                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9414                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9415                 </fields>
9416                 <links>
9417                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9418                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9419                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9420                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9421                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9422                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9423                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9424                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9425                 </links>
9426         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9427             <actions>
9428                 <create permission="CREATE_INVOICE" context_field="receiver"/>
9429                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9430                 <update permission="CREATE_INVOICE" context_field="receiver"/>
9431                 <delete permission="CREATE_INVOICE" context_field="receiver"/>
9432             </actions>
9433         </permacrud>
9434         </class>
9435
9436         <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">
9437                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9438                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9439                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9440                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9441                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9442                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" oils_obj:required="true"/>
9443                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int"/>
9444                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9445                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool"/>
9446                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9447                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9448                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9449                 </fields>
9450                 <links>
9451                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9452                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9453                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9454                 </links>
9455         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9456             <actions>
9457                 <create permission="ADMIN_INVOICE">
9458                                         <context link="invoice" field="receiver"/>
9459                                 </create>
9460                 <retrieve permission="ADMIN_INVOICE">
9461                                         <context link="invoice" field="receiver"/>
9462                                 </retrieve>
9463                 <update permission="ADMIN_INVOICE">
9464                                         <context link="invoice" field="receiver"/>
9465                                 </update>
9466                                 <delete permission="ADMIN_INVOICE">
9467                                         <context link="invoice" field="receiver"/>
9468                                 </delete>
9469             </actions>
9470         </permacrud>
9471         </class>
9472
9473         <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">
9474                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9475                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9476                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" oils_obj:required="true"/>
9477                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9478                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9479                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
9480                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text"/>
9481                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9482                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9483                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money"/>
9484                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money"/>
9485                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9486                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money"/>
9487                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link"/>
9488                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
9489                 </fields>
9490                 <links>
9491                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9492                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9493                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9494                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9495                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9496                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9497                 </links>
9498         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9499             <actions>
9500                 <create permission="ADMIN_INVOICE">
9501                                         <context link="invoice" field="receiver"/>
9502                                 </create>
9503                 <retrieve permission="ADMIN_INVOICE">
9504                                         <context link="invoice" field="receiver"/>
9505                                 </retrieve>
9506                 <update permission="ADMIN_INVOICE">
9507                                         <context link="invoice" field="receiver"/>
9508                                 </update>
9509                                 <delete permission="ADMIN_INVOICE">
9510                                         <context link="invoice" field="receiver"/>
9511                                 </delete>
9512             </actions>
9513         </permacrud>
9514         </class>
9515
9516         <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">
9517                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9518                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9519                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" oils_obj:required="true"/>
9520                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9521                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link" oils_obj:required="true"/>
9522                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp"/>
9523                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link"/>
9524                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp"/>
9525                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link"/>
9526                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" oils_obj:required="true"/>
9527                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text"/>
9528                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9529                         <field reporter:label="Shipment Notification Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9530                 </fields>
9531                 <links>
9532                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9533                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9534                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9535                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9536                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9537                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9538                 </links>
9539                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9540                         <actions>
9541                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9542                                 <update permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9543                                 <delete permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9544                         </actions>
9545                 </permacrud>
9546         </class>
9547
9548         <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">
9549                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9550                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9551                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" oils_obj:required="true"/>
9552                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9553                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
9554                 </fields>
9555                 <links>
9556                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9557                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9558                 </links>
9559                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9560                                 <actions>
9561                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9562                                                 <context link="shipment_notification" field="receiver"/>
9563                                         </retrieve>
9564                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9565                                                 <context link="shipment_notification" field="receiver"/>
9566                                         </update>
9567                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9568                                                 <context link="shipment_notification" field="receiver"/>
9569                                         </delete>
9570                                 </actions>
9571                         </permacrud>
9572         </class>
9573
9574         <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">
9575                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9576                         <field reporter:label="Address Type" name="address_type" reporter:datatype="text"/>
9577                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9578                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9579                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9580                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9581                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9582                         <field reporter:label="Post Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9583                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9584                         <field reporter:label="Street 1" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9585                         <field reporter:label="Street 2" name="street2" reporter:datatype="text"/>
9586                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9587                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9588                 </fields>
9589                 <links>
9590                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9591                 </links>
9592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9593             <actions>
9594                 <create permission="ADMIN_PROVIDER">
9595                     <context link="provider" field="owner"/>
9596                 </create>
9597                 <retrieve permission="ADMIN_PROVIDER">
9598                     <context link="provider" field="owner"/>
9599                 </retrieve>
9600                 <update permission="ADMIN_PROVIDER">
9601                     <context link="provider" field="owner"/>
9602                 </update>
9603                 <delete permission="ADMIN_PROVIDER">
9604                     <context link="provider" field="owner"/>
9605                 </delete>
9606             </actions>
9607         </permacrud>
9608         </class>
9609
9610         <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">
9611                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9612                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9613                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9614                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9615                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9616                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9617                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9618                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9619         </fields>
9620                 <links>
9621                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9622                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9623                 </links>
9624         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9625             <actions>
9626                 <create permission="ADMIN_PROVIDER">
9627                     <context link="provider" field="owner"/>
9628                 </create>
9629                 <retrieve permission="ADMIN_PROVIDER">
9630                     <context link="provider" field="owner"/>
9631                 </retrieve>
9632                 <update permission="ADMIN_PROVIDER">
9633                     <context link="provider" field="owner"/>
9634                 </update>
9635                 <delete permission="ADMIN_PROVIDER">
9636                     <context link="provider" field="owner"/>
9637                 </delete>
9638             </actions>
9639         </permacrud>
9640     </class>
9641         <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">
9642                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9643                         <field reporter:label="Type" name="address_type" reporter:datatype="text"/>
9644                         <field reporter:label="City" name="city" reporter:datatype="text" oils_obj:required="true"/>
9645                         <field reporter:label="Country" name="country" reporter:datatype="text" oils_obj:required="true"/>
9646                         <field reporter:label="County" name="county" reporter:datatype="text"/>
9647                         <field reporter:label="Address ID" name="id" reporter:datatype="id"/>
9648                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9649                         <field reporter:label="State" name="state" reporter:datatype="text" oils_obj:required="true"/>
9650                         <field reporter:label="Street (1)" name="street1" reporter:datatype="text" oils_obj:required="true"/>
9651                         <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9652                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9653                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9654                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9655                 </fields>
9656                 <links>
9657                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9658                 </links>
9659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9660             <actions>
9661                 <create permission="ADMIN_PROVIDER">
9662                     <context link="contact" jump="provider" field="owner"/>
9663                 </create>
9664                 <retrieve permission="ADMIN_PROVIDER">
9665                     <context link="contact" jump="provider" field="owner"/>
9666                 </retrieve>
9667                 <update permission="ADMIN_PROVIDER">
9668                     <context link="contact" jump="provider" field="owner"/>
9669                 </update>
9670                 <delete permission="ADMIN_PROVIDER">
9671                     <context link="contact" jump="provider" field="owner"/>
9672                 </delete>
9673             </actions>
9674         </permacrud>
9675         </class>
9676
9677         <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">
9678                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9679                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9680                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link" oils_obj:required="true"/>
9681                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money" oils_obj:required="true"/>
9682                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9683                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9684                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9685                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link" oils_obj:required="true"/>
9686                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9687                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link" oils_obj:required="true"/>
9688                 </fields>
9689                 <links>
9690                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9691                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9692                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9693                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9694                 </links>
9695         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9696             <actions>
9697                 <create permission="ADMIN_ACQ_FUND">
9698                     <context link="src_fund" field="org"/>
9699                 </create>
9700                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9701                     <context link="src_fund" field="org"/>
9702                     <context link="dest_fund" field="org"/>
9703                 </retrieve>
9704                 <update permission="ADMIN_ACQ_FUND">
9705                     <context link="src_fund" field="org"/>
9706                 </update>
9707                 <delete permission="ADMIN_ACQ_FUND">
9708                     <context link="src_fund" field="org"/>
9709                 </delete>
9710             </actions>
9711         </permacrud>
9712         </class>
9713
9714         <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">
9715                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9716                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector="name" oils_obj:required="true"/>
9717                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9718                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9719                 </fields>
9720                 <links>
9721             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9722                 </links>
9723                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9724                         <actions>
9725                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9726                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9727                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9728                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9729                         </actions>
9730                 </permacrud>
9731         </class>
9732
9733         <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">
9734                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9735                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector="year" oils_obj:required="true"/>
9736                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link" oils_obj:required="true"/>
9737                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9738                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp" oils_obj:required="true"/>
9739                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp" oils_obj:required="true"/>
9740                 </fields>
9741                 <links>
9742                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9743                 </links>
9744                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9745                         <actions>
9746                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9747                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9748                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9749                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9750                         </actions>
9751                 </permacrud>
9752         </class>
9753
9754         <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">
9755                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9756                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9757                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9758                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9759                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9760                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9761                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
9762                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9763                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9764                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9765                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9766                 </fields>
9767                 <links>
9768                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9769                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9770             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9771             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9772                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9773                 </links>
9774         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9775             <actions>
9776                 <create permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9777                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9778                 <update permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9779                 <delete permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9780             </actions>
9781         </permacrud>
9782         </class>
9783
9784         <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">
9785                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9786                         <field reporter:label="Credit ID" name="id" reporter:datatype="id"/>
9787                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
9788                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9789                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9790                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp"/>
9791                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp"/>
9792                 </fields>
9793                 <links>
9794                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9795                 </links>
9796                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9797                         <actions>
9798                                 <create permission="ADMIN_FUNDING_SOURCE">
9799                     <context link="funding_source" field="owner"/>
9800                 </create>
9801                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9802                     <context link="funding_source" field="owner"/>
9803                 </retrieve>
9804                                 <update permission="ADMIN_FUNDING_SOURCE">
9805                     <context link="funding_source" field="owner"/>
9806                 </update>
9807                                 <delete permission="ADMIN_FUNDING_SOURCE">
9808                     <context link="funding_source" field="owner"/>
9809                 </delete>
9810                         </actions>
9811                 </permacrud>
9812         </class>
9813
9814         <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">
9815                 <fields oils_persist:primary="id">
9816                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9817                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9818                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9819                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9820                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9821                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9822                 </fields>
9823                 <links>
9824                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9825                 </links>
9826         </class>
9827
9828         <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">
9829                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9830                         <field reporter:label="Debit ID" name="id" reporter:datatype="id"/>
9831                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
9832                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" oils_obj:required="true"/>
9833                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" oils_obj:required="true"/>
9834                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
9835                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool"/>
9836                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" oils_obj:required="true"/>
9837                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp"/>
9838                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link"/>
9839                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9840                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
9841                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
9842                 </fields>
9843                 <links>
9844                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9845                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9846                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9847                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9848                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9849                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9850                 </links>
9851                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9852                         <actions>
9853                                 <create permission="ADMIN_ACQ_FUND">
9854                     <context link="fund" field="org"/>
9855                 </create>
9856                                 <retrieve permission="ADMIN_ACQ_FUND">
9857                     <context link="fund" field="org"/>
9858                 </retrieve>
9859                                 <update permission="ADMIN_ACQ_FUND">
9860                     <context link="fund" field="org"/>
9861                 </update>
9862                                 <delete permission="ADMIN_ACQ_FUND">
9863                     <context link="fund" field="org"/>
9864                 </delete>
9865                         </actions>
9866                 </permacrud>
9867         </class>
9868
9869         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9870                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9871                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
9872                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
9873                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9874                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9875                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true"/>
9876                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9877                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
9878                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
9879                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
9880                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
9881                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
9882                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9883                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9884                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9885                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9886                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9887                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9888                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9889                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9890                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9891                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9892                 </fields>
9893                 <links>
9894                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9895                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9896             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9897             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9898             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9899             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9900             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9901             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9902             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9903             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9904             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9905                 </links>
9906         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9907             <actions>
9908                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9909                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9910                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9911                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9912             </actions>
9913         </permacrud>
9914         </class>
9915
9916         <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">
9917                 <fields oils_persist:primary="fund">
9918                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9919                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
9920                 </fields>
9921                 <links>
9922                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9923                 </links>
9924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9925             <actions>
9926                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9927                                         <context link="fund" field="org"/>
9928                 </retrieve>
9929             </actions>
9930         </permacrud>
9931         </class>
9932
9933         <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">
9934                 <fields oils_persist:primary="fund">
9935                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9936                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money"/>
9937                 </fields>
9938                 <links>
9939                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9940                 </links>
9941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9942             <actions>
9943                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9944                                         <context link="fund" field="org"/>
9945                 </retrieve>
9946             </actions>
9947         </permacrud>
9948         </class>
9949
9950         <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">
9951                 <fields oils_persist:primary="fund">
9952                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9953                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money"/>
9954                 </fields>
9955                 <links>
9956                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9957                 </links>
9958         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9959             <actions>
9960                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9961                                         <context link="fund" field="org"/>
9962                 </retrieve>
9963             </actions>
9964         </permacrud>
9965         </class>
9966
9967         <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">
9968                 <fields oils_persist:primary="fund">
9969                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9970                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
9971                 </fields>
9972                 <links>
9973                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9974                 </links>
9975         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9976             <actions>
9977                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9978                                         <context link="fund" field="org"/>
9979                 </retrieve>
9980             </actions>
9981         </permacrud>
9982         </class>
9983
9984         <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">
9985                 <fields oils_persist:primary="fund">
9986                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
9987                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money"/>
9988                 </fields>
9989                 <links>
9990                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9991                 </links>
9992         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9993             <actions>
9994                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9995                                         <context link="fund" field="org"/>
9996                 </retrieve>
9997             </actions>
9998         </permacrud>
9999         </class>
10000
10001    <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">
10002         <fields oils_persist:primary="fund">
10003             <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10004             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money"/>
10005         </fields>
10006         <links>
10007             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10008         </links>
10009     </class>
10010
10011    <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">
10012         <fields oils_persist:primary="fund">
10013             <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10014             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money"/>
10015         </fields>
10016         <links>
10017             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10018         </links>
10019     </class>
10020
10021    <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">
10022         <fields oils_persist:primary="fund">
10023             <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10024             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money"/>
10025         </fields>
10026         <links>
10027             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10028         </links>
10029     </class>
10030
10031    <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">
10032         <fields oils_persist:primary="fund">
10033             <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10034             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money"/>
10035         </fields>
10036         <links>
10037             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10038         </links>
10039     </class>
10040
10041    <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">
10042         <fields oils_persist:primary="fund">
10043             <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10044             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money"/>
10045         </fields>
10046         <links>
10047             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10048         </links>
10049     </class>
10050
10051         <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">
10052                 <fields oils_persist:primary="funding_source">
10053                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10054                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money"/>
10055                 </fields>
10056                 <links>
10057                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10058                 </links>
10059         </class>
10060
10061         <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">
10062                 <fields oils_persist:primary="funding_source">
10063                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10064                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money"/>
10065                 </fields>
10066                 <links>
10067                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10068                 </links>
10069         </class>
10070
10071         <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">
10072                 <fields oils_persist:primary="funding_source">
10073                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link"/>
10074                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money"/>
10075                 </fields>
10076                 <links>
10077                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10078                 </links>
10079         </class>
10080
10081         <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">
10082                 <fields oils_persist:primary="fund">
10083                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
10084                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money"/>
10085                 </fields>
10086                 <links>
10087                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10088                 </links>
10089         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10090             <actions>
10091                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10092                                         <context link="fund" field="org"/>
10093                 </retrieve>
10094             </actions>
10095         </permacrud>
10096     </class>
10097     <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">
10098         <oils_persist:source_definition><![CDATA[
10099             SELECT
10100                 acqf.*,
10101                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10102                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10103                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10104                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10105             FROM
10106                 acq.fund acqf
10107                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10108                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10109                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10110                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10111         ]]></oils_persist:source_definition>
10112         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10113             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10114             <field reporter:label="Owner" name="org" reporter:datatype="org_unit"/>
10115             <field reporter:label="Name" name="name" reporter:datatype="text"/>
10116             <field reporter:label="Year" name="year" reporter:datatype="int"/>
10117             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link"/>
10118             <field reporter:label="Code" name="code" reporter:datatype="text"/>
10119             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool"/>
10120             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool"/>
10121             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
10122             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int"/>
10123             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int"/>
10124
10125             <!-- non fund-native fields -->
10126             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10127             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10128             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10129             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10130         </fields>
10131         <links>
10132             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10133             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10134             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10135         </links>
10136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10137             <actions>
10138                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10139             </actions>
10140         </permacrud>
10141         </class>
10142         <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">
10143                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10144                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10145                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true"/>
10146                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10147                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true"/>
10148                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10149                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10150                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp"/>
10151                 </fields>
10152                 <links>
10153                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10154                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10155                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10156                 </links>
10157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10158                         <actions>
10159                                 <create permission="ADMIN_ACQ_FUND">
10160                     <context link="fund" field="org"/>
10161                 </create>
10162                                 <retrieve permission="ADMIN_ACQ_FUND">
10163                     <context link="fund" field="org"/>
10164                 </retrieve>
10165                                 <update permission="ADMIN_ACQ_FUND">
10166                     <context link="fund" field="org"/>
10167                 </update>
10168                                 <delete permission="ADMIN_ACQ_FUND">
10169                     <context link="fund" field="org"/>
10170                 </delete>
10171                         </actions>
10172                 </permacrud>
10173         </class>
10174
10175     <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">
10176         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10177             <field reporter:label="Allocation ID" name="id" reporter:datatype="id"/>
10178             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true"/>
10179             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true"/>
10180             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text"/>
10181             <field reporter:label="Percent" name="percent" reporter:datatype="float" oils_obj:required="true"/>
10182             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true"/>
10183             <field reporter:label="Note" name="note" reporter:datatype="text"/>
10184             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10185         </fields>
10186         <links>
10187             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10188             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10189             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10190         </links>
10191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10192                         <actions>
10193                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10194                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10195                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10196                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10197                         </actions>
10198                 </permacrud>
10199     </class>
10200
10201         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10202                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10203                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10204                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10205                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10206                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10207                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10208                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10209                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
10210                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10211                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10212                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10213                 </fields>
10214                 <links>
10215                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10216                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10217                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10218                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10219                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10220                 </links>
10221                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10222                         <actions>
10223                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10224                         </actions>
10225                 </permacrud>
10226         </class>
10227
10228         <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">
10229                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10230                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
10231                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
10232                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10233                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10234                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10235                 </fields>
10236                 <links>
10237                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10238                 </links>
10239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10240                         <actions>
10241                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10242                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10243                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10244                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10245                         </actions>
10246                 </permacrud>
10247         </class>
10248
10249         <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">
10250                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10251                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10252                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10253                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10254                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10255                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10256                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10257                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" oils_obj:required="true"/>
10258                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10259                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10260                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10261                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10262                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10263                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool"/>
10264                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link"/>
10265                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
10266                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int"/>
10267                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float"/>
10268                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float"/>
10269                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float"/>
10270                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link"/>
10271                 </fields>
10272                 <links>
10273                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10274                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10275                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10276                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10277                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10278                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10279                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10280                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10281                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10282                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10283                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10284                 </links>
10285                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10286                         <actions>
10287                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10288                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10289                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10290                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10291                         </actions>
10292                 </permacrud>
10293         </class>
10294
10295         <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">
10296                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10297                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10298                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10299                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10300                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10301                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
10302                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10303                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10304                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link" oils_obj:required="true"/>
10305                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10306                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10307                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10308                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10309                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10310                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10311                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10312                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" oils_obj:required="true"/>
10313                 </fields>
10314                 <links>
10315                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10316                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10317                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10318                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10319                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10320                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10321                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10322                 </links>
10323                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10324             <actions>
10325                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10326             </actions>
10327                 </permacrud>
10328         </class>
10329
10330         <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">
10331                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10332                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id"/>
10333                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" oils_obj:required="true"/>
10334                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10335                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10336                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10337                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10338                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10339                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10340                 </fields>
10341                 <links>
10342                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10343                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10344                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10345                 </links>
10346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10347             <actions>
10348                 <create permission="CREATE_PURCHASE_ORDER">
10349                     <context link="purchase_order" field="ordering_agency"/>
10350                 </create>
10351                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10352                     <context link="purchase_order" field="ordering_agency"/>
10353                 </retrieve>
10354                 <update permission="CREATE_PURCHASE_ORDER">
10355                     <context link="purchase_order" field="ordering_agency"/>
10356                 </update>
10357                 <delete permission="CREATE_PURCHASE_ORDER">
10358                     <context link="purchase_order" field="ordering_agency"/>
10359                 </delete>
10360             </actions>
10361                 </permacrud>
10362         </class>
10363
10364         <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">
10365                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10366                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10367                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10368                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10369                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" oils_obj:required="true"/>
10370                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10371                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10372                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10373                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10374                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10375                         <field reporter:label="Target" name="target" reporter:datatype="int"/>
10376                 </fields>
10377                 <links>
10378                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10379                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10380                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10381                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10382                 </links>
10383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10384             <actions>
10385                 <create permission="CREATE_PURCHASE_ORDER">
10386                     <context link="purchase_order" field="ordering_agency"/>
10387                 </create>
10388                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10389                     <context link="purchase_order" field="ordering_agency"/>
10390                 </retrieve>
10391                 <update permission="CREATE_PURCHASE_ORDER">
10392                     <context link="purchase_order" field="ordering_agency"/>
10393                 </update>
10394                 <delete permission="CREATE_PURCHASE_ORDER">
10395                     <context link="purchase_order" field="ordering_agency"/>
10396                 </delete>
10397             </actions>
10398                 </permacrud>
10399         </class>
10400
10401         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10402                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10403                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id"/>
10404                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10405                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10406                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10407                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10408                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10409                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10410                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10411                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10412                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10413                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp"/>
10414                         <field reporter:label="Status" name="state" reporter:datatype="link"/>
10415                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10416                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10417                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10418                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10419                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10420                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10421                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int"/>
10422                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
10423                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link"/>
10424                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link"/>
10425                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link"/>
10426                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link"/>
10427                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link"/>
10428                 </fields>
10429                 <links>
10430                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10431                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10432                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10433                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10434                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10435                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10436                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10437                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10438                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10439                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10440                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10441                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10442                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10443                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10444                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10445                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10446                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10447                 </links>
10448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10449                         <actions>
10450                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10451                                         <context link="purchase_order" field="ordering_agency"/>
10452                                         <context link="picklist" field="org_unit"/>
10453                                 </retrieve>
10454                         </actions>
10455                 </permacrud>
10456         </class>
10457
10458         <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">
10459                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10460                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id" oils_obj:required="true"/>
10461                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10462                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text" oils_obj:required="true"/>
10463                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link" oils_obj:required="true"/>
10464                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10465                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10466                         <field reporter:label="Selector" name="selector" reporter:datatype="link" oils_obj:required="true"/>
10467                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10468                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10469                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10470                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10471                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10472                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" oils_obj:required="true"/>
10473                         <field reporter:label="MARC" name="marc" reporter:datatype="text" oils_obj:required="true"/>
10474                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10475                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10476                         <field reporter:label="Status" name="state" reporter:datatype="text" oils_obj:required="true"/>
10477                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10478                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10479                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money"/>
10480                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link"/>
10481                 </fields>
10482                 <links>
10483                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10484                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10485                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10486                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10487                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10488                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10489                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10490                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10491                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10492                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10493                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10494                 </links>
10495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10496                         <actions>
10497                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10498                                         <context link="purchase_order" field="ordering_agency"/>
10499                                         <context link="picklist" field="org_unit"/>
10500                                 </retrieve>
10501                         </actions>
10502                 </permacrud>
10503         </class>
10504
10505         <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">
10506                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10507                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10508                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10509                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10510                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
10511                 </fields>
10512                 <links>
10513                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10514                 </links>
10515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10516                         <actions>
10517                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10518                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10519                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10520                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10521                         </actions>
10522                 </permacrud>
10523         </class>
10524
10525         <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">
10526                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10527                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id"/>
10528                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10529                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10530                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10531                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10532                         <field reporter:label="Editor" name="editor" reporter:datatype="link" oils_obj:required="true"/>
10533                         <field reporter:label="Note Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
10534                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link"/>
10535                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool"/>
10536                 </fields>
10537                 <links>
10538                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10539                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10540                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10541                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10542                 </links>
10543         </class>
10544
10545         <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">
10546                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10547                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id"/>
10548                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10549                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" oils_obj:required="true"/>
10550                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" oils_obj:required="true"/>
10551                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" oils_obj:required="true"/>
10552                         <field reporter:label="Definition" name="definition" reporter:datatype="text" oils_obj:required="true"/>
10553                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool"/>
10554                 </fields>
10555                 <links>
10556                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10557                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10558                 </links>
10559         </class>
10560
10561         <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">
10562                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10563                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id"/>
10564                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
10565                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link"/>
10566                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10567                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text"/>
10568                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp"/>
10569                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link"/>
10570                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10571                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10572                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10573                         <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
10574                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
10575                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10576                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
10577                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10578                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true"/>
10579                 </fields>
10580                 <links>
10581                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10582                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10583                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10584                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10585                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10586                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10587                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10588                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10589                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10590                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10591                 </links>
10592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10593             <actions>
10594                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10595                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10596                     <context link="lineitem" jump="picklist" field="org_unit"/>
10597                 </retrieve>
10598             </actions>
10599         </permacrud>
10600         </class>
10601
10602         <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">
10603                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10604                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10605                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10606                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10607                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10608                 </fields>
10609                 <links/>
10610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10611                         <actions>
10612                                 <retrieve/>
10613                         </actions>
10614                 </permacrud>
10615         </class>
10616
10617         <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">
10618                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10619                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10620                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10621                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10622                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10623                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10624             <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10625                 </fields>
10626                 <links/>
10627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10628             <actions>
10629                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10630                 <retrieve/>
10631                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10632                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10633             </actions>
10634         </permacrud>
10635         </class>
10636
10637         <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">
10638                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10639                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10640                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10641                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10642                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10643                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10644                 </fields>
10645                 <links/>
10646         </class>
10647         <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">
10648                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10649                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10650                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10651                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10652                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
10653                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10654                 </fields>
10655                 <links>
10656                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10657                 </links>
10658         </class>
10659
10660         <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">
10661             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10662                 <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10663                 <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10664                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10665                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10666                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10667                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10668         <field reporter:label="Remove" name="remove" reporter:datatype="text"/>
10669
10670             </fields>
10671             <links>
10672                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10673             </links>
10674             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10675                 <actions>
10676                     <create permission="ADMIN_PROVIDER">
10677                         <context link="provider" field="owner"/>
10678                     </create>
10679                     <retrieve permission="ADMIN_PROVIDER">
10680                         <context link="provider" field="owner"/>
10681                     </retrieve>
10682                     <update permission="ADMIN_PROVIDER">
10683                         <context link="provider" field="owner"/>
10684                     </update>
10685                     <delete permission="ADMIN_PROVIDER">
10686                         <context link="provider" field="owner"/>
10687                     </delete>
10688                 </actions>
10689             </permacrud>
10690         </class>
10691         
10692         <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">
10693             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10694                 <field reporter:label="ID" name="id" reporter:datatype="id"/>
10695                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
10696                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10697                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
10698             </fields>
10699             <links>
10700                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10701             </links>
10702             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10703                 <actions>
10704                     <create permission="ADMIN_PROVIDER">
10705                         <context link="provider" field="owner"/>
10706                     </create>
10707                     <retrieve permission="ADMIN_PROVIDER">
10708                         <context link="provider" field="owner"/>
10709                     </retrieve>
10710                     <update permission="ADMIN_PROVIDER">
10711                         <context link="provider" field="owner"/>
10712                     </update>
10713                     <delete permission="ADMIN_PROVIDER">
10714                         <context link="provider" field="owner"/>
10715                     </delete>
10716                 </actions>
10717             </permacrud>
10718         </class>
10719         
10720         <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">
10721             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10722                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
10723                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
10724                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
10725                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10726                 </fields>
10727                 <links/>
10728         </class>
10729
10730         <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">
10731                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10732                         <field name="id" reporter:datatype="id" reporter:label="EDI Account ID" reporter:selector="label"/>
10733                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10734                         <field name="host" reporter:datatype="text" reporter:label="Host" oils_obj:required="true"/>
10735                         <field name="username" reporter:datatype="text" reporter:label="Username"/>
10736                         <field name="password" reporter:datatype="text" reporter:label="Password"/>
10737                         <field name="account" reporter:datatype="text" reporter:label="Account"/>
10738                         <field name="path" reporter:datatype="text" reporter:label="Path"/>
10739                         <field name="owner" reporter:datatype="link" reporter:label="Owner" oils_obj:required="true"/>
10740                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10741                         <field name="provider" reporter:datatype="link" reporter:label="Provider" oils_obj:required="true"/>
10742                         <field name="in_dir" reporter:datatype="text" reporter:label="Incoming Directory"/>
10743                         <field name="vendacct" reporter:datatype="text" reporter:label="Vendor Account Number"/>
10744                         <field name="vendcode" reporter:datatype="text" reporter:label="Vendor Assigned Code"/>
10745                         <field name="attr_set" reporter:datatype="link" reporter:label="EDI Attribute Set"/>
10746                         <field name="use_attrs" reporter:datatype="bool" reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10747                 </fields>
10748                 <links>
10749                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10750                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10751                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10752                 </links>
10753         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10754             <actions>
10755                 <create permission="ADMIN_PROVIDER">
10756                     <context link="provider" field="owner"/>
10757                 </create>
10758                 <retrieve permission="ADMIN_PROVIDER">
10759                     <context link="provider" field="owner"/>
10760                 </retrieve>
10761                 <update permission="ADMIN_PROVIDER">
10762                     <context link="provider" field="owner"/>
10763                 </update>
10764                 <delete permission="ADMIN_PROVIDER">
10765                     <context link="provider" field="owner"/>
10766                 </delete>
10767             </actions>
10768         </permacrud>
10769         </class>
10770
10771         <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">
10772                 <fields oils_persist:primary="key">
10773                         <field name="key" reporter:datatype="text" reporter:label="Key" reporter:selector="label" oils_obj:required="true"/>
10774                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10775                 </fields>
10776         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10777             <actions>
10778                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10779                 <retrieve/>
10780                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10781                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10782             </actions>
10783         </permacrud>
10784         </class>
10785         <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">
10786                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10787                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10788                         <field name="label" reporter:datatype="text" reporter:label="Label" oils_obj:required="true"/>
10789                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10790                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10791                 </fields>
10792                 <links>
10793                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10794                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10795                 </links>
10796         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10797             <actions>
10798                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10799                 <retrieve/>
10800                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10801                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10802             </actions>
10803         </permacrud>
10804         </class>
10805         <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">
10806                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10807                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="label"/>
10808                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set" oils_obj:required="true"/>
10809                         <field name="attr" reporter:datatype="link" reporter:label="Attribute" oils_obj:required="true"/>
10810                 </fields>
10811                 <links>
10812                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10813                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10814                 </links>
10815         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10816             <actions>
10817                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10818                 <retrieve/>
10819                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10820                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10821             </actions>
10822         </permacrud>
10823         </class>
10824
10825
10826         <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">
10827                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10828                         <field name="id" reporter:datatype="id" reporter:label="EDI Message ID"/>
10829                         <field name="account" reporter:datatype="link" reporter:label="EDI Account"/>
10830                         <field name="remote_file" reporter:datatype="text" reporter:label="Filename"/>
10831                         <field name="create_time" reporter:datatype="timestamp" reporter:label="Time Created"/>
10832                         <field name="translate_time" reporter:datatype="timestamp" reporter:label="Time Translated"/>
10833                         <field name="process_time" reporter:datatype="timestamp" reporter:label="Time Processed"/>
10834                         <field name="error_time" reporter:datatype="timestamp" reporter:label="Time of Error"/>
10835                         <field name="status" reporter:datatype="text" reporter:label="Status"/>
10836                         <field name="edi" reporter:datatype="text" reporter:label="EDI Message Body"/>
10837                         <field name="jedi" reporter:datatype="text" reporter:label="JEDI Message Body"/>
10838                         <field name="error" reporter:datatype="text" reporter:label="Error"/>
10839                         <field name="purchase_order" reporter:datatype="link" reporter:label="Purchase Order"/>
10840                         <field name="message_type" reporter:datatype="text" reporter:label="Message Type" oils_obj:required="true"/>
10841                 </fields>
10842                 <links>
10843                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10844                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10845                 </links>
10846         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10847             <actions>
10848                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10849                     <context link="account" jump="provider" field="owner"/>
10850                 </retrieve>
10851                 <update permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10852                     <context link="account" jump="provider" field="owner"/>
10853                 </update>
10854                 <delete permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10855                     <context link="account" jump="provider" field="owner"/>
10856                 </delete>
10857             </actions>
10858         </permacrud>
10859         </class>
10860
10861
10862         <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">
10863                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10864                         <field name="id" reporter:datatype="id"/>
10865                         <field name="parent" reporter:datatype="link"/>
10866                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10867                         <field name="create_time" reporter:datatype="timestamp"/>
10868                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10869                         <field name="shared" reporter:datatype="bool"/>
10870                         <field name="share_with" reporter:datatype="link"/>
10871                         <field name="simple_reporter" reporter:datatype="bool"/>
10872                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10873                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10874                 </fields>
10875                 <links>
10876                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10877                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10878                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10879                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10880                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10881                 </links>
10882         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10883             <actions>
10884                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10885                     <context link="owner" field="home_ou"/>
10886                 </create>
10887                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10888                     <context link="owner" field="home_ou"/>
10889                 </retrieve>
10890                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10891                     <context link="owner" field="home_ou"/>
10892                 </update>
10893                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10894                     <context link="owner" field="home_ou"/>
10895                 </delete>
10896             </actions>
10897         </permacrud>
10898         </class>
10899         <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">
10900                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10901                         <field name="id" reporter:datatype="id"/>
10902                         <field name="parent" reporter:datatype="link"/>
10903                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10904                         <field name="create_time" reporter:datatype="timestamp"/>
10905                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10906                         <field name="shared" reporter:datatype="bool"/>
10907                         <field name="share_with" reporter:datatype="link"/>
10908                         <field name="simple_reporter" reporter:datatype="bool"/>
10909                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10910                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10911                 </fields>
10912                 <links>
10913                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10914                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10915                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10916                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10917                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10918                 </links>
10919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10920             <actions>
10921                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10922                     <context link="owner" field="home_ou"/>
10923                 </create>
10924                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10925                     <context link="owner" field="home_ou"/>
10926                 </retrieve>
10927                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10928                     <context link="owner" field="home_ou"/>
10929                 </update>
10930                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10931                     <context link="owner" field="home_ou"/>
10932                 </delete>
10933             </actions>
10934         </permacrud>
10935         </class>
10936         <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">
10937                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10938                         <field name="id" reporter:datatype="id"/>
10939                         <field name="parent" reporter:datatype="link"/>
10940                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10941                         <field name="create_time" reporter:datatype="timestamp"/>
10942                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10943                         <field name="shared" reporter:datatype="bool"/>
10944                         <field name="share_with" reporter:datatype="link"/>
10945                         <field name="simple_reporter" reporter:datatype="bool"/>
10946                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10947                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10948                 </fields>
10949                 <links>
10950                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10951                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10952                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10953                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10954                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10955                 </links>
10956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10957             <actions>
10958                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10959                     <context link="owner" field="home_ou"/>
10960                 </create>
10961                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10962                     <context link="owner" field="home_ou"/>
10963                 </retrieve>
10964                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10965                     <context link="owner" field="home_ou"/>
10966                 </update>
10967                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10968                     <context link="owner" field="home_ou"/>
10969                 </delete>
10970             </actions>
10971         </permacrud>
10972         </class>
10973         <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">
10974                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10975                         <field name="id" reporter:datatype="id"/>
10976                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
10977                         <field name="create_time" reporter:datatype="timestamp"/>
10978                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
10979                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
10980                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
10981                         <field name="description" reporter:datatype="text"/>
10982                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10983                 </fields>
10984                 <links>
10985                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10986                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10987                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10988                 </links>
10989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10990             <actions>
10991                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10992                     <context link="owner" field="home_ou"/>
10993                 </create>
10994                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10995                     <context link="owner" field="home_ou"/>
10996                 </retrieve>
10997                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10998                     <context link="owner" field="home_ou"/>
10999                 </update>
11000                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11001                     <context link="owner" field="home_ou"/>
11002                 </delete>
11003             </actions>
11004         </permacrud>
11005         </class>
11006         <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">
11007                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11008                         <field name="id" reporter:datatype="id"/>
11009                         <field name="owner" reporter:datatype="link" oils_obj:required="true"/>
11010                         <field name="create_time" reporter:datatype="timestamp"/>
11011                         <field name="template" reporter:datatype="link" oils_obj:required="true"/>
11012                         <field name="data" reporter:datatype="text" oils_obj:required="true"/>
11013                         <field name="folder" reporter:datatype="link" oils_obj:required="true"/>
11014                         <field name="recur" reporter:datatype="bool"/>
11015                         <field name="recurrence" reporter:datatype="interval"/>
11016                         <field name="name" reporter:datatype="text"/>
11017                         <field name="description" reporter:datatype="text"/>
11018                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11019                 </fields>
11020                 <links>
11021                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11022                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11023                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11024                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11025                 </links>
11026         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11027             <actions>
11028                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11029                     <context link="owner" field="home_ou"/>
11030                 </create>
11031                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11032                     <context link="owner" field="home_ou"/>
11033                 </retrieve>
11034                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11035                     <context link="owner" field="home_ou"/>
11036                 </update>
11037                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11038                     <context link="owner" field="home_ou"/>
11039                 </delete>
11040             </actions>
11041         </permacrud>
11042         </class>
11043         <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">
11044                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11045                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
11046                         <field reporter:label="Runner" name="runner" reporter:datatype="link" oils_obj:required="true"/>
11047                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11048                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11049                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11050                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11051                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11052                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11053                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11054                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11055                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11056                         <field reporter:label="Report" name="report" reporter:datatype="link" oils_obj:required="true"/>
11057                         <field reporter:label="Folder" name="folder" reporter:datatype="link" oils_obj:required="true"/>
11058                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11059                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11060                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11061                 </fields>
11062                 <links>
11063                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11064                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11065                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11066                 </links>
11067         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11068             <actions>
11069                 <create permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11070                     <context link="runner" field="home_ou"/>
11071                 </create>
11072                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11073                     <context link="runner" field="home_ou"/>
11074                 </retrieve>
11075                 <update permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11076                     <context link="runner" field="home_ou"/>
11077                 </update>
11078                 <delete permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11079                     <context link="runner" field="home_ou"/>
11080                 </delete>
11081             </actions>
11082         </permacrud>
11083         </class>
11084     <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">
11085                 <fields oils_persist:primary="run">
11086             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11087             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11088             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11089             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11090             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11091             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11092             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11093             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11094             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11095             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11096             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11097             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11098             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11099             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11100             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11101             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11102                 </fields>
11103                 <links>
11104             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11105             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11106             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11107             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11108             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11109             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11110             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11111             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11112             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11113                 </links>
11114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11115             <actions>
11116                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11117                     <context link="runner" field="home_ou"/>
11118                 </retrieve>
11119             </actions>
11120         </permacrud>
11121     </class>
11122         <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">
11123                 <fields oils_persist:primary="id">
11124                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11125                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11126                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11127                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11128                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11129                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11130                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11131                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11132                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11133                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11134                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11135                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11136                 </fields>
11137                 <links>
11138                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11139                 </links>
11140                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11141                         <actions>
11142                                 <retrieve/>
11143                         </actions>
11144                 </permacrud>
11145         </class>
11146         <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">
11147                 <fields oils_persist:primary="id">
11148                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11149                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11150                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11151                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11152                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11153                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11154                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11155                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11156                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11157                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11158                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11159                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11160                 </fields>
11161                 <links>
11162                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11163                 </links>
11164         </class>
11165         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11166                 <fields oils_persist:primary="id">
11167                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11168                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11169                         <field reporter:label="Fingerprint" name="fingerprint"/>
11170                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11171                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11172                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11173                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11174                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11175                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11176                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11177                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11178                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11179                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11180                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11181                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11182                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11183                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11184                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11185                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11186                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11187                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11188                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11189                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11190                 </fields>
11191                 <links>
11192                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11193                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11194                 </links>
11195         </class>
11196         <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">
11197                 <fields oils_persist:primary="id">
11198                         <field reporter:label="User ID" name="id" reporter:datatype="id"/>
11199                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11200                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11201                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11202                 </fields>
11203                 <links>
11204                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11205                 </links>
11206         </class>
11207         <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">
11208                 <fields oils_persist:primary="id">
11209                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id"/>
11210                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11211                 </fields>
11212                 <links>
11213                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11214                 </links>
11215         </class>
11216         <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">
11217                 <fields oils_persist:primary="id">
11218                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11219                         <field reporter:label="Hold Target" name="target" reporter:datatype="int"/>
11220                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11221                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11222                 </fields>
11223                 <links>
11224                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11225                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11226                 </links>
11227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11228                         <actions>
11229                                 <retrieve permission="VIEW_HOLD">
11230                                         <context link="id" field="pickup_lib"/>
11231                                 </retrieve>
11232                         </actions>
11233                 </permacrud>
11234         </class>
11235         <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">
11236                 <fields oils_persist:primary="xact">
11237                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11238                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money"/>
11239                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11240                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11241                 </fields>
11242                 <links>
11243                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11244                 </links>
11245         </class>
11246         <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">
11247                 <fields oils_persist:primary="xact">
11248                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int"/>
11249                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money"/>
11250                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11251                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11252                 </fields>
11253                 <links>
11254                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11255                 </links>
11256         </class>
11257         <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)">
11258                 <fields oils_persist:primary="id">
11259                         <field reporter:label="Bib ID" name="id" reporter:datatype="id"/>
11260                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp"/>
11261                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text"/>
11262                 </fields>
11263                 <links>
11264                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11265                 </links>
11266         </class>
11267         <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">
11268                 <fields oils_persist:primary="id">
11269                         <field reporter:label="Copy ID" name="id" reporter:datatype="int"/>
11270                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int"/>
11271                 </fields>
11272                 <links>
11273                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11274                 </links>
11275                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11276                         <actions>
11277                                 <retrieve permission="STAFF_LOGIN">
11278                                         <context link="id" field="circ_lib"/>
11279                                 </retrieve>
11280                         </actions>
11281                 </permacrud>
11282         </class>
11283         <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">
11284                 <fields oils_persist:primary="bibid">
11285                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id"/>
11286                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link"/>
11287                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11288                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp"/>
11289                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int"/>
11290                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int"/>
11291                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int"/>
11292                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int"/>
11293                 </fields>
11294                 <links>
11295                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11296                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11297                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11298                 </links>
11299         </class>
11300         <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">
11301                 <fields oils_persist:primary="copy_id">
11302                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11303                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11304                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11305                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11306                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11307                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11308                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11309                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11310                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11311                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11312                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11313                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11314                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11315                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11316                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11317                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11318                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11319                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11320                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11321                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11322                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11323                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11324                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11325                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11326                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11327                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11328                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11329                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11330                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11331                 </fields>
11332                 <links>
11333                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11334                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11335                 </links>
11336         </class>
11337         <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">
11338                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11339                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11340                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
11341                         <field reporter:label="Formula Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11342                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11343                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11344                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11345                 </fields>
11346                 <links>
11347                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11348                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11349                 </links>
11350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11351                         <actions>
11352                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11353                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11354                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11355                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11356                         </actions>
11357                 </permacrud>
11358         </class>
11359         <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">
11360                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11361                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11362                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11363                         <field reporter:label="Position" name="position" reporter:datatype="int" oils_obj:required="true"/>
11364                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" oils_obj:required="true"/>
11365                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11366                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11367                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11368                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11369                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11370                 </fields>
11371                 <links>
11372                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11373                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11374                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11375                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11376                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11377                 </links>
11378                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11379                         <actions>
11380                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11381                                         <context link="formula" field="owner"/>
11382                                 </create>
11383                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11384                                         <context link="formula" field="owner"/>
11385                                 </retrieve>
11386                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11387                                         <context link="formula" field="owner"/>
11388                                 </update>
11389                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11390                                         <context link="formula" field="owner"/>
11391                                 </delete>
11392                         </actions>
11393                 </permacrud>
11394         </class>
11395
11396         <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">
11397                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11398                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11399                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11400                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11401                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link" oils_obj:required="true"/>
11402                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" oils_obj:required="true"/>
11403                 </fields>
11404                 <links>
11405                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11406                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11407                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11408                 </links>
11409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11410                         <actions>
11411                                 <create permission="CREATE_PURCHASE_ORDER">
11412                                         <context link="formula" field="owner"/>
11413                 </create>
11414                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11415                                         <context link="formula" field="owner"/>
11416                 </retrieve>
11417                                 <update permission="CREATE_PURCHASE_ORDER">
11418                                         <context link="formula" field="owner"/>
11419                 </update>
11420                                 <delete permission="CREATE_PURCHASE_ORDER">
11421                                         <context link="formula" field="owner"/>
11422                 </delete>
11423                         </actions>
11424                 </permacrud>
11425         </class>
11426
11427         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11428                 <fields oils_persist:primary="id">
11429                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
11430                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" oils_obj:required="true"/>
11431                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money" oils_obj:required="true"/>
11432                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11433                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11434                 </fields>
11435                 <links>
11436                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11437                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11438                 </links>
11439         </class>
11440
11441         <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">
11442                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11443                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11444                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11445                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11446                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11447                 </fields>
11448                 <links>
11449                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11450                 </links>
11451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11452                         <actions>
11453                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11454                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11455                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11456                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11457                         </actions>
11458                 </permacrud>
11459         </class>
11460
11461         <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">
11462                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11463                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code"/>
11464                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11465                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
11466                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11467                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11468                 </fields>
11469                 <links>
11470                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11471                 </links>
11472                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11473                         <actions>
11474                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11475                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11476                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11477                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11478                         </actions>
11479                 </permacrud>
11480         </class>
11481
11482         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11483                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11484                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11485                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11486                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link" oils_obj:required="true"/>
11487                 </fields>
11488                 <links>
11489                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11490                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11491                 </links>
11492         </class>
11493
11494         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11495                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11496                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11497                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11498                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11499                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11500                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11501                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11502                 </fields>
11503                 <links>
11504                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11505                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11506                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11507                 </links>
11508         </class>
11509
11510         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11511                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11512                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11513                         <field reporter:label="Claim Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11514                         <field reporter:label="Serial Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
11515                 </fields>
11516                 <links>
11517                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11518                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11519                 </links>
11520         </class>
11521
11522         <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">
11523                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11524                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11525                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
11526                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11527                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11528                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11529                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11530                 </fields>
11531                 <links>
11532                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11533                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11534                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11535                 </links>
11536         </class>
11537
11538         <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">
11539                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11540                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11541                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
11542                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11543                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11544                 </fields>
11545                 <links>
11546                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11547                 </links>
11548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11549             <actions>
11550                 <create permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11551                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11552                 <update permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11553                 <delete permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11554             </actions>
11555                 </permacrud>
11556         </class>
11557
11558         <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">
11559                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11560                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11561                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" oils_obj:required="true"/>
11562                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval" oils_obj:required="true"/>
11563                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link" oils_obj:required="true"/>
11564                 </fields>
11565                 <links>
11566                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11567                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11568                 </links>
11569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11570                         <actions>
11571                                 <create permission="ADMIN_CLAIM_POLICY">
11572                                         <context link="claim_policy" field="org_unit"/>
11573                 </create>
11574                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11575                                         <context link="claim_policy" field="org_unit"/>
11576                 </retrieve>
11577                                 <update permission="ADMIN_CLAIM_POLICY">
11578                                         <context link="claim_policy" field="org_unit"/>
11579                 </update>
11580                                 <delete permission="ADMIN_CLAIM_POLICY">
11581                                         <context link="claim_policy" field="org_unit"/>
11582                 </delete>
11583                         </actions>
11584                 </permacrud>
11585         </class>
11586
11587     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11588         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11589             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11590             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11591             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11592             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11593             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11594             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11595             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11596             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11597             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11598             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11599             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11600             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11601             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11602             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11603             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11604             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11605                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11606                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11607                                                 <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text"/>
11608         </fields>
11609         <links>
11610             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11611             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11612         </links>
11613     </class>
11614
11615     <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">
11616         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11617             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11618             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11619             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11620             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
11621             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11622         </fields>
11623     </class>
11624
11625     <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">
11626         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11627             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11628             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11629             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11630             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11631             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11632             <field reporter:label="City" name="city" reporter:datatype="text"/>
11633             <field reporter:label="County" name="county" reporter:datatype="text"/>
11634             <field reporter:label="State" name="state" reporter:datatype="text"/>
11635             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11636             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11637             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11638         </fields>
11639     </class>
11640
11641     <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">
11642         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11643             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11644             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11645             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11646             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11647             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11648             <field reporter:label="City" name="city" reporter:datatype="text"/>
11649             <field reporter:label="County" name="county" reporter:datatype="text"/>
11650             <field reporter:label="State" name="state" reporter:datatype="text"/>
11651             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11652             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
11653             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11654         </fields>
11655     </class>
11656
11657     <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">
11658         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11659             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11660             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11661             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11662             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text" oils_obj:required="true"/>
11663             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11664             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11665         </fields>
11666     </class>
11667
11668     <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">
11669         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11670             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11671             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11672             <field reporter:label="Username" name="usrname" reporter:datatype="text" oils_obj:required="true"/>
11673             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text" oils_obj:required="true"/>
11674             <field reporter:label="User Setting Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
11675             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11676         </fields>
11677     </class>
11678
11679         <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">
11680                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11681                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11682                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11683                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11684                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11685                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11686                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11687                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11688                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11689                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
11690                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
11691                 </fields>
11692                 <links>
11693                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11694                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11695                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11696                 </links>
11697                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11698                         <actions>
11699                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11700                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11701                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11702                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11703                         </actions>
11704                 </permacrud>
11705         </class>
11706
11707         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11708                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11709                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11710                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
11711                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true"/>
11712                         <field reporter:label="Status" name="status" reporter:datatype="text" oils_obj:required="true"/>
11713                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11714                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11715                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11716                         <field reporter:label="Class Name" name="classname" reporter:datatype="text" oils_obj:required="true"/>
11717                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11718                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11719                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11720                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11721                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11722                 </fields>
11723                 <links>
11724                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11725                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11726                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11727                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11728                 </links>
11729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11730                         <actions>
11731                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11732                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11733                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11734                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11735                         </actions>
11736                 </permacrud>
11737         </class>
11738
11739         <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">
11740                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11741                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11742                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link" oils_obj:required="true"/>
11743                         <field reporter:label="Column Name" name="col" reporter:datatype="text" oils_obj:required="true"/>
11744                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11745                 </fields>
11746                 <links>
11747                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11748                 </links>
11749                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11750                         <actions>
11751                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11752                     <context link="fieldset" field="owning_lib"/>
11753                 </create>
11754                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11755                     <context link="fieldset" field="owning_lib"/>
11756                 </retrieve>
11757                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11758                     <context link="fieldset" field="owning_lib"/>
11759                 </update>
11760                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11761                     <context link="fieldset" field="owning_lib"/>
11762                 </delete>
11763                         </actions>
11764                 </permacrud>
11765         </class>
11766
11767     <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">
11768         <fields>
11769             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11770             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11771             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11772         </fields>
11773                 <links>
11774                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11775                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11776                 </links>
11777     </class>
11778
11779     <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">
11780         <fields>
11781             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11782             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11783         </fields>
11784                 <links>
11785                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11786                 </links>
11787     </class>
11788
11789     <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">
11790         <fields>
11791             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11792             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11793             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11794         </fields>
11795                 <links>
11796                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11797                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11798                 </links>
11799     </class>
11800
11801     <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">
11802         <fields>
11803             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11804             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11805         </fields>
11806                 <links>
11807                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11808                 </links>
11809     </class>
11810
11811     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11812                 <oils_persist:source_definition><![CDATA[
11813
11814             SELECT  DISTINCT l.*
11815               FROM  action.unfulfilled_hold_loops l
11816                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11817               WHERE l.count = m.max
11818
11819                 ]]></oils_persist:source_definition>
11820         <fields>
11821             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11822             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11823             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11824         </fields>
11825                 <links>
11826                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11827                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11828                 </links>
11829     </class>
11830
11831         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11832                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11833                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11834                         <field reporter:label="Query type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11835                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11836                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11837                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11838                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11839                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11840                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11841                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11842                 </fields>
11843                 <links>
11844                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11845                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11846                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11847                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11848                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11849                 </links>
11850         </class>
11851
11852         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11853                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11854                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11855                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link" oils_obj:required="true"/>
11856                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11857                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link" oils_obj:required="true"/>
11858                 </fields>
11859                 <links>
11860                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11861                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11862                 </links>
11863         </class>
11864
11865         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11866                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11867                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11868                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text" oils_obj:required="true"/>
11869                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11870                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11871                 </fields>
11872                 <links>
11873                 </links>
11874         </class>
11875
11876         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11877                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11878                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11879                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link" oils_obj:required="true"/>
11880                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11881                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link" oils_obj:required="true"/>
11882                 </fields>
11883                 <links>
11884                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11885                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11886                 </links>
11887         </class>
11888         
11889         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11890                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11891                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11892                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text" oils_obj:required="true"/>
11893                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11894                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11895                 </fields>
11896                 <links>
11897                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11898                 </links>
11899         </class>
11900         
11901         <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">
11902                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11903                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11904                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link" oils_obj:required="true"/>
11905                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11906                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link" oils_obj:required="true"/>
11907                 </fields>
11908                 <links>
11909                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11910                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11911                 </links>
11912         </class>
11913
11914         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11915                 <fields oils_persist:primary="name">
11916                         <field reporter:label="Name" name="name" reporter:datatype="id" oils_obj:required="true"/>
11917                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
11918                         <field reporter:label="Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11919                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_obj:required="true"/>
11920                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11921                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11922                 </fields>
11923                 <links>
11924                 </links>
11925         </class>
11926
11927         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11928                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11929                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11930                         <field reporter:label="Expression Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11931                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11932                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11933                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11934                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11935                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11936                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11937                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11938                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11939                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11940                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11941                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11942                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11943                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11944                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11945                 </fields>
11946                 <links>
11947                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11948                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11949                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11950                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11951                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11952                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11953                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11954                 </links>
11955         </class>
11956
11957         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11958                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11959                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11960                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link" oils_obj:required="true"/>
11961                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11962                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11963                         <field reporter:label="Result" name="result" reporter:datatype="link" oils_obj:required="true"/>
11964                 </fields>
11965                 <links>
11966                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11967                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11968                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11969                 </links>
11970         </class>
11971
11972         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11973                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11974                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11975                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text" oils_obj:required="true"/>
11976                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11977                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11978                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11979                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11980                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11981                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11982                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11983                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11984                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11985                 </fields>
11986                 <links>
11987                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11988                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11989                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11990                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11991                 </links>
11992         </class>
11993
11994         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11995                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11996                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11997                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link" oils_obj:required="true"/>
11998                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
11999                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text" oils_obj:required="true"/>
12000                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link" oils_obj:required="true"/>
12001                 </fields>
12002                 <links>
12003                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12004                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12005                 </links>
12006         </class>
12007
12008         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12009                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12010                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12011                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12012                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12013                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12014                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12015                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12016                 </fields>
12017                 <links>
12018                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12019                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12020                 </links>
12021         </class>
12022
12023         <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">
12024                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12025                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12026                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link" oils_obj:required="true"/>
12027                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int" oils_obj:required="true"/>
12028                         <field reporter:label="Expression" name="expression" reporter:datatype="link" oils_obj:required="true"/>
12029                 </fields>
12030                 <links>
12031                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12032                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12033                 </links>
12034         </class>
12035
12036         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12037                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12038                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12039                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12040                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12041                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12042                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12043                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12044                 </fields>
12045                 <links>
12046                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12047                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12048                 </links>
12049         </class>
12050
12051         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12052                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12053                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12054                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12055                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12056                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12057                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12058                 </fields>
12059                 <links>
12060                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12061                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12062                 </links>
12063         </class>
12064
12065         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12066                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12067                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12068                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12069                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12070                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12071                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12072                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12073                 </fields>
12074                 <links>
12075                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12076                 </links>
12077         </class>
12078
12079         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12080                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12081                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12082                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12083                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12084                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12085                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12086                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12087                 </fields>
12088                 <links>
12089                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12090                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12091                 </links>
12092         </class>
12093
12094         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12095                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12096                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12097                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12098                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12099                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12100                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12101                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12102                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12103                 </fields>
12104                 <links>
12105                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12106                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12107                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12108                 </links>
12109         </class>
12110
12111         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12112                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12113                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12114                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12115                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12116                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12117                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12118                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12119                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12120                 </fields>
12121                 <links>
12122                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12123                 </links>
12124         </class>
12125
12126         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12127                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12128                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12129                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12130                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12131                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12132                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12133                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12134                 </fields>
12135                 <links>
12136                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12137                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12138                 </links>
12139         </class>
12140
12141         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12142                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12143                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12144                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12145                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12146                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12147                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12148                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12149                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12150                 </fields>
12151                 <links>
12152                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12153                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12154                 </links>
12155         </class>
12156
12157         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12158                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12159                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12160                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12161                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12162                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12163                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12164                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12165                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12166                 </fields>
12167                 <links>
12168                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12169                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12170                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12171                 </links>
12172         </class>
12173
12174         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12175                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12176                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12177                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12178                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12179                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12180                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12181                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12182                 </fields>
12183                 <links>
12184                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12185                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12186                 </links>
12187         </class>
12188
12189         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12190                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12191                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12192                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12193                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12194                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12195                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12196                 </fields>
12197                 <links>
12198                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12199                 </links>
12200         </class>
12201
12202         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12203                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12204                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12205                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12206                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12207                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12208                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12209                 </fields>
12210                 <links>
12211                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12212                 </links>
12213         </class>
12214
12215         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12216                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12217                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12218                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12219                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12220                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12221                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12222                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12223                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12224                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12225                 </fields>
12226                 <links>
12227                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12228                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12229                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12230                 </links>
12231         </class>
12232
12233         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12234                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12235                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12236                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12237                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12238                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12239                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12240                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12241                 </fields>
12242                 <links>
12243                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12244                 </links>
12245         </class>
12246
12247         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12248                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12249                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12250                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12251                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12252                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12253                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12254                 </fields>
12255                 <links>
12256                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12257                 </links>
12258         </class>
12259
12260         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12261                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12262                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12263                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12264                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12265                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12266                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12267                 </fields>
12268                 <links>
12269                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12270                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12271                 </links>
12272         </class>
12273
12274         <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">
12275                 <fields oils_persist:primary="id">
12276                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12277                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12278                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12279                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12280                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12281                 </fields>
12282                 <links>
12283                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12284                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12285                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12286                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12287                 </links>
12288         </class>
12289
12290         <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">
12291                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12292                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12293                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text" oils_obj:required="true"/>
12294                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
12295                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text" oils_obj:required="true"/>
12296                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12297                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12298                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12299                 </fields>
12300                 <links/>
12301                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12302                         <actions>
12303                                 <retrieve/>
12304                         </actions>
12305                 </permacrud>
12306         </class>
12307
12308         <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">
12309                 <fields oils_persist:primary="ptype_key">
12310                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id" oils_obj:required="true"/>
12311                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12312                 </fields>
12313                 <links/>
12314                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12315                         <actions>
12316                                 <retrieve/>
12317                         </actions>
12318                 </permacrud>
12319         </class>
12320
12321         <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">
12322                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12323                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12324                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link" oils_obj:required="true"/>
12325                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true"/>
12326                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int" oils_obj:required="true"/>
12327                         <field reporter:label="Length" name="length" reporter:datatype="int" oils_obj:required="true"/>
12328                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12329                 </fields>
12330                 <links>
12331                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12332                 </links>
12333                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12334                         <actions>
12335                                 <retrieve/>
12336                         </actions>
12337                 </permacrud>
12338         </class>
12339
12340         <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">
12341                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12342                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12343                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
12344                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link" oils_obj:required="true"/>
12345                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12346                 </fields>
12347                 <links>
12348                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12349                 </links>
12350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12351                         <actions>
12352                                 <retrieve/>
12353                         </actions>
12354                 </permacrud>
12355         </class>
12356
12357         <!-- This is what you see in Catalog -> Link Checker -->
12358         <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">
12359                 <oils_persist:source_definition><![CDATA[
12360                         SELECT
12361                 coalesce(uvva.id,-uvs.id) as id,
12362                 uvs.id as session_id,
12363                 uvs.name,
12364                 uvs.owning_lib,
12365                 uvs.creator,
12366                 uvs.container,
12367                 uvs.create_time,
12368                 uvs.search,
12369                 (select string_agg(xpath,',')
12370                  from url_verify.url_selector uvus
12371                  where uvus.session = uvs.id
12372                  group by session) as selectors,
12373                 uvva.id as batch_id,
12374                 uvva.usr,
12375                 uvva.start_time,
12376                 uvva.finish_time
12377             FROM
12378                 url_verify.session uvs
12379             LEFT JOIN
12380                 url_verify.verification_attempt uvva
12381             ON
12382                 (uvs.id = uvva.session)
12383                 ]]></oils_persist:source_definition>
12384                 <fields oils_persist:primary="id">
12385             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12386             <field reporter:label="Session ID" name="session_id" reporter:datatype="link"/>
12387             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12388                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12389             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12390             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12391             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12392             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12393             <field reporter:label="Selectors" name="selectors" reporter:datatype="text" oils_obj:required="true"/>
12394             <field reporter:label="Batch ID" name="batch_id" reporter:datatype="link"/>
12395                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12396             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12397             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12398                 </fields>
12399                 <links>
12400             <link field="session_id" reltype="has_a" key="id" map="" class="uvs"/>
12401             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12402             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12403             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12404             <link field="batch_id" reltype="has_a" key="id" map="" class="uvva"/>
12405             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12406                 </links>
12407         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12408             <actions>
12409                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12410             </actions>
12411         </permacrud>
12412         </class>
12413
12414         <!-- This is what gets created with Catalog -> Link Checker -> New Session -->
12415     <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">
12416         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12417             <field reporter:label="Session ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12418             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12419                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12420             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12421             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12422             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12423             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12424             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12425             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12426         </fields>
12427
12428         <links>
12429             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12430             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12431             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12432             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12433             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12434         </links>
12435
12436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12437             <actions>
12438                 <create permission="URL_VERIFY" context_field="owning_lib"/>
12439                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12440                 <update permission="URL_VERIFY" context_field="owning_lib"/>
12441                 <delete permission="URL_VERIFY" context_field="owning_lib"/>
12442             </actions>
12443         </permacrud>
12444
12445     </class>
12446
12447         <!-- A biblio bucket gets populated with search results from Catalog -> Link Checker -> New Session -->
12448     <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">
12449         <oils_persist:source_definition><![CDATA[
12450             SELECT
12451                 cbrebi.id AS id,  -- so we can have a pkey in our view
12452                 uvs.id AS session,
12453                 uvs.owning_lib,
12454                 cbrebi.target_biblio_record_entry
12455             FROM url_verify.session uvs
12456             JOIN container.biblio_record_entry_bucket cbreb
12457                 ON (uvs.container = cbreb.id)
12458             JOIN container.biblio_record_entry_bucket_item cbrebi
12459                 ON (cbrebi.bucket = cbreb.id)
12460         ]]></oils_persist:source_definition>
12461         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12462             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id"/>
12463             <field reporter:label="Session" name="session" reporter:datatype="link"/>
12464             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12465             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link"/>
12466         </fields>
12467         <links>
12468             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
12469             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12470             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12471         </links>
12472         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12473             <actions>
12474                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12475             </actions>
12476         </permacrud>
12477     </class>
12478
12479         <!-- Also created with Catalog -> Link Checker -> New Session -->
12480     <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">
12481         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12482             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id" reporter:selector="xpath"/>
12483             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12484                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12485             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12486         </fields>
12487
12488         <links>
12489             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12490             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12491         </links>
12492
12493         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12494             <actions>
12495                 <create permission="URL_VERIFY">
12496                     <context link="session" field="owning_lib"/>
12497                 </create>
12498                 <retrieve permission="URL_VERIFY">
12499                     <context link="session" field="owning_lib"/>
12500                 </retrieve>
12501                 <update permission="URL_VERIFY">
12502                     <context link="session" field="owning_lib"/>
12503                 </update>
12504                 <delete permission="URL_VERIFY">
12505                     <context link="session" field="owning_lib"/>
12506                 </delete>
12507             </actions>
12508         </permacrud>
12509
12510     </class>
12511
12512         <!-- URLs extracted by URL selectors -->
12513     <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">
12514         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12515             <field reporter:label="URL ID" name="id" reporter:datatype="id" reporter:selector="full_url"/>
12516                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12517                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12518                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12519                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12520             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12521             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12522             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12523             <field reporter:label="URL" name="full_url" reporter:datatype="text" oils_obj:required="true"/>
12524             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12525             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12526             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12527             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12528             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12529             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12530             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12531             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12532             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true"/>
12533         </fields>
12534
12535         <links>
12536             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12537             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem"/>
12538             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12539             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12540             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12541         </links>
12542
12543         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12544             <actions>
12545                 <create permission="URL_VERIFY">
12546                     <context link="session" field="owning_lib"/>
12547                 </create>
12548                 <retrieve permission="URL_VERIFY">
12549                     <context link="session" field="owning_lib"/>
12550                 </retrieve>
12551                 <update permission="URL_VERIFY">
12552                     <context link="session" field="owning_lib"/>
12553                 </update>
12554                 <delete permission="URL_VERIFY">
12555                     <context link="session" field="owning_lib"/>
12556                 </delete>
12557             </actions>
12558         </permacrud>
12559
12560     </class>
12561
12562         <!-- What we now call Batches in the UI -->
12563     <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">
12564         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12565             <field reporter:label="Batch ID" name="id" reporter:datatype="id"/>
12566                         <field reporter:label="User" name="usr" reporter:datatype="link" oils_obj:required="true"/>
12567                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12568             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12569             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12570         </fields>
12571
12572         <links>
12573             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12574             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12575         </links>
12576
12577         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12578             <actions>
12579                 <create permission="URL_VERIFY">
12580                     <context link="session" field="owning_lib"/>
12581                 </create>
12582                 <retrieve permission="URL_VERIFY">
12583                     <context link="session" field="owning_lib"/>
12584                 </retrieve>
12585                 <update permission="URL_VERIFY">
12586                     <context link="session" field="owning_lib"/>
12587                 </update>
12588                 <delete permission="URL_VERIFY">
12589                     <context link="session" field="owning_lib"/>
12590                 </delete>
12591             </actions>
12592         </permacrud>
12593
12594     </class>
12595
12596         <!-- what we now call Attempts in the UI -->
12597     <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">
12598         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12599             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12600                         <field reporter:label="URL" name="url" reporter:datatype="link" oils_obj:required="true"/>
12601                         <field reporter:label="Batch" name="attempt" reporter:datatype="link" oils_obj:required="true"/>
12602             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12603             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12604             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12605             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12606                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12607         </fields>
12608
12609         <links>
12610             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12611             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12612             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12613         </links>
12614
12615         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12616             <actions>
12617                 <create permission="URL_VERIFY">
12618                     <context link="attempt" jump="session" field="owning_lib"/>
12619                 </create>
12620                 <retrieve permission="URL_VERIFY">
12621                     <context link="attempt" jump="session" field="owning_lib"/>
12622                 </retrieve>
12623                 <update permission="URL_VERIFY">
12624                     <context link="attempt" jump="session" field="owning_lib"/>
12625                 </update>
12626                 <delete permission="URL_VERIFY">
12627                     <context link="attempt" jump="session" field="owning_lib"/>
12628                 </delete>
12629             </actions>
12630         </permacrud>
12631
12632     </class>
12633
12634         <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">
12635                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12636                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" oils_obj:required="true"/>
12637                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12638                 </fields>
12639                 <links>
12640                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12641                 </links>
12642                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12643                         <actions>
12644                                 <retrieve/>
12645                         </actions>
12646                 </permacrud>
12647         </class>
12648
12649         <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">
12650                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12651                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12652                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12653                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12654                         <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12655                         <field reporter:label="Interface" name="interface" reporter:datatype="link" oils_obj:required="true"/>
12656                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12657                         <field reporter:label="Filters" name="filters" reporter:datatype="text" oils_obj:required="true"/>
12658                 </fields>
12659                 <links>
12660                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12661                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12662                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12663                 </links>
12664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12665                         <actions>
12666                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12667                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12668                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12669                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12670                         </actions>
12671                 </permacrud>
12672
12673         </class>
12674
12675         <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">
12676                 <fields oils_persist:primary="code">
12677                         <field reporter:label="Code" name="code" reporter:datatype="id" oils_obj:required="true"/>
12678                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text" oils_obj:required="true"/>
12679                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text" oils_obj:required="true"/>
12680                 </fields>
12681                 <links/>
12682                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12683                         <actions>
12684                                 <retrieve/>
12685                         </actions>
12686                 </permacrud>
12687         </class>
12688
12689         <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">
12690                 <oils_persist:source_definition><![CDATA[
12691
12692             SELECT  b.id,
12693                     MAX(dcp.edit_date) AS last_delete_date
12694              FROM   biblio.record_entry b
12695                     JOIN asset.call_number cn ON (cn.record = b.id)
12696                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12697              WHERE  NOT b.deleted
12698              GROUP BY b.id
12699              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12700
12701                 ]]></oils_persist:source_definition>
12702                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12703                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12704                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12705                 </fields>
12706                 <links>
12707                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12708                 </links>
12709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12710                         <actions>
12711                                 <retrieve/>
12712                         </actions>
12713                 </permacrud>
12714         </class>
12715
12716         <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">
12717                 <fields oils_persist:primary="id">
12718                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12719                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12720                 </fields>
12721                 <links/>
12722                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12723                         <actions>
12724                                 <retrieve/>
12725                         </actions>
12726                 </permacrud>
12727         </class>
12728
12729         <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">
12730                 <fields oils_persist:primary="id">
12731                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12732                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12733                 </fields>
12734                 <links/>
12735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12736                         <actions>
12737                                 <retrieve/>
12738                         </actions>
12739                 </permacrud>
12740         </class>
12741
12742
12743         <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">
12744                 <oils_persist:source_definition><![CDATA[
12745                 SELECT
12746                     x.id,
12747                     COALESCE( y.copy_count, 0 ) AS copy_count,
12748                     x.hold_count AS hold_count,
12749                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12750                 FROM
12751                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12752                         FROM
12753                             action.hold_request ahr
12754                             JOIN reporter.hold_request_record rhrr USING (id)
12755                         WHERE
12756                             ahr.cancel_time IS NULL
12757                             AND ahr.fulfillment_time IS NULL
12758                         GROUP BY bib_record
12759                     )x
12760                     JOIN
12761                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12762                         FROM
12763                             action.hold_request ahr
12764                             JOIN reporter.hold_request_record rhrr USING (id)
12765                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12766                         WHERE
12767                             ahr.cancel_time IS NULL
12768                             AND ahr.fulfillment_time IS NULL
12769                             AND ahr.capture_time IS NULL
12770                             AND ahr.frozen IS FALSE
12771                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12772                             AND ahr.hold_type != 'M'
12773                            GROUP BY bib_record
12774                     )y
12775                     USING (id)
12776                 ]]></oils_persist:source_definition>
12777                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12778                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12779                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12780                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12781                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12782                 </fields>
12783                 <links>
12784                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12785                 </links>
12786                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12787                         <actions>
12788                                 <retrieve/>
12789                         </actions>
12790                 </permacrud>
12791         </class>
12792
12793         <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">
12794                 <oils_persist:source_definition><![CDATA[
12795             SELECT *,
12796                 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,
12797                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12798             FROM
12799                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12800                     FROM
12801                         action.hold_request ahr
12802                         JOIN reporter.hold_request_record rhrr USING (id)
12803                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12804                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12805                     WHERE
12806                         ahr.cancel_time IS NULL
12807                         AND ahr.fulfillment_time IS NULL
12808                     GROUP BY bib_record, pickup_lib
12809                 )x
12810                 JOIN
12811                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12812                     FROM
12813                         action.hold_request ahr
12814                         JOIN reporter.hold_request_record rhrr USING (id)
12815                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12816                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12817                     WHERE
12818                         ahr.cancel_time IS NULL
12819                         AND ahr.fulfillment_time IS NULL
12820                         AND ahr.capture_time IS NULL
12821                         AND ahr.frozen IS FALSE
12822                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12823                         AND ahr.hold_type != 'M'
12824                     GROUP BY bib_record, pickup_lib
12825                 )y
12826                 USING(id,pickup_lib)
12827                 JOIN
12828                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12829                     FROM
12830                         action.hold_request ahr
12831                         JOIN reporter.hold_request_record rhrr USING (id)
12832                     WHERE
12833                         ahr.cancel_time IS NULL
12834                         AND ahr.fulfillment_time IS NULL
12835                     GROUP BY bib_record
12836                 )z
12837                 USING (id)
12838                 JOIN
12839                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12840                     FROM
12841                         action.hold_request ahr
12842                         JOIN reporter.hold_request_record rhrr USING (id)
12843                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12844                     WHERE
12845                         ahr.cancel_time IS NULL
12846                         AND ahr.fulfillment_time IS NULL
12847                         AND ahr.capture_time IS NULL
12848                         AND ahr.frozen IS FALSE
12849                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12850                         AND ahr.hold_type != 'M'
12851                         GROUP BY bib_record
12852                 )u
12853                 USING (id)
12854                 ]]></oils_persist:source_definition>
12855                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12856                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12857                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12858                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12859                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12860                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12861                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12862                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12863                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12864                 </fields>
12865                 <links>
12866                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12867                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12868                 </links>
12869                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12870                         <actions>
12871                                 <retrieve/>
12872                         </actions>
12873                 </permacrud>
12874         </class>
12875
12876         <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">
12877                 <oils_persist:source_definition><![CDATA[
12878             SELECT *,
12879                 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,
12880                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12881             FROM
12882                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12883                     FROM
12884                         action.hold_request ahr
12885                         JOIN actor.usr au ON (ahr.usr = au.id)
12886                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12887                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12888                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12889                     WHERE
12890                         ahr.cancel_time IS NULL
12891                         AND ahr.fulfillment_time IS NULL
12892                     GROUP BY bib_record, home_ou
12893                 )x
12894                 JOIN
12895                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12896                     FROM
12897                         action.hold_request ahr
12898                         JOIN actor.usr au ON (ahr.usr = au.id)
12899                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12900                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12901                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12902                     WHERE
12903                         ahr.cancel_time IS NULL
12904                         AND ahr.fulfillment_time IS NULL
12905                         AND ahr.capture_time IS NULL
12906                         AND ahr.frozen IS FALSE
12907                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12908                         AND ahr.hold_type != 'M'
12909                     GROUP BY bib_record, home_ou
12910                 )y
12911                 USING (id,home_ou)
12912                 JOIN
12913                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12914                     FROM
12915                         action.hold_request ahr
12916                         JOIN reporter.hold_request_record rhrr USING (id)
12917                     WHERE
12918                         ahr.cancel_time IS NULL
12919                         AND ahr.fulfillment_time IS NULL
12920                     GROUP BY bib_record
12921                 )z
12922                 USING (id)
12923                 JOIN
12924                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12925                     FROM
12926                         action.hold_request ahr
12927                         JOIN reporter.hold_request_record rhrr USING (id)
12928                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12929                     WHERE
12930                         ahr.cancel_time IS NULL
12931                         AND ahr.fulfillment_time IS NULL
12932                         AND ahr.capture_time IS NULL
12933                         AND ahr.frozen IS FALSE
12934                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12935                         AND ahr.hold_type != 'M'
12936                     GROUP BY bib_record
12937                 )u
12938                 USING (id)
12939         ]]></oils_persist:source_definition>
12940         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12941                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12942                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12943                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12944                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12945                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12946                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12947                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12948                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12949         </fields>
12950         <links>
12951                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12952                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12953         </links>
12954         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12955                 <actions>
12956                         <retrieve/>
12957                 </actions>
12958         </permacrud>
12959 </class>
12960
12961         <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) ">
12962                 <oils_persist:source_definition><![CDATA[
12963                 WITH counts_at_ou AS (
12964                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12965                 FROM
12966                     (SELECT rhrr.bib_record AS id,
12967                             aou.id AS pickup_lib_or_desc,
12968                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12969                        FROM actor.org_unit aou
12970                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12971                             action.hold_request ahr
12972                             JOIN reporter.hold_request_record rhrr USING (id)
12973                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12974                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12975                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12976                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12977                             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
12978                       GROUP BY 1, 2
12979                 ) a
12980                 JOIN
12981                     (SELECT rhrr.bib_record AS id,
12982                             aou.id AS pickup_lib_or_desc,
12983                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12984                        FROM actor.org_unit aou
12985                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12986                             action.hold_request ahr
12987                             JOIN reporter.hold_request_record rhrr USING (id)
12988                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12989                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12990                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12991                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12992                             AND ahr.hold_type != 'M'
12993                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12994                             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
12995                       GROUP BY 1, 2
12996                 ) b
12997                 USING (id,pickup_lib_or_desc)
12998             )
12999             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13000                    y.holds_everywhere, z.copy_count_everywhere,
13001                 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,
13002                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13003             FROM counts_at_ou x
13004                 JOIN
13005                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13006                     FROM
13007                         action.hold_request ahr
13008                         JOIN reporter.hold_request_record rhrr USING (id)
13009                     WHERE
13010                         ahr.cancel_time IS NULL
13011                         AND ahr.fulfillment_time IS NULL
13012                     GROUP BY bib_record
13013                 )y
13014                 USING (id)
13015                 JOIN
13016                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13017                     FROM
13018                         action.hold_request ahr
13019                         JOIN reporter.hold_request_record rhrr USING (id)
13020                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13021                     WHERE
13022                         ahr.cancel_time IS NULL
13023                         AND ahr.fulfillment_time IS NULL
13024                         AND ahr.capture_time IS NULL
13025                         AND ahr.frozen IS FALSE
13026                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13027                         AND ahr.hold_type != 'M'
13028                         GROUP BY bib_record
13029                 )z
13030                 USING (id)
13031                 ]]></oils_persist:source_definition>
13032                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13033                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13034                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13035                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13036                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13037                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13038                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13039                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13040                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13041                 </fields>
13042                 <links>
13043                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13044                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13045                 </links>
13046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13047                         <actions>
13048                                 <retrieve/>
13049                         </actions>
13050                 </permacrud>
13051         </class>
13052
13053         <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">
13054                 <oils_persist:source_definition><![CDATA[
13055             SELECT
13056                 ac.id,
13057                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13058                 MAX(actac.xact_start) AS last_circ
13059             FROM asset.copy ac
13060                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13061             GROUP BY ac.id
13062
13063             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13064             --SELECT
13065             --    ac.id,
13066             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13067             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13068             --FROM asset.copy ac
13069             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13070             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13071             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13072                 ]]></oils_persist:source_definition>
13073                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13074                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13075                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13076                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13077                 </fields>
13078                 <links>
13079                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13080                 </links>
13081                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13082                         <actions>
13083                                 <retrieve/>
13084                         </actions>
13085                 </permacrud>
13086         </class>
13087
13088         <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">
13089                 <fields oils_persist:primary="id">
13090                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id" oils_obj:required="true"/>
13091                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name" oils_obj:required="true"/>
13092                 </fields>
13093                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13094                         <actions>
13095                                 <retrieve/>
13096                         </actions>
13097                 </permacrud>
13098         </class>
13099
13100         <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">
13101                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13102                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13103                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class" oils_obj:required="true"/>
13104                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13105                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13106                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13107                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13108                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13109                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13110                 </fields>
13111                 <links>
13112                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13113                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13114                 </links>
13115                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13116                         <actions>
13117                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13118                                 <retrieve/>
13119                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13120                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13121                         </actions>
13122                 </permacrud>
13123         </class>
13124
13125         <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">
13126                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13127                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13128                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field" oils_obj:required="true"/>
13129                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config" oils_obj:required="true"/>
13130                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13131                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13132                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13133                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13134                 </fields>
13135                 <links>
13136                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13137                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13138                 </links>
13139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13140                         <actions>
13141                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13142                                 <retrieve/>
13143                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13144                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13145                         </actions>
13146                 </permacrud>
13147         </class>
13148
13149
13150         <!-- ********************************************************************************************************************* -->
13151         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13152         <!-- ********************************************************************************************************************* -->
13153         <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">
13154                 <fields oils_persist:primary="id">
13155                         <field reporter:label="Circulation" name="id" reporter:datatype="id"/>
13156                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13157                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13158                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13159                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13160                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13161                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13162                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13163                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13164                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13165                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13166                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13167                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13168                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13169                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13170                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13171                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13172                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13173                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13174                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13175                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13176                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13177                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13178                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13179                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13180                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13181                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13182                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13183                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13184                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13185                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13186                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13187                 </fields>
13188                 <links>
13189                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13190                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13191                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13192                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13193                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13194                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13195                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13196                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13197                 </links>
13198         </class>
13199
13200         <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">
13201                 <fields oils_persist:primary="id">
13202                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13203                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13204                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13205                 </fields>
13206                 <links>
13207                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13208                 </links>
13209         </class>
13210
13211         <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">
13212                 <fields oils_persist:primary="id">
13213                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id"/>
13214                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13215                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13216                 </fields>
13217                 <links>
13218                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13219                 </links>
13220         </class>
13221
13222         <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">
13223                 <fields oils_persist:primary="id">
13224                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
13225
13226                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13227                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13228                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13229
13230                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13231                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13232                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13233
13234                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13235                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13236
13237                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13238                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13239                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13240
13241                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13242                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13243
13244                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13245                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13246                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13247
13248                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13249                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13250                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13251
13252                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13253                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13254                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13255                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13256
13257                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13258                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13259
13260                 </fields>
13261                 <links>
13262                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13263                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13264                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13265                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13266                 </links>
13267         </class>
13268
13269         <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">
13270                 <oils_persist:source_definition><![CDATA[
13271
13272             SELECT
13273                 po.ordering_agency AS ordering_agency,
13274                 po.id AS purchase_order,
13275                 li.id AS lineitem,
13276                 lid.id AS lineitem_detail,
13277                 cpa.id AS claim_policy_action
13278             FROM
13279                 acq.lineitem_detail lid
13280                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13281                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13282                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13283                 JOIN acq.claim_policy_action cpa ON (
13284                     cpa.claim_policy = cp.id
13285
13286                     -- we only care about claim policy actions whose claim
13287                     -- interval we'd reached or exceeded
13288                     AND (NOW() - cpa.action_interval) > po.order_date
13289
13290                     -- filter out all claim policy actions where claim events
13291                     -- have occurred on or after the action's action_interval
13292                     AND NOT EXISTS (
13293                         SELECT 1
13294                         FROM
13295                             acq.claim_event evt
13296                             JOIN acq.claim claim ON (
13297                                 claim.id = evt.claim
13298                                 AND claim.lineitem_detail = lid.id
13299                             )
13300                         WHERE
13301                             evt.event_date >= (po.order_date + cpa.action_interval)
13302                     )
13303                 )
13304             WHERE
13305                 lid.cancel_reason IS NULL
13306                 AND li.cancel_reason IS NULL -- belt/suspenders
13307                 AND po.cancel_reason IS NULL -- belt/suspenders
13308                 AND lid.recv_time IS NULL
13309                 AND po.state = 'on-order'
13310             ORDER BY 1, 2, 3, 4, 5
13311
13312                 ]]></oils_persist:source_definition>
13313                 <fields>
13314                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13315                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13316                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13317                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13318                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13319                 </fields>
13320                 <links>
13321                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13322                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13323                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13324                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13325                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13326                 </links>
13327         </class>
13328         <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">
13329                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13330                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13331                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13332                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13333                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13334                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13335                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13336                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13337                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13338                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13339                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13340                 </fields>
13341                 <links>
13342                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13343                 </links>
13344     </class>
13345         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13346                 <oils_persist:source_definition><![CDATA[
13347             SELECT * FROM acq.lineitem_summary 
13348                                 WHERE item_count > (invoice_count + cancel_count)
13349         ]]></oils_persist:source_definition>
13350                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13351                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13352                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13353                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13354                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13355                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13356                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13357                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13358                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13359                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13360                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13361                 </fields>
13362                 <links>
13363                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13364                 </links>
13365     </class>
13366         <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">
13367                 <oils_persist:source_definition><![CDATA[
13368
13369                         SELECT  t.*
13370                           FROM  action.transit_copy t
13371                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13372                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13373                           WHERE s.parent_ou <> d.parent_ou
13374
13375                 ]]></oils_persist:source_definition>
13376                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13377                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13378                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13379                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13380                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13381                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13382                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13383                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13384                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13385                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13386                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13387                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13388                 </fields>
13389                 <links>
13390                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13391                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13392                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13393                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13394                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13395                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13396                 </links>
13397         </class>
13398
13399     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13400                 <oils_persist:source_definition><![CDATA[
13401
13402         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13403                 SELECT
13404                         cp.id as copy,
13405                         COUNT(circ.id),
13406                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13407                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13408                 FROM
13409                         asset.copy cp
13410                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13411                 GROUP BY 1, 3, 4
13412                 UNION ALL
13413                 SELECT
13414                         cp.id as copy,
13415                         COUNT(circ.id),
13416                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13417                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13418                 FROM
13419                         asset.copy cp
13420                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13421                 GROUP BY 1, 3, 4
13422                 UNION ALL
13423                 SELECT
13424                         id as copy,
13425                         circ_count,
13426                         -1 AS year,
13427                         false as is_renewal
13428                 FROM
13429                         extend_reporter.legacy_circ_count
13430         )x GROUP BY 1, 3, 4
13431
13432                 ]]></oils_persist:source_definition>
13433         <fields>
13434             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13435             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13436             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13437             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13438         </fields>
13439                 <links>
13440                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13441                 </links>
13442                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13443                         <actions>
13444                                 <retrieve/>
13445                         </actions>
13446                 </permacrud>
13447     </class>
13448
13449         <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">
13450                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13451                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13452                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13453                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13454                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13455                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13456                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13457                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13458                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13459                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13460                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13461                         <field reporter:label="Circ ID" name="id" reporter:datatype="id"/>
13462                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
13463                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13464                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13465                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13466                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
13467                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13468                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int"/>
13469                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13470                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13471                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13472                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13473                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13474                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13475                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13476                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13477                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13478                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13479                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13480                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13481                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13482                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int"/>
13483                 </fields>
13484                 <links>
13485                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13486                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13487                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13488                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13489                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13490                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13491                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13492                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13493                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13494                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13495                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13496                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13497                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13498                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13499                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13500                 </links>
13501         </class>
13502
13503     <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">
13504         <fields oils_persist:primary="id">
13505             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13506             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13507             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13508             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13509             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13510             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13511             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13512             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13513             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13514             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13515             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13516             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13517             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13518             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13519             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13520             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13521             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13522             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13523             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13524             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13525             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13526             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13527             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13528             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13529             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13530             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13531             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13532             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13533             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13534             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13535             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13536             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13537             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13538             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13539         </fields>
13540         <links>
13541             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13542             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13543             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13544             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13545             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13546             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13547             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13548             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13549         </links>
13550     </class>
13551
13552     <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">
13553         <fields oils_persist:primary="id">
13554             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13555             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13556             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13557             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13558         </fields>
13559         <links>
13560             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13561             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13562         </links>
13563     </class>
13564
13565     <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">
13566         <fields oils_persist:primary="owning_lib">
13567             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13568             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13569             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13570         </fields>
13571         <links>
13572             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13573         </links>
13574     </class>
13575
13576     <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">
13577         <fields oils_persist:primary="id">
13578             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13579             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13580             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13581             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13582             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13583         </fields>
13584         <links>
13585             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13586             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13587             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13588         </links>
13589     </class>
13590
13591     <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">
13592         <fields oils_persist:primary="circ_lib">
13593             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13594             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13595             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13596             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13597         </fields>
13598         <links>
13599             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13600             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13601         </links>
13602     </class>
13603
13604     <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">
13605         <fields oils_persist:primary="id">
13606             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13607             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13608             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13609             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13610             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13611         </fields>
13612         <links>
13613             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13614             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13615             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13616         </links>
13617     </class>
13618
13619     <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">
13620         <fields oils_persist:primary="home_ou">
13621             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13622             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13623             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13624             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13625         </fields>
13626         <links>
13627             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13628             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13629         </links>
13630     </class>
13631         <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">
13632                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13633                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13634                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13635                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13636                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13637                 </fields>
13638                 <links>
13639                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13640                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13641                 </links>
13642                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13643                         <actions>
13644                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13645                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13646                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13647                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13648                         </actions>
13649                 </permacrud>
13650         </class>
13651         <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">
13652                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13653                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13654                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" oils_obj:required="true"/>
13655                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13656                 </fields>
13657                 <links>
13658                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13659                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13660                         </links>
13661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13662                 <actions>
13663                                 <create permission="ADMIN_ACQ_FUND_TAG">
13664                                         <context link="tag" field="owner"/>
13665                                 </create>
13666                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13667                                         <context link="tag" field="owner"/>
13668                                 </retrieve>
13669                                 <update permission="ADMIN_ACQ_FUND_TAG">
13670                                         <context link="tag" field="owner"/>
13671                                 </update>
13672                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13673                                         <context link="tag" field="owner"/>
13674                                 </delete>
13675                         </actions>
13676                 </permacrud>
13677         </class>
13678         <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">
13679                 <oils_persist:source_definition><![CDATA[
13680                 SELECT
13681                         poi.purchase_order AS purchase_order,
13682                         ii.invoice AS invoice,
13683                         NULL AS lineitem,
13684                         poi.id AS po_item,
13685                         NULL AS picklist
13686                 FROM
13687                         acq.po_item poi
13688                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13689                 UNION SELECT
13690                         jub.purchase_order AS purchase_order,
13691                         ie.invoice AS invoice,
13692                         jub.id AS lineitem,
13693                         NULL AS po_item,
13694                         jub.picklist AS picklist
13695                 FROM
13696                         acq.lineitem jub
13697                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13698                 UNION SELECT
13699                         ii.purchase_order AS purchase_order,
13700                         ii.invoice AS invoice,
13701                         NULL AS lineitem,
13702                         NULL AS po_item,
13703                         NULL AS picklist
13704                 FROM
13705                         acq.invoice_item ii
13706                 WHERE ii.po_item IS NULL
13707                 UNION SELECT
13708                         ie.purchase_order AS purchase_order,
13709                         ie.invoice AS invoice,
13710                         NULL AS lineitem,
13711                         NULL AS po_item,
13712                         NULL AS picklist
13713                 FROM
13714                         acq.invoice_entry ie
13715                 WHERE ie.lineitem IS NULL
13716                 UNION SELECT
13717                         NULL AS purchase_order,
13718                         NULL AS invoice,
13719                         jub.id AS lineitem,
13720                         NULL AS po_item,
13721                         jub.picklist AS picklist
13722                 FROM
13723                         acq.lineitem jub
13724                 WHERE jub.purchase_order IS NULL
13725                 ]]></oils_persist:source_definition>
13726                 <fields>
13727                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13728                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13729                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13730                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13731                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13732                 </fields>
13733                 <links>
13734                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13735                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13736                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
13737                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
13738                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
13739                 </links>
13740         </class>
13741         <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">
13742                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13743                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13744                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13745                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
13746                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13747                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13748                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13749                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13750                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13751                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13752                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13753                 </fields>
13754                 <links>
13755                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13756                 </links>
13757                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13758                         <actions>
13759                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13760                                 <retrieve/>
13761                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13762                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13763                         </actions>
13764                 </permacrud>
13765         </class>
13766
13767         <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">
13768                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13769                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13770                         <field name="date_applied" reporter:datatype="timestamp"/>
13771                         <field name="org" reporter:datatype="org_unit"/>
13772                         <field name="original_value" reporter:datatype="text"/>
13773                         <field name="new_value" reporter:datatype="text"/>
13774                         <field name="field_name" reporter:datatype="link"/>
13775                 </fields>
13776                 <links>
13777                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13778                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13779                 </links>
13780         </class>
13781         <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">
13782                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13783                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13784                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13785                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13786                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13787                 </fields>
13788                 <links>
13789                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13790                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13791                 </links>
13792         </class>
13793         <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">
13794                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13795                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13796                         <field reporter:label="Circ" name="xact" reporter:datatype="link" oils_obj:required="true"/>
13797                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link" oils_obj:required="true"/>
13798                         <field reporter:label="Entry Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13799                 </fields>
13800                 <links>
13801                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13802                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13803                 </links>
13804         </class>
13805         <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">
13806                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13807                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13808                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13809                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13810                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13811                 </fields>
13812                 <links>
13813                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13814                 </links>
13815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13816                         <actions>
13817                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13818                                 <retrieve/>
13819                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13820                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13821                         </actions>
13822                 </permacrud>
13823         </class>
13824         <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">
13825                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13826                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13827                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13828                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13829                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13830                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13831                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13832                 </fields>
13833                 <links>
13834                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13835                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13836                 </links>
13837                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13838                         <actions>
13839                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13840                                 <retrieve/>
13841                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13842                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13843                         </actions>
13844                 </permacrud>
13845         </class>
13846         <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">
13847                 <fields oils_persist:primary="code">
13848                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13849                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13850                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13851                 </fields>
13852                 <links>
13853                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13854                 </links>
13855                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13856                         <actions>
13857                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13858                                 <retrieve/>
13859                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13860                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13861                         </actions>
13862                 </permacrud>
13863         </class>
13864         <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">
13865                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13866                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13867                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13868                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13869                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13870                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13871                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13872                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13873                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13874                 </fields>
13875                 <links>
13876                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13877                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13878                 </links>
13879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13880                         <actions>
13881                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13882                                 <retrieve/>
13883                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13884                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13885                         </actions>
13886                 </permacrud>
13887         </class>
13888         <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">
13889                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13890                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13891                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13892                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13893                 </fields>
13894                 <links>
13895                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13896                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13897                 </links>
13898                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13899                         <actions>
13900                                 <create permission="UPDATE_COPY">
13901                     <context link="copy" field="circ_lib"/>
13902                 </create>
13903                                 <retrieve/>
13904                                 <update permission="UPDATE_COPY">
13905                     <context link="copy" field="circ_lib"/>
13906                 </update>
13907                                 <delete permission="UPDATE_COPY">
13908                     <context link="copy" field="circ_lib"/>
13909                 </delete>
13910                         </actions>
13911                 </permacrud>
13912         </class>
13913         <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">
13914         <oils_persist:source_definition><![CDATA[
13915         SELECT ahcm.target_copy AS id,count(*) AS count
13916          FROM
13917          action.hold_request ahr,
13918          action.hold_copy_map ahcm
13919          WHERE
13920          ahr.cancel_time IS NULL AND
13921          ahr.fulfillment_time IS NULL AND
13922          ahr.capture_time IS NULL AND
13923          ahr.id = ahcm.hold
13924          GROUP BY ahcm.target_copy
13925         ]]></oils_persist:source_definition>
13926         <fields oils_persist:primary="id">
13927             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13928             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13929         </fields>
13930         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13931             <actions>
13932                <retrieve/>
13933             </actions>
13934         </permacrud>
13935         </class>
13936
13937         <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">
13938                 <fields oils_persist:primary="name">
13939                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13940                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
13941                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13942                         <field name="datatype" reporter:datatype="text"/>
13943                         <field name="fm_class" reporter:datatype="text"/>
13944                         <field name="grp" reporter:datatype="link"/>
13945                 </fields>
13946                 <links>
13947                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13948                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13949                 </links>
13950                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13951                         <actions>
13952                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13953                                 <retrieve/>
13954                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13955                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13956                         </actions>
13957                 </permacrud>
13958         </class>
13959
13960         <!-- no pcrud access is granted for now, because it's assumed these
13961                          setting values will be applied and retrived via the API. -->
13962         <class id="awss" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation_setting" oils_persist:tablename="actor.workstation_setting" reporter:label="Workstation Setting">
13963                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13964                         <field reporter:label="Setting ID" name="id" reporter:datatype="id"/>
13965                         <field reporter:label="Name" name="name" reporter:datatype="link" oils_obj:required="true"/>
13966                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
13967                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link" oils_obj:required="true"/>
13968                 </fields>
13969                 <links>
13970                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13971                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13972                 </links>
13973         </class>
13974
13975         <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">
13976         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13977                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13978                 <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13979                 <field name="hold_type" reporter:datatype="text" oils_persist:i18n="true"/>
13980         </fields>
13981         </class>
13982
13983         <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">
13984                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13985                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
13986                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13987                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13988                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13989                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13990                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13991                         <field name="content_type" reporter:datatype="text"/>
13992                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13993                 </fields>
13994                 <links>
13995                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13996                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13997                 </links>
13998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13999                         <actions>
14000                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14001                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14002                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14003                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14004                         </actions>
14005                 </permacrud>
14006         </class>
14007
14008         <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">
14009                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14010                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id"/>
14011                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14012                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14013                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14014                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14015                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14016                 </fields>
14017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14018                         <actions>
14019                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14020                                 <retrieve/>
14021                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14022                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14023                         </actions>
14024                 </permacrud>
14025         </class>
14026
14027         <class id="cc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::carousel" oils_persist:tablename="container.carousel" reporter:label="Carousels">
14028                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14029                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14030                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14031                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14032                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14033                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14034                         <field reporter:label="Creating User" name="creator" reporter:datatype="link" oils_obj:required="true"/>
14035                         <field reporter:label="Editing User" name="editor" reporter:datatype="link" oils_obj:required="true"/>
14036                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14037                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14038                         <field reporter:label="Age Limit" name="age_filter" reporter:datatype="interval"/>
14039                         <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 -->
14040                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text"/> <!-- ditto -->
14041                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14042                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14043                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14044                 </fields>
14045                 <links>
14046                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14047                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14048                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14049                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14050                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14051                 </links>
14052                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14053                         <actions>
14054                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14055                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14056                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14057                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14058                         </actions>
14059                 </permacrud>
14060         </class>
14061
14062         <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">
14063                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14064                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
14065                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link" oils_obj:required="true"/>
14066                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14067                         <field reporter:label="Library" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
14068                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int" oils_obj:required="true"/>
14069                 </fields>
14070                 <links>
14071                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14072                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14073                 </links>
14074                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14075                         <actions>
14076                                 <create permission="ADMIN_CAROUSEL">
14077                                     <context link="carousel" field="owner"/>
14078                                 </create>
14079                                 <retrieve permission="ADMIN_CAROUSEL">
14080                                     <context link="carousel" field="owner"/>
14081                                 </retrieve>
14082                                 <update permission="ADMIN_CAROUSEL">
14083                                     <context link="carousel" field="owner"/>
14084                                 </update>
14085                                 <delete permission="ADMIN_CAROUSEL">
14086                                     <context link="carousel" field="owner"/>
14087                                 </delete>
14088                         </actions>
14089                 </permacrud>
14090         </class>
14091
14092         <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">
14093                 <fields oils_persist:primary="name">
14094                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_obj:required="true"/>
14095                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
14096                         <field name="context_org" reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14097                         <field name="enabled" reporter:datatype="bool" reporter:label="Enabled"/>
14098                         <field name="perm" reporter:datatype="link" reporter:label="Permission Required by User" oils_obj:required="true"/>
14099                         <field name="restrict_to_org" reporter:datatype="bool" reporter:label="Restrict by Home Library"/>
14100                         <field name="allow_inactive" reporter:datatype="bool" reporter:label="Allow Inactive Users"/>
14101                         <field name="allow_expired" reporter:datatype="bool" reporter:label="Allow Expired Users"/>
14102                         <field name="block_list" reporter:datatype="text" reporter:label="Block List"/>
14103                         <field name="usr_activity_type" reporter:datatype="link" reporter:label="User Activity Type"/>
14104                 </fields>
14105                 <links>
14106                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14107                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14108                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14109                 </links>
14110                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14111                         <actions>
14112                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14113                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14114                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14115                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14116                         </actions>
14117                 </permacrud>
14118         </class>
14119         <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">
14120                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14121                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14122                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14123                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14124                         <field name="name" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14125                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14126                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14127                 </fields>
14128                 <links>
14129                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14130                 </links>
14131                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14132                         <actions>
14133                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14134                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14135                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14136                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14137                         </actions>
14138                 </permacrud>
14139         </class>
14140
14141     <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">
14142         <fields oils_persist:primary="code">
14143             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14144             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14145         </fields>
14146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14147                         <actions>
14148                                 <retrieve/>
14149                         </actions>
14150                 </permacrud>
14151         </class>
14152
14153     <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">
14154         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14155             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14156             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14157             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14158             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14159             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14160             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14161             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14162             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14163                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14164         </fields>
14165                 <links>
14166                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14167                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14168                 </links>
14169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14170             <actions>
14171                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14172                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14173                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14174                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14175             </actions>
14176         </permacrud>
14177     </class>
14178
14179         <!-- Simple Reporter classes are currently used only by the SR UI -->
14180     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14181         <oils_persist:source_definition><![CDATA[
14182             SELECT
14183               -- Circ id; just for counting
14184               combcirc.id AS circ_id,
14185
14186               -- User info, currently limiting to what's available from action.all_circulation
14187               combcirc.usr_post_code AS usr_post_code,
14188               combcirc.usr_birth_year AS usr_bith_year,
14189               combcirc.usr_profile AS usr_profile_id,
14190               pgtu.name AS usr_profile,
14191               combcirc.usr_home_ou AS usr_home_ou_id,
14192               aouuh.shortname AS usr_home_ou_shortname,
14193               aouuh.name AS usr_home_ou_name,
14194               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14195               aouus.shortname AS usr_sys_shortname,
14196               aouus.name AS usr_sys_name,
14197
14198               -- Circ info
14199               -- Checkout
14200               combcirc.xact_start AS xact_start,
14201               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14202               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14203               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14204               combcirc.circ_lib AS circ_lib_id,
14205               aouco.shortname AS circ_lib_shortname,
14206               aouco.name AS circ_lib_name,
14207               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14208               aoucos.shortname AS circ_sys_shortname,
14209               aoucos.name AS circ_sys_name,
14210               auco.usrname AS circ_staff,
14211               awso.name AS checkout_workstation,
14212
14213               combcirc.due_date AS due_date,
14214               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14215               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14216               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14217
14218               -- Checkin
14219               combcirc.xact_finish AS xact_finish,
14220               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14221               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14222               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14223               aouci.shortname AS checkin_lib_shortname,
14224               aouci.name AS checkin_lib_name,
14225               auci.usrname AS checkin_staff,
14226               awsi.name AS checkin_workstation,
14227               aoucis.shortname AS checkin_sys_shortname,
14228               aoucis.name AS checkin_sys_name,
14229
14230               combcirc.checkin_time AS checkin_time,
14231
14232               -- Misc circ info
14233               combcirc.renewal_remaining AS renewal_remaining,
14234               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14235               combcirc.grace_period AS grace_period,
14236
14237               combcirc.stop_fines AS stop_fines,
14238               combcirc.stop_fines_time AS stop_fines_time,
14239
14240               combcirc.duration AS duration,
14241               combcirc.fine_interval AS fine_interval,
14242               combcirc.recurring_fine AS recurring_fine,
14243               combcirc.max_fine AS max_fine,
14244               combcirc.duration_rule AS duration_rule,
14245               combcirc.recurring_fine_rule AS recurring_fine_rule,
14246               combcirc.max_fine_rule AS max_fine_rule,
14247               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14248               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,
14249               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14250
14251               -- Copy info
14252               acp.barcode AS copy_barcode,
14253               acp.circ_modifier AS copy_circ_modifier_code,
14254               ccm.name AS copy_circ_modifier_name,
14255               acp.circ_lib AS copy_circ_lib_id,
14256               acp.location AS location_id,
14257               acpl.name AS location_name,
14258               aoucp.shortname AS copy_circ_lib_shortname,
14259               aoucp.name AS copy_circ_lib_name,
14260               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14261               aoucps.shortname AS copy_sys_shortname,
14262               aoucps.name AS copy_sys_name,
14263               combcirc.copy_owning_lib AS copy_owning_lib_id,
14264               aoucpo.shortname AS copy_owning_lib_shortname,
14265               aoucpo.name AS copy_owning_lib_name,
14266               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14267               acnp.label AS copy_call_number_prefix,
14268               acn.label AS copy_call_number_label,
14269               acns.label AS copy_call_number_suffix,
14270               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14271               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14272               acn.label_sortkey AS copy_call_number_label_sortkey,
14273               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14274               COALESCE(rmsr.title, acp.dummy_title) AS title,
14275               COALESCE(rmsr.author, acp.dummy_author) AS author,
14276               rmsr.publisher AS publisher,
14277               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14278               array_to_string(rmsr.isbn, ', ') AS isbn,
14279               array_to_string(rmsr.issn, ', ') AS issn,
14280               part.label AS part_label,
14281               part.label_sortkey AS part_label_sortkey,
14282               acn.record AS bib_id,
14283               rmsr.tcn_value AS tcn_value
14284
14285             FROM
14286               action.all_circulation combcirc
14287
14288               -- User
14289               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14290               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14291               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14292
14293               -- Circ
14294               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14295               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14296               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14297               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14298               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14299               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14300               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14301               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14302
14303               -- Copy / call / title
14304               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14305                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14306               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14307               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14308               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14309               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14310               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14311               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14312               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14313               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14314               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14315               LEFT JOIN (
14316                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14317                 FROM biblio.monograph_part bmp
14318                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14319                 WHERE NOT bmp.deleted
14320               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14321         ]]></oils_persist:source_definition>
14322         <field_groups>
14323             <group name="common" reporter:label="Common Fields"/>
14324             <group name="item" reporter:label="Item Fields"/>
14325             <group name="user" reporter:label="Patron Fields"/>
14326             <group name="title" reporter:label="Call Number and Title Fields"/>
14327             <group name="org" reporter:label="Libraries"/>
14328         </field_groups>
14329         <fields oils_persist:primary="circ_id">
14330             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14331             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14332             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14333             <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"/>
14334             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14335             <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"/>
14336             <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"/>
14337             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14338             <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"/>
14339             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14340             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14341             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14342             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14343             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14344             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14345             <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"/>
14346             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14347             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14348             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14349             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14350             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14351             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14352             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14353             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14354             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14355             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14356             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14357             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14358             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14359             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14360             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14361             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14362             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14363             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14364             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14365             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14366             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14367             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14368             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14369             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14370             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14371             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14372             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14373             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14374             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14375             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14376             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14377             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14378             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14379             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14380             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14381             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14382             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14383             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14384             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14385             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14386             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14387             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14388             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14389             <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"/>
14390             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14391             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14392             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14393             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14394             <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"/>
14395             <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"/>
14396             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14397             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14398             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14399             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14400             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14401             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14402             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14403             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14404             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14405             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14406             <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"/>
14407             <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"/>
14408             <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"/>
14409             <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"/>
14410             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14411             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14412             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14413             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14414             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14415             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14416             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14417             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14418             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14419             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14420         </fields>
14421         <links>
14422             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14423             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14424             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14425         </links>
14426     </class>
14427
14428     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14429         <oils_persist:source_definition><![CDATA[
14430             SELECT
14431               au.home_ou AS home_ou_filter,
14432               au.id AS user_id,
14433               cardp.barcode AS barcode_primary,
14434               au.usrname AS usrname,
14435               au.email AS email,
14436               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14437               au.prefix AS prefix,
14438               au.first_given_name AS first_given_name,
14439               au.second_given_name AS second_given_name,
14440               au.family_name AS family_name,
14441               au.suffix AS suffix,
14442               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14443               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14444               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14445               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14446               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14447               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14448               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14449               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14450               au.profile AS profile_id,
14451               pgt.name AS profile,
14452               au.alias AS alias,
14453               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14454               au.day_phone AS day_phone,
14455               au.evening_phone AS evening_phone,
14456               au.other_phone AS other_phone,
14457               au.dob AS dob,
14458               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14459               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14460               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14461               au.active AS active,
14462               au.barred AS barred,
14463               au.deleted AS deleted,
14464               au.juvenile AS juvenile,
14465               au.claims_returned_count AS claims_returned_count,
14466               au.credit_forward_balance AS credit_forward_balance,
14467               au.create_date AS create_date,
14468               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14469               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14470               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14471               au.expire_date AS expire_date,
14472               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14473               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14474               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14475               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14476               au.last_update_time AS last_update_time,
14477               au.home_ou AS home_ou_id,
14478               aouh.shortname AS home_ou_shortname,
14479               aouh.name AS home_ou_name,
14480               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14481               aous.shortname AS home_sys_shortname,
14482               aous.name AS home_sys_name,
14483               auam.valid AS mailing_valid,
14484               auam.address_type AS mailing_address_type,
14485               auam.street1 AS mailing_street1,
14486               auam.street2 AS mailing_street2,
14487               auam.city AS mailing_city,
14488               auam.state AS mailing_state,
14489               auam.country AS mailing_country,
14490               auam.post_code AS mailing_post_code,
14491               auam.county AS mailing_county,
14492               auam.within_city_limits AS mailing_within_city_limits,
14493               auam.pending AS mailing_pending,
14494               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14495               auap.valid AS physical_valid,
14496               auap.address_type AS physical_address_type,
14497               auap.street1 AS physical_street1,
14498               auap.street2 AS physical_street2,
14499               auap.city AS physical_city,
14500               auap.state AS physical_state,
14501               auap.country AS physical_country,
14502               auap.post_code AS physical_post_code,
14503               auap.county AS physical_county,
14504               auap.within_city_limits AS physical_within_city_limits,
14505               auap.pending AS physical_pending,
14506               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14507               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14508               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14509               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14510               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14511               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14512               asceum1.stat_cat_entry AS legacy_stat_cat1,
14513               asceum2.stat_cat_entry AS legacy_stat_cat2,
14514
14515               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14516               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14517               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14518               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14519               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,
14520               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14521
14522             FROM
14523               actor.usr au
14524               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14525               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14526               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14527               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14528               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14529               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14530               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14531               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14532               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14533               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14534               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14535               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14536               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14537               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14538               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14539               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14540
14541             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14542               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14543               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14544               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14545               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14546               76,77,78,79,80,81
14547         ]]></oils_persist:source_definition>
14548         <field_groups>
14549             <group name="common" reporter:label="Common Fields"/>
14550             <group name="name" reporter:label="Name Fields"/>
14551             <group name="contact" reporter:label="Contact Fields"/>
14552             <group name="address" reporter:label="Address Related Fields"/>
14553             <group name="org" reporter:label="Libraries"/>
14554         </field_groups>
14555         <fields oils_persist:primary="user_id">
14556             <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"/>
14557             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14558             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14559             <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14560             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14561             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14562             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14563             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14564             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14565             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14566             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14567             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14568             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14569             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14570             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14571             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14572             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14573             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14574             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14575             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14576             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14577             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14578             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14579             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14580             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14581             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14582             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14583             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14584             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14585             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14586             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14587             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14588             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14589             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14590             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14591             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14592             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14593             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14594             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14595             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14596             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14597             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14598             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14599             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14600             <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"/>
14601             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14602             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14603             <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"/>
14604             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14605             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14606             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14607             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14608             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14609             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14610             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14611             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14612             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14613             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14614             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14615             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14616             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14617             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14618             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14619             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14620             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14621             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14622             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14623             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14624             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14625             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14626             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14627             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14628             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14629             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14630             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14631             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14632             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14633             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14634             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14635             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14636             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14637             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14638             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14639             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14640             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14641             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14642         </fields>
14643         <links>
14644             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14645         </links>
14646     </class>
14647
14648     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14649         <oils_persist:source_definition><![CDATA[
14650             SELECT
14651               -- ids
14652               acp.id AS copy_id,
14653               acp.floating AS floating_id,
14654               acn.id AS acn_id,
14655               acp.circ_lib AS circ_lib_id,
14656               acp.status AS status_id,
14657               acp.location AS location_id,
14658               acp.age_protect AS age_protect_id,
14659               aous.id AS circ_sys_id,
14660               acn.owning_lib AS owning_lib_id,
14661               aouos.id AS owning_sys_id,
14662               awsi.id AS inv_workstation_id,
14663
14664               -- OUs
14665               aou.shortname AS circ_lib_shortname,
14666               aou.name AS circ_lib_name,
14667               aous.shortname AS circ_sys_shortname,
14668               aous.name AS circ_sys_name,
14669               aouo.shortname AS owning_lib_shortname,
14670               aouo.name AS owning_lib_name,
14671               aouos.shortname AS owning_sys_shortname,
14672               aouos.name AS owning_sys_name,
14673
14674               -- dates
14675               acp.create_date AS create_date_time,
14676               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14677               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14678               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14679               acp.active_date AS active_date_time,
14680               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14681               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14682               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14683               acp.edit_date AS edit_date_time,
14684               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14685               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14686               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14687               acp.status_changed_time AS status_changed_time_time,
14688               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14689               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14690               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14691               ali.inventory_date AS latest_inv_date,
14692               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14693               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14694               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14695
14696               -- acp
14697               acp.barcode AS barcode,
14698               ccs.name AS status,
14699               acpl.name AS location_name,
14700                                                         acp.circ_modifier AS copy_circ_modifier_code,
14701                                                         ccm.name AS copy_circ_modifier_name,
14702               acp.price AS price,
14703               acp.cost AS acq_price,
14704               acp.deleted AS copy_deleted,
14705               acp.ref AS reference,
14706               acp.circulate AS copy_circulate,
14707               (acp.circulate AND acpl.circulate) AS circulate,
14708               acp.holdable AS copy_holdable,
14709               acp.deposit AS deposit,
14710               acp.deposit_amount AS deposit_amount,
14711               acp.alert_message AS alert_message,
14712               acp.opac_visible AS copy_opac_visible,
14713               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14714               crahp.name AS age_protect,
14715               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14716               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14717               acp.copy_number AS copy_number,
14718               acp.circ_as_type AS circ_as_type,
14719               acp.loan_duration AS loan_duration_int,
14720               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14721               acp.fine_level AS fine_level_int,
14722               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14723
14724               -- Call Number
14725               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14726               acnp.label AS copy_call_number_prefix,
14727               acn.label AS copy_call_number_label,
14728               acns.label AS copy_call_number_suffix,
14729               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14730               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14731               acn.label_sortkey AS copy_call_number_label_sortkey,
14732               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14733               racnd.dewey AS call_number_dewey,
14734               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14735               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14736               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14737               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14738
14739               -- Misc
14740               COALESCE(rmsr.title, acp.dummy_title) AS title,
14741               COALESCE(rmsr.author, acp.dummy_author) AS author,
14742               rmsr.publisher AS publisher,
14743               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14744               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14745               array_to_string(rmsr.issn, ', ') AS issn,
14746               part.label AS part_label,
14747               part.label_sortkey AS part_label_sortkey,
14748               acn.record AS bib_id,
14749               rmsr.tcn_value AS tcn_value,
14750               acn.deleted AS call_deleted,
14751               bre.deleted AS bib_deleted,
14752               ccs.holdable AS status_holdable,
14753               acpl.holdable AS location_holdable,
14754               acp.circulate AS location_circulate,
14755               awsi.name AS inventory_workstation,
14756               aucr.usrname AS creating_user,
14757               aued.usrname AS editing_user,
14758
14759               -- Aggregates
14760               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14761               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,
14762               COUNT(DISTINCT combcirc.id) AS circ_total,
14763               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14764
14765             FROM
14766               asset.copy acp
14767               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14768               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14769               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14770               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14771               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14772               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14773               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14774               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14775               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14776               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14777               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14778               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14779               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14780               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14781               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14782               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14783               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14784               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14785               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14786               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14787               LEFT JOIN (
14788                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14789                 FROM biblio.monograph_part bmp
14790                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14791                 WHERE NOT bmp.deleted
14792               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14793
14794             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14795               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14796               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14797               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14798               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14799               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14800               91,92,93,94,95,96
14801
14802         ]]></oils_persist:source_definition>
14803         <field_groups>
14804             <group name="common" reporter:label="Common Fields"/>
14805             <group name="dates" reporter:label="Date Fields"/>
14806             <group name="title" reporter:label="Call Number and Title Fields"/>
14807             <group name="org" reporter:label="Libraries"/>
14808         </field_groups>
14809         <fields oils_persist:primary="copy_id">
14810             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14811             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14812             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14813             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14814             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14815             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14816             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14817             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14818             <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"/>
14819             <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"/>
14820             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14821             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14822             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14823             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14824             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14825             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14826             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14827             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14828             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14829             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14830             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14831             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14832             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14833             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14834             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14835             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14836             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14837             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14838             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14839             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14840             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14841             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14842             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14843             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14844             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14845             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14846             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14847             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14848             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14849             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14850             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14851             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14852             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14853             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14854             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14855             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14856             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14857             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14858             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14859             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14860             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14861             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14862             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14863             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14864             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14865             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14866             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14867             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14868             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14869             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14870             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14871             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14872             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14873             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14874             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14875             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14876             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14877             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14878             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14879             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14880             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14881             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14882             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14883             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14884             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14885             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14886             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14887             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14888             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14889             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14890             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14891             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14892             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14893             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14894             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14895             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14896             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14897             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14898             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14899             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14900             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14901             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14902             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14903             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14904         </fields>
14905         <links>
14906             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14907             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14908             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14909             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14910             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14911             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14912         </links>
14913     </class>
14914
14915     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14916         <oils_persist:source_definition><![CDATA[
14917
14918             SELECT
14919               -- ids
14920               acp.id AS copy_id,
14921               acn.id AS acn_id,
14922               acp.circ_lib AS circ_lib_id,
14923               acp.status AS status_id,
14924               acp.location AS location_id,
14925               acp.age_protect AS age_protect_id,
14926               aous.id AS circ_sys_id,
14927               acn.owning_lib AS owning_lib_id,
14928               aouos.id AS owning_sys_id,
14929               awsi.id AS inv_workstation_id,
14930
14931               -- OUs
14932               aou.shortname AS circ_lib_shortname,
14933               aou.name AS circ_lib_name,
14934               aous.shortname AS circ_sys_shortname,
14935               aous.name AS circ_sys_name,
14936               aouo.shortname AS owning_lib_shortname,
14937               aouo.name AS owning_lib_name,
14938               aouos.shortname AS owning_sys_shortname,
14939               aouos.name AS owning_sys_name,
14940
14941               -- dates
14942               acp.create_date AS create_date_time,
14943               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14944               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14945               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14946               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14947               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14948               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14949               acp.active_date AS active_date_time,
14950               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14951               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14952               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14953               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14954               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14955               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14956               acp.edit_date AS edit_date_time,
14957               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14958               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14959               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14960               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14961               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14962               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14963               acp.status_changed_time AS status_changed_time_time,
14964               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14965               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14966               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14967               ali.inventory_date AS latest_inv_date,
14968               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14969               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14970               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14971               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14972               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14973               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14974
14975               -- acp
14976               acp.barcode AS barcode,
14977               ccs.name AS status,
14978               acpl.name AS location_name,
14979               acp.circ_modifier AS circ_modifier_code,
14980               ccm.name AS circ_modifier_name,
14981               acp.price AS price,
14982               acp.cost AS acq_price,
14983               acp.deleted AS copy_deleted,
14984               acp.ref AS reference,
14985               acp.circulate AS copy_circulate,
14986               (acp.circulate AND acpl.circulate) AS circulate,
14987               acp.holdable AS copy_holdable,
14988               acp.deposit AS deposit,
14989               acp.deposit_amount AS deposit_amount,
14990               acp.alert_message AS alert_message,
14991               acp.opac_visible AS copy_opac_visible,
14992               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14993               crahp.name AS age_protect,
14994               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14995               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14996               acp.copy_number AS copy_number,
14997               acp.circ_as_type AS circ_as_type,
14998               acp.loan_duration AS loan_duration_int,
14999               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15000               acp.fine_level AS fine_level_int,
15001               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15002
15003               -- Call Number
15004               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15005               acnp.label AS copy_call_number_prefix,
15006               acn.label AS copy_call_number_label,
15007               acns.label AS copy_call_number_suffix,
15008               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15009               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15010               acn.label_sortkey AS copy_call_number_label_sortkey,
15011               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15012               racnd.dewey AS call_number_dewey,
15013               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15014               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15015               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15016               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15017
15018               -- Misc
15019               COALESCE(rmsr.title, acp.dummy_title) AS title,
15020               COALESCE(rmsr.author, acp.dummy_author) AS author,
15021               rmsr.publisher AS publisher,
15022               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15023               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15024               array_to_string(rmsr.issn, ', ') AS issn,
15025               part.label AS part_label,
15026               part.label_sortkey AS part_label_sortkey,
15027               acn.record AS bib_id,
15028               rmsr.tcn_value AS tcn_value,
15029               acn.deleted AS call_deleted,
15030               bre.deleted AS bib_deleted,
15031               ccs.holdable AS status_holdable,
15032               acpl.holdable AS location_holdable,
15033               acp.circulate AS location_circulate,
15034               awsi.name AS inventory_workstation,
15035
15036               -- Aggregates
15037               -- may decide these price games aren't worth it, but estimated collection value is useful
15038               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,
15039               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15040               MAX(combcirc.xact_start) AS last_circ_datetime,
15041               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15042               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15043               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15044               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15045               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15046               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15047               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15048               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15049               (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,
15050               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15051               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15052               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15053               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15054               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15055               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15056               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,
15057               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,
15058               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,
15059               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
15060
15061             FROM
15062               asset.copy acp
15063               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15064               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15065               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15066               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15067               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15068               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15069               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15070               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15071               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15072               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15073               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15074               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15075               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15076               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15077               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15078               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15079               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15080               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15081               LEFT JOIN (
15082                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15083                 FROM biblio.monograph_part bmp
15084                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15085                 WHERE NOT bmp.deleted
15086               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15087
15088             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15089               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15090               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15091               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15092               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15093               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15094               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15095
15096         ]]></oils_persist:source_definition>
15097         <field_groups>
15098             <group name="common" reporter:label="Common Fields"/>
15099             <group name="dates" reporter:label="Date Fields"/>
15100             <group name="inv" reporter:label="Inventory Fields"/>
15101             <group name="title" reporter:label="Call Number and Title Fields"/>
15102             <group name="org" reporter:label="Libraries"/>
15103         </field_groups>
15104         <fields oils_persist:primary="copy_id">
15105              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15106              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15107              <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"/>
15108              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15109              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15110              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15111              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15112              <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"/>
15113              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15114              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15115              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15116              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15117              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15118              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15119              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15120              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15121              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15122              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15123              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15124              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15125              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15126              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15127              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15128              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15129              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15130              <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"/>
15131              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15132              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15133              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15134              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15135              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15136              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15137              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15138              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15139              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15140              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15141              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15142              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15143              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15144              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15145              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15146              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15147              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15148              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15149              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15150              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15151              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15152              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15153              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15154              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15155              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15156              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15157              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15158              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15159              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15160              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15161              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15162              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15163              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15164              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15165              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15166              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15167              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15168              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15169              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15170              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15171              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15172              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15173              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15174              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15175              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15176              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15177              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15178              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15179              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15180              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15181              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15182              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15183              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15184              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15185              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15186              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15187              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15188              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15189              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15190              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15191              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15192              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15193              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15194              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15195              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15196              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15197              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15198              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15199              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15200              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15201              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15202              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15203              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15204              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15205              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15206              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15207              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15208              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15209              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15210              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15211              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15212              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15213              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15214              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15215              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15216              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15217              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15218              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15219              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15220              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15221              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15222              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15223              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15224              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15225              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15226              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15227              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15228              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15229              <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"/>
15230              <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"/>
15231              <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"/>
15232         </fields>
15233         <links>
15234             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15235             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15236             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15237             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15238             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15239         </links>
15240     </class>
15241
15242     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15243         <oils_persist:source_definition><![CDATA[
15244
15245             SELECT
15246               -- ids
15247               xact.id AS xact_id,
15248               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15249               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15250
15251               -- OUs
15252               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15253               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15254               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15255               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15256
15257               -- billings
15258               billings.total_amount AS billing_grand_total,
15259               billings.total_unvoided_amount AS billing_total,
15260
15261               billings.voided_billing_count AS billing_voided_count,
15262               billings.all_billing_types AS all_billing_types,
15263               billings.billing_types AS billing_types,
15264
15265               billings.total_voided_amount AS billing_total_voided,
15266               billings.total_overdue_amount AS billing_overdue_amount,
15267               billings.total_lost_amount AS billing_lost_amount,
15268               billings.total_long_od_amount AS billing_long_od_amount,
15269               billings.total_damaged_amount AS billing_damaged_amount,
15270               billings.total_deposit_amount AS billing_deposit_amount,
15271               billings.total_rental_amount AS billing_rental_amount,
15272
15273               -- payments
15274               payments.total_amount AS payment_grand_total,
15275               payments.total_unvoided_amount AS payment_total,
15276
15277               payments.voided_payment_count AS payment_voided_count,
15278               payments.all_payment_types AS all_payment_types,
15279               payments.payment_types AS payment_types,
15280
15281               payments.total_voided_amount AS payment_total_voided,
15282               payments.total_account_adjustment AS payment_account_adjustment_amount,
15283               payments.total_cash_payment AS payment_cash_amount,
15284               payments.total_check_payment AS payment_check_amount,
15285               payments.total_credit_card_payment AS payment_credit_card_amount,
15286               payments.total_debit_card_payment AS payment_debit_card_amount,
15287               payments.total_credit_payment AS payment_credit_amount,
15288               payments.total_forgive_payment AS payment_forgive_amount,
15289               payments.total_work_payment AS payment_work_amount,
15290               payments.total_goods_payment AS payment_goods_amount,
15291               payments.total_currency_payment AS payment_currency_amount,
15292               payments.total_non_currency_payment AS payment_non_currency_amount,
15293
15294               -- dates
15295               xact.xact_start AS xact_start,
15296               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15297               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15298               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15299               xact.xact_finish AS xact_finish,
15300               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15301               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15302               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15303               billings.earliest_billing_ts AS earliest_billing_ts,
15304               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15305               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15306               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15307               billings.latest_billing_ts AS latest_billing_ts,
15308               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15309               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15310               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15311               payments.earliest_payment_ts AS earliest_payment_ts,
15312               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15313               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15314               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15315               payments.latest_payment_ts AS latest_payment_ts,
15316               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15317               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15318               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15319
15320               -- Misc
15321               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15322               (xact.xact_finish IS NOT NULL) AS xact_closed
15323
15324             FROM
15325               money.billable_xact xact
15326               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15327               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15328               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15329               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15330               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15331               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15332
15333               -- oohh nooo.... If not done this way you encounter situations
15334               -- like multiplying billing totals x number of payments and
15335               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15336               LEFT JOIN (
15337                 SELECT
15338                   xact,
15339                   MIN(billing_ts) AS earliest_billing_ts,
15340                   MAX(billing_ts) AS latest_billing_ts,
15341
15342                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15343                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15344                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15345
15346                   SUM(amount) AS total_amount,
15347                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15348                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15349                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15350                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15351                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15352                   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.
15353                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15354                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15355
15356                 FROM
15357                   money.all_billings
15358                 GROUP BY 1
15359               ) billings ON (xact.id = billings.xact)
15360               -- Can't include accepting user or cash_drawer because that will "duplicate"
15361               -- rows if multiple staff accept payments on a single xact...
15362               LEFT JOIN (
15363                 SELECT
15364                   xact,
15365                   MIN(payment_ts) AS earliest_payment_ts,
15366                   MAX(payment_ts) AS latest_payment_ts,
15367
15368                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15369                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15370                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15371
15372                   SUM(amount) AS total_amount,
15373                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15374                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15375                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15376                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15377                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15378                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15379                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15380                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15381                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15382                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15383                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15384                   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,
15385                   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
15386
15387                 FROM
15388                   money.all_payments
15389                 GROUP BY 1
15390               ) payments ON (xact.id = payments.xact)
15391
15392         ]]></oils_persist:source_definition>
15393         <field_groups>
15394             <group name="common" reporter:label="Common Fields"/>
15395             <group name="bill" reporter:label="Billing Fields"/>
15396             <group name="pay" reporter:label="Payment Fields"/>
15397             <group name="dates" reporter:label="Date Fields"/>
15398             <group name="org" reporter:label="Libraries"/>
15399         </field_groups>
15400         <fields oils_persist:primary="xact_id">
15401              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15402              <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"/>
15403              <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"/>
15404              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15405              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15406              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15407              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15408              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15409              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15410              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15411              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15412              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15413              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15414              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15415              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15416              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15417              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15418              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15419              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15420              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15421              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15422              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15423              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15424              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15425              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15426              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15427              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15428              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15429              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15430              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15431              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15432              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15433              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15434              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15435              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15436              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15437              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15438              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15439              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15440              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15441              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15442              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15443              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15444              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15445              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15446              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15447              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15448              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15449              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15450              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15451              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15452              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15453              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15454              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15455              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15456              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15457              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15458              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15459              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15460              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15461              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15462              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15463         </fields>
15464     </class>
15465
15466         <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">
15467                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15468                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15469                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15470                 </fields>
15471                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15472                         <actions>
15473                                 <retrieve/>
15474                         </actions>
15475                 </permacrud>
15476         </class>
15477
15478         <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">
15479                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15480                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
15481                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15482                 </fields>
15483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15484                         <actions>
15485                                 <retrieve/>
15486                         </actions>
15487                 </permacrud>
15488         </class>
15489
15490         <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">
15491                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15492                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15493                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15494                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15495                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15496                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15497                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15498                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15499                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15500                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15501                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15502                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15503                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15504                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15505                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15506                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15507                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15508                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15509                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15510                 </fields>
15511                 <links>
15512                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15513                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15514                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15515                 </links>
15516                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15517                         <actions>
15518                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15519                                 <retrieve/>
15520                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15521                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15522                         </actions>
15523                 </permacrud>
15524         </class>
15525
15526         <class id="acqr_inv_totals" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Totals">
15527                 <oils_persist:source_definition><![CDATA[
15528                         WITH invoice_entry_totals AS (
15529                                 SELECT acqinv.id,
15530                                         SUM(COALESCE(acqie.cost_billed, 0.00)) AS total_invoice_entry_cost_billed,
15531                                         SUM(COALESCE(acqie.amount_paid, 0.00)) AS total_invoice_entry_amount_paid
15532                                 FROM acq.invoice acqinv
15533                                 LEFT JOIN acq.invoice_entry acqie ON (acqinv.id = acqie.invoice)
15534                                 GROUP BY 1
15535                         ), invoice_item_totals AS (
15536                                 SELECT acqinv.id,
15537                                         SUM(COALESCE(acqii.cost_billed, 0.00)) AS total_invoice_item_cost_billed,
15538                                         SUM(COALESCE(acqii.amount_paid, 0.00)) AS total_invoice_item_amount_paid
15539                                 FROM acq.invoice acqinv
15540                                 LEFT JOIN acq.invoice_item  acqii ON (acqinv.id = acqii.invoice)
15541                                 GROUP BY 1
15542                         )
15543                         SELECT id,
15544                                 total_invoice_entry_cost_billed, total_invoice_entry_amount_paid,
15545                                 total_invoice_item_cost_billed, total_invoice_item_amount_paid,
15546                                 total_invoice_entry_cost_billed + total_invoice_item_cost_billed AS total_cost_billed,
15547                                 total_invoice_entry_amount_paid + total_invoice_item_amount_paid AS total_amount_paid
15548                         FROM invoice_entry_totals
15549                         JOIN invoice_item_totals USING (id)
15550                 ]]></oils_persist:source_definition>
15551                 <fields oils_persist:primary="id">
15552                         <field reporter:label="Invoice" name="id" reporter:datatype="link"/>
15553                         <field reporter:label="Total Billed for Line Items" name="total_invoice_entry_cost_billed" reporter:datatype="money"/>
15554                         <field reporter:label="Total Paid for Line Items" name="total_invoice_entry_amount_paid" reporter:datatype="money"/>
15555                         <field reporter:label="Total Billed for Direct Charges" name="total_invoice_item_cost_billed" reporter:datatype="money"/>
15556                         <field reporter:label="Total Paid for Direct Charges" name="total_invoice_item_amount_paid" reporter:datatype="money"/>
15557                         <field reporter:label="Total Billed" name="total_cost_billed" reporter:datatype="money"/>
15558                         <field reporter:label="Total Paid" name="total_amount_paid" reporter:datatype="money"/>
15559                 </fields>
15560         <links>
15561             <link field="id" reltype="has_a" key="id" map="" class="acqinv"/>
15562         </links>
15563         </class>
15564
15565         <class id="acqr_debit_by_fund" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund">
15566                 <oils_persist:source_definition><![CDATA[
15567                         WITH invoice_funds AS (
15568                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15569                                 FROM acq.invoice_entry acqie
15570                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15571                                 UNION ALL
15572                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15573                                 FROM acq.invoice_item acqii
15574                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15575                         )
15576                         SELECT invoice, fund, encumbrance, SUM (amount) AS total_amount
15577                         FROM invoice_funds
15578                         GROUP BY 1, 2, 3
15579                 ]]></oils_persist:source_definition>
15580                 <fields>
15581                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15582                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
15583                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15584                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15585                 </fields>
15586         <links>
15587             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15588             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
15589         </links>
15590         </class>
15591
15592         <class id="acqr_debit_by_fund_tag" controller="open-ils.reporter" oils_persist:virtual="true" reporter:label="Invoice Debits by Fund Tag">
15593                 <oils_persist:source_definition><![CDATA[
15594                         WITH invoice_funds AS (
15595                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15596                                 FROM acq.invoice_entry acqie
15597                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15598                                 UNION ALL
15599                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15600                                 FROM acq.invoice_item acqii
15601                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15602                         )
15603                         SELECT invoice, tag, encumbrance, SUM(amount) AS total_amount
15604                         FROM invoice_funds
15605                         LEFT JOIN acq.fund_tag_map acqftm ON (invoice_funds.fund = acqftm.fund)
15606                         GROUP BY 1, 2, 3
15607                 ]]></oils_persist:source_definition>
15608                 <fields>
15609                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link"/>
15610                         <field reporter:label="Fund Tag" name="tag" reporter:datatype="link"/>
15611                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool"/>
15612                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money"/>
15613                 </fields>
15614         <links>
15615             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15616             <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
15617         </links>
15618         </class>
15619
15620         <!-- ********************************************************************************************************************* -->
15621 </IDL>
15622 <!-- Local Variables: -->
15623 <!-- indent-tabs-mode: t -->
15624 <!-- tab-width: 4 -->
15625 <!-- nxml-child-indent: 4 -->
15626 <!-- End: -->
15627 <!--
15628         vim:noet:ts=4:sw=4:
15629 -->