]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP2061136 - Stamping 1405 DB upgrade script
[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
74 <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">
75
76         <!-- Virtual classes -->
77
78         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio"
79                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
80                    oils_persist:tablename="oai.biblio">
81                 <fields oils_persist:primary="rec_id">
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
83                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
84                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
85                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
86                 </fields>
87         </class>
88         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority"
89                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
90                    oils_persist:tablename="oai.authority">
91                 <fields oils_persist:primary="rec_id">
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
93                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
94                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
95                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
96                 </fields>
97         </class>
98
99         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
100                 <fields>
101                         <field name="usr" oils_persist:virtual="true" />
102                         <field name="forgive_payment" oils_persist:virtual="true" />
103                         <field name="work_payment" oils_persist:virtual="true" />
104                         <field name="credit_payment" oils_persist:virtual="true" />
105                         <field name="goods_payment" oils_persist:virtual="true" />
106                         <field name="account_adjustment" oils_persist:virtual="true" />
107                 </fields>
108                 <links>
109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
110                 </links>
111         </class>
112
113         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
114                 <fields>
115                         <field name="workstation" oils_persist:virtual="true" />
116                         <field name="cash_payment" oils_persist:virtual="true" />
117                         <field name="check_payment" oils_persist:virtual="true" />
118                         <field name="credit_card_payment" oils_persist:virtual="true" />
119                         <field name="debit_card_payment" oils_persist:virtual="true" />
120                 </fields>
121                 <links>
122                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
123                 </links>
124         </class>
125
126         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
127                 <fields>
128                         <field name="id" oils_persist:virtual="true" />
129                         <field name="children" oils_persist:virtual="true" />
130                         <field name="owner_doc" oils_persist:virtual="true" />
131                         <field name="intra_doc_id" oils_persist:virtual="true" />
132                         <field name="parent_node" oils_persist:virtual="true" />
133                         <field name="node_type" oils_persist:virtual="true" />
134                         <field name="namespace_uri" oils_persist:virtual="true" />
135                         <field name="name" oils_persist:virtual="true" />
136                         <field name="value" oils_persist:virtual="true" />
137                 </fields>
138         </class>
139
140         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
141                 <fields>
142                         <field name="title" oils_persist:virtual="true" />
143                         <field name="author" oils_persist:virtual="true" />
144                         <field name="doc_id" oils_persist:virtual="true" />
145                         <field name="doc_type" oils_persist:virtual="true" />
146                         <field name="pubdate" oils_persist:virtual="true" />
147                         <field name="isbn" oils_persist:virtual="true" />
148                         <field name="publisher" oils_persist:virtual="true" />
149                         <field name="tcn" oils_persist:virtual="true" />
150                         <field name="subject" oils_persist:virtual="true" />
151                         <field name="types_of_resource" oils_persist:virtual="true" />
152                         <field name="call_numbers" oils_persist:virtual="true" />
153                         <field name="edition" oils_persist:virtual="true" />
154                         <field name="online_loc" oils_persist:virtual="true" />
155                         <field name="synopsis" oils_persist:virtual="true" />
156                         <field name="physical_description" oils_persist:virtual="true" />
157                         <field name="toc" oils_persist:virtual="true" />
158                         <field name="copy_count" oils_persist:virtual="true" />
159                         <field name="series" oils_persist:virtual="true" />
160                         <field name="serials" oils_persist:virtual="true" />
161                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
162                 </fields>
163         </class>
164
165         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
166                 <fields>
167                         <field name="err_msg" oils_persist:virtual="true" />
168                         <field name="type" oils_persist:virtual="true" />
169                 </fields>
170         </class>
171
172         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
173                 <fields>
174                         <field name="err_msg" oils_persist:virtual="true" />
175                         <field name="type" oils_persist:virtual="true" />
176                 </fields>
177         </class>
178
179         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
180                 <fields oils_persist:primary="matchpoint">
181                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
182                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
183                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
184                 </fields>
185                 <links>
186                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
187                 </links>
188         </class>
189
190         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
191         <!-- when the time is right, turn me into a view.  -->
192                 <fields>
193             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
194             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
195             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
196             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
197             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
198             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
199             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
200             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
201             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
202             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
203                 </fields>
204         </class>
205
206         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
207                 <fields>
208                         <field name="public_name" oils_persist:virtual="true" />
209                         <field name="target_url" oils_persist:virtual="true" />
210                         <field name="target_coverage" oils_persist:virtual="true" />
211                         <field name="target_embargo" oils_persist:virtual="true" />
212                 </fields>
213         </class>
214
215         <!-- Actually in the DB -->
216         <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">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
219                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
220                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
221                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
222                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
223                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
224                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
225                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
226                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
227                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
228                 </fields>
229                 <links>
230                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
231                 </links>
232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
233                         <actions>
234                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
235                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
236                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
237                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
238                         </actions>
239                 </permacrud>
240         </class>
241
242         <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">
243                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
244                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
245                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
246                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
247                 </fields>
248                 <links>
249                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
250                 </links>
251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
252                         <actions>
253                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
254                     <context link="grp" field="owner"/>
255                 </create>
256                                 <retrieve/>
257                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
258                     <context link="grp" field="owner"/>
259                 </update>
260                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
261                     <context link="grp" field="owner"/>
262                 </delete>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rrbs" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::record_badge_score" 
270             oils_persist:tablename="rating.record_badge_score" 
271             reporter:label="Statistical Popularity Badge">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.record_badge_score_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
276                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
277                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
278                 </fields>
279         <links>
280             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
281             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
282         </links>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <retrieve/>
286                         </actions>
287                 </permacrud>
288         </class>
289
290         <class  id="rp" 
291             controller="open-ils.cstore open-ils.pcrud" 
292             oils_obj:fieldmapper="rating::popularity_parameter" 
293             oils_persist:tablename="rating.popularity_parameter" 
294             reporter:label="Statistical Popularity Parameter">
295                 <fields oils_persist:primary="id" 
296                 oils_persist:sequence="rating.popularity_parameter_id_seq">
297                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
299                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
300                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
301                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
302                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
303                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
304                 </fields>
305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
306                         <actions>
307                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
308                                 <retrieve/>
309                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
310                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
311                         </actions>
312                 </permacrud>
313         </class>
314
315         <class  id="rb" 
316             controller="open-ils.cstore open-ils.pcrud" 
317             oils_obj:fieldmapper="rating::badge" 
318             oils_persist:tablename="rating.badge" 
319             reporter:label="Statistical Popularity Badge">
320                 <fields oils_persist:primary="id" 
321                 oils_persist:sequence="rating.badge_id_seq">
322                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
323                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
325                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
326                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
327                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
328                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
329                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
330                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
331                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
332                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
333                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
334                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
335                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
336                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
337                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
338                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
339                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
340                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
341                 </fields>
342                 <links>
343                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
344                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
345                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
346                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
347                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
348                 </links>
349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
350                         <actions>
351                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
352                                 <retrieve/>
353                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
354                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
355                         </actions>
356                 </permacrud>
357         </class>
358
359         <class  id="vibtg" 
360             controller="open-ils.cstore open-ils.pcrud" 
361             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
362             oils_persist:tablename="vandelay.import_bib_trash_group" 
363             reporter:label="Import/Overlay Field Groups for Removal">
364                 <fields oils_persist:primary="id" 
365                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
366                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
367                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
368                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
369                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
370                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
371                 </fields>
372                 <links>
373                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
374                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
375                 </links>
376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
377                         <actions>
378                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
379                                 <retrieve/>
380                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
381                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
382                         </actions>
383                 </permacrud>
384         </class>
385
386
387         <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">
388                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
389                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
390                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
391                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
392                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
393                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
394                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
395                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
396                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
397                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
398                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
399                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
400                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
401                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
402                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
403                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
404                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
405                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
406                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
407                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
408                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
409                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
410                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
411                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
412                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
413                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
414                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
415                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
416                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
417                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
418                 </fields>
419                 <links>
420                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
421                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
422                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
423                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
424                 </links>
425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
426                         <actions>
427                                 <create permission="CREATE_IMPORT_ITEM">
428                     <context link="definition" field="owner"/>
429                                 </create>
430                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
431                     <context link="definition" field="owner"/>
432                                 </retrieve>
433                                 <update permission="UPDATE_IMPORT_ITEM">
434                     <context link="definition" field="owner"/>
435                                 </update>
436                                 <delete permission="DELETE_IMPORT_ITEM">
437                     <context link="definition" field="owner"/>
438                                 </delete>
439                         </actions>
440                 </permacrud>
441         </class>
442
443         <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">
444                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
445                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
446                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
448                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
449                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
450                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
451                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
452                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
453                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
454                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
455                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
456                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
457                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
458                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
459                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
460                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
462                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
463                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
464                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
465                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
466                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
467                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
468                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
469                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
470                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
471                 </fields>
472                 <links>
473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
474                 </links>
475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
476                         <actions>
477                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
478                                 <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"/>
479                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
480                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
481                         </actions>
482                 </permacrud>
483         </class>
484
485         <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">
486                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
487                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
488                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
489                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
490                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
491                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
492                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
493                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
494                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
495                 </fields>
496                 <links>
497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
498                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
499                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
500                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
501                 </links>
502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
503                         <actions>
504                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
505                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
506                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
507                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
508                         </actions>
509                 </permacrud>
510         </class>
511
512         <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">
513                 <fields oils_persist:primary="code">
514                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
516                 </fields>
517                 <links>
518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
519                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
520                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
521                 </links>
522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
523                         <actions>
524                                 <retrieve/>
525                         </actions>
526                 </permacrud>
527         </class>
528
529         <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">
530                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
531                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
532                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
533                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
534                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
535                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
536                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
537                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
538                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
539                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
540                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
541                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
542                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
543                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
544                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
545                 </fields>
546                 <links>
547                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
548                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
549                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
550                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
551             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
552             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
553             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
554                 </links>
555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
556                         <actions>
557                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
558                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
559                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
560                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
561                         </actions>
562                 </permacrud>
563         </class>
564
565         <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">
566                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
568                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
569                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
570                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
571                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
572                 </fields>
573                 <links/>
574                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
575                         <actions>
576                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
577                 <retrieve/>
578                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
579                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
580                         </actions>
581                 </permacrud>
582         </class>
583
584         <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">
585                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
586                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
587                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
588                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
589                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
594                 </links>
595                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
596                         <actions>
597                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
598                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
599                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
600                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
601                         </actions>
602                 </permacrud>
603         </class>
604
605         <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">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
607                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
608                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
609                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
610                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
611                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
612                 </fields>
613                 <links>
614                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
615                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
616                 </links>
617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
618                         <actions>
619                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
620                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
621                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
622                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
623                         </actions>
624                 </permacrud>
625         </class>
626
627         <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">
628                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
629                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
630                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
632                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
633                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
634                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
635                 </fields>
636                 <links>
637                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
638                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
639                 </links>
640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
641                         <actions>
642                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
643                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
644                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
645                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
646                         </actions>
647                 </permacrud>
648         </class>
649
650         <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">
651                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
652                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
653                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
654                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
655                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
656                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
657                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
658                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
659                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
660                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
661                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
662                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
663                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
664                 </fields>
665                 <links>
666                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
667                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
668                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
669             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
670             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
671                 </links>
672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
673                         <actions>
674                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
675                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
676                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
677                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
678                         </actions>
679                 </permacrud>
680         </class>
681
682         <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">
683                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
685                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
686                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
687                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
688                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
689                 </fields>
690                 <links/>
691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
692                         <actions>
693                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
694                 <retrieve/>
695                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
696                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
697                         </actions>
698                 </permacrud>
699         </class>
700
701         <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">
702                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
703                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
704                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
705                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
706                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
711                 </links>
712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
713                         <actions>
714                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
716                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
717                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
718                         </actions>
719                 </permacrud>
720         </class>
721
722         <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">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
724                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
725                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
726                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
727                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
728                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
729                 </fields>
730                 <links>
731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
732                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
733                 </links>
734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735                         <actions>
736                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
737                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
738                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
739                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
740                         </actions>
741                 </permacrud>
742         </class>
743
744         <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">
745                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
746                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
748                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
749                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
750                 </fields>
751                 <links>
752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
753                 </links>
754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
755                         <actions>
756                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
757                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
758                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
759                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
760                         </actions>
761                 </permacrud>
762         </class>
763
764         <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">
765                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
766                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
767                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
768                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
769                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
770                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
771                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
772                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
773             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
774                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
775                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
776                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
777                 </fields>
778                 <links>
779                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
780                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
781                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
782                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
783                 </links>
784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
785                         <actions>
786                                 <create permission="ADMIN_IMPORT_MATCH_SET">
787                     <context link="match_set" field="owner"/>
788                                 </create>
789                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
790                     <context link="match_set" field="owner"/>
791                                 </retrieve>
792                                 <update permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </update>
795                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </delete>
798                         </actions>
799                 </permacrud>
800         </class>
801
802         <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">
803                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
804                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
805                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
806                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
807                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
808                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
809                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
810                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
811                 </fields>
812                 <links>
813                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
814                 </links>
815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
816                         <actions>
817                                 <create permission="ADMIN_IMPORT_MATCH_SET">
818                     <context link="match_set" field="owner"/>
819                                 </create>
820                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
821                     <context link="match_set" field="owner"/>
822                                 </retrieve>
823                                 <update permission="ADMIN_IMPORT_MATCH_SET">
824                     <context link="match_set" field="owner"/>
825                                 </update>
826                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
827                     <context link="match_set" field="owner"/>
828                                 </delete>
829                         </actions>
830                 </permacrud>
831         </class>
832
833         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
834                 oils_obj:fieldmapper="vandelay::session_tracker" 
835                 oils_persist:tablename="vandelay.session_tracker" 
836                 reporter:label="Vandelay Session Tracker">
837                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
839                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
840                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
842                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
843                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
844                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
845                                          queue or an auth queue and there's no IDL class for vandelay.queue .
846                                          parent table.
847                         -->
848                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
849                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
850                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
851                         <field reporter:label="State" name="state" reporter:datatype="text"/>
852                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
853                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
854                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
855                 </fields>
856                 <links>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
859                 </links>
860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
861                         <actions>
862                                 <!-- created by the API -->
863                                 <retrieve global_required="true"
864                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
865                                 <update global_required="true"
866                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
867                                         <context link="workstation" field="owning_lib"/>
868                                 </update>
869                                 <delete 
870                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
871                                         <context link="workstation" field="owning_lib"/>
872                                 </delete>
873                         </actions>
874                 </permacrud>
875         </class>
876
877         <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">
878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
879                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
880                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
881                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
882                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
883                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
884                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
885                 </fields>
886                 <links>
887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
889                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
890                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
891                 </links>
892         </class>
893
894     <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">
895         <fields oils_persist:primary="name">
896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
897             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
898             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
899             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
900         </fields>
901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
902             <actions>
903                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
904                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
905                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
906                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
907             </actions>
908         </permacrud>
909     </class>
910
911     <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">
912         <fields oils_persist:primary="id">
913             <field reporter:label="ID" name="id" reporter:datatype="id"/>
914             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
915             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
916             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
917             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
918         </fields>
919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
920             <actions>
921                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922                 <retrieve/>
923                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
924                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
925             </actions>
926         </permacrud>
927     </class>
928
929         <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">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
932                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
933                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
934                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
935                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
936                 </fields>
937                 <links>
938                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
939                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
940                 </links>
941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
942             <actions>
943                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
944                 <retrieve/>
945                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
946                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
947             </actions>
948         </permacrud>
949         </class>
950
951         <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">
952                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
953                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
954                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
956         </fields>
957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
958             <actions>
959                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
960                 <retrieve/>
961                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
962                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
963             </actions>
964         </permacrud>
965         </class>
966
967         <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">
968                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
969                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
970                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
971                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
972                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
974                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
975                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
976                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
977                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
978                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
979                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
980         </fields>
981                 <links>
982                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
984         </links>
985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
986             <actions>
987                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
988                 <retrieve/>
989                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
991             </actions>
992         </permacrud>
993         </class>
994
995         <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">
996                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
997                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
998                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
999                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
1001                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
1002                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1003                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
1004                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
1005                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
1006                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
1007         </fields>
1008                 <links>
1009                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
1010                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1011         </links>
1012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1013             <actions>
1014                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
1015                 <retrieve/>
1016                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
1017                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
1018             </actions>
1019         </permacrud>
1020         </class>
1021
1022         <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">
1023                 <fields oils_persist:primary="name">
1024                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1025                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1026                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1027                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1028                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1029                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1030                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1031                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1032                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1033                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1034                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1035                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1036                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1037                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1038                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1039                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1040                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1041                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1042                 </fields>
1043                 <links>
1044                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1045                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1046                 </links>
1047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1048             <actions>
1049                 <create permission="ADMIN_SVF" global_required="true"/>
1050                 <retrieve/>
1051                 <update permission="ADMIN_SVF" global_required="true"/>
1052                 <delete permission="ADMIN_SVF" global_required="true"/>
1053             </actions>
1054         </permacrud>
1055         </class>
1056
1057         <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">
1058                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1060                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1061                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1062             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1063                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1064                 </fields>
1065                 <links/>
1066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1067             <actions>
1068                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1069                 <retrieve/>
1070                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1071                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <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">
1077                 <fields oils_persist:primary="coded_value">
1078                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1087                 <retrieve/>
1088                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1089                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1090             </actions>
1091         </permacrud>
1092         </class>
1093
1094         <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">
1095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1096                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1097                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1098                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1099                 </fields>
1100                 <links>
1101                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1102                 </links>
1103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1104             <actions>
1105                 <retrieve/>
1106             </actions>
1107         </permacrud>
1108         </class>
1109
1110
1111         <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">
1112                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1113                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1114                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1115                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1116                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1117                 </fields>
1118                 <links>
1119                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1120                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1121                 </links>
1122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1123             <actions>
1124                 <retrieve/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129
1130         <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">
1131                 <fields oils_persist:primary="source">
1132                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1133                         <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 -->
1134                 </fields>
1135                 <links>
1136                         <link field="source" 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="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">
1146                 <fields>
1147                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1148                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1149                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1150                 </fields>
1151                 <links>
1152                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1153                 </links>
1154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1155             <actions>
1156                 <retrieve/>
1157             </actions>
1158         </permacrud>
1159         </class>
1160
1161         <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">
1162                 <fields oils_persist:primary="id">
1163                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1164                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1165                 </fields>
1166                 <links>
1167                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1168                 </links>
1169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1170             <actions>
1171                 <retrieve/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <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">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1179                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1180                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1181                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1182                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1183                 </fields>
1184                 <links>
1185                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1186                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1187                 </links>
1188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1189             <actions>
1190                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1191                 <retrieve/>
1192                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1193                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1194             </actions>
1195         </permacrud>
1196         </class>
1197
1198         <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">
1199                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1200                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1201                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1202                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1203                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1204                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1205                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1206                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1207             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1208             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1209             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1210                 </fields>
1211                 <links>
1212                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1213                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1218                 <retrieve/>
1219                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1220                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225         <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">
1226                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1227                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1228                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1229                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1230                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1231                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1232                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1233                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1234                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1235                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1236                 </fields>
1237                 <links>
1238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1239                 </links>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1243                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1244                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1245                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250     <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">
1251         <fields oils_persist:primary="name">
1252             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1253             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1255             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1256             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1257             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1258             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1259             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1260             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1261             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1262         </fields>
1263         <links>
1264             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1265             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1266         </links>
1267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1268             <actions>
1269                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <retrieve/>
1271                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1272                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273             </actions>
1274         </permacrud>
1275     </class>
1276
1277     <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">
1278         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1279             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1280             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1281             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1282             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1283             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1284             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1285             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1286         </fields>
1287         <links>
1288             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1289         </links>
1290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291             <actions>
1292                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1293                 <retrieve/>
1294                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1296             </actions>
1297         </permacrud>
1298     </class>
1299
1300     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1301                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1302                         oils_persist:tablename="config.z3950_index_field_map" 
1303                         reporter:label="Z39.50 Index Field Map">
1304         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1305             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1306             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1307             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1308             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1309             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1310             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1311         </fields>
1312         <links>
1313             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1314             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1315             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1316         </links>
1317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1318             <actions>
1319                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1320                 <retrieve/>
1321                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1322                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1323             </actions>
1324         </permacrud>
1325     </class>
1326
1327
1328         <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">
1329                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1330                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1331                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1332                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1333                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1334                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1335                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1336             <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1337                 </fields>
1338                 <links>
1339             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1340             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1341                 </links>
1342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1343                         <actions>
1344                                 <retrieve/>
1345                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1346                         </actions>
1347                 </permacrud>
1348         </class>
1349
1350         <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">
1351                 <fields oils_persist:primary="key">
1352                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1353                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1354                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1355                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1356                 </fields>
1357                 <links/>
1358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1359                         <actions>
1360                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1361                                 <retrieve/>
1362                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1363                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1364                         </actions>
1365                 </permacrud>
1366         </class>
1367
1368         <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">
1369                 <fields oils_persist:primary="module">
1370                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1371                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1372                 </fields>
1373                 <links/>
1374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1375                         <actions>
1376                                 <retrieve/>
1377                         </actions>
1378                 </permacrud>
1379         </class>
1380
1381         <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">
1382                 <fields oils_persist:primary="module">
1383                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1385                 </fields>
1386                 <links/>
1387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1388                         <actions>
1389                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1390                                 <retrieve/>
1391                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1392                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1393                         </actions>
1394                 </permacrud>
1395         </class>
1396
1397         <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">
1398                 <fields oils_persist:primary="module">
1399                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1400                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1401                 </fields>
1402                 <links/>
1403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1404                         <actions>
1405                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1406                                 <retrieve/>
1407                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1408                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1409                         </actions>
1410                 </permacrud>
1411         </class>
1412
1413         <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">
1414                 <fields oils_persist:primary="module">
1415                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                 </fields>
1418                 <links/>
1419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1420                         <actions>
1421                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1422                                 <retrieve/>
1423                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1424                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1425                         </actions>
1426                 </permacrud>
1427         </class>
1428
1429         <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">
1430                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1431                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1432                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1433                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1434                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1435                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1436                 </fields>
1437                 <links>
1438                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1439                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1440                 </links>
1441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1442                         <actions>
1443                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1444                     <context link="event_def" field="owner"/>
1445                 </create>
1446                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1447                     <context link="event_def" field="owner"/>
1448                 </retrieve>
1449                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1450                     <context link="event_def" field="owner"/>
1451                 </update>
1452                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1453                     <context link="event_def" field="owner"/>
1454                 </delete>
1455                         </actions>
1456                 </permacrud>
1457         </class>
1458
1459         <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">
1460                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1461                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1462                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1463                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1464                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1467                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1468                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1469                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1471                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1473                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1474                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1475                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1477                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1478                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1479                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1480                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1481                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1482                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1483                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1485                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1486                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1489                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1490                 </fields>
1491                 <links>
1492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1493                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1494                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1495                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1496                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1498                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1499                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1500                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1501                 </links>
1502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503                         <actions>
1504                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                         </actions>
1509                 </permacrud>
1510         </class>
1511
1512     <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">
1513         <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1514             <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1515             <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1516             <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1517             <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1518             <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1519             <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1520             <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1521         </fields>
1522         <links>
1523             <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1524             <link field="locale" relteype="has_a" key="code" map="" class="i18n_l"/>
1525          </links>
1526          <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1527              <actions>
1528                  <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1529                      <context link="event_def" field="owner"/>
1530                  </create>
1531                  <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1532                      <context link="event_def" field="owner"/>
1533                  </retrieve>
1534                  <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1535                      <context link="event_def" field="owner"/>
1536                  </update>
1537                  <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1538                      <context link="event_def" field="owner"/>
1539                  </delete>
1540             </actions>
1541         </permacrud>
1542     </class>
1543
1544
1545         <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">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1547                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1549                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1550                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1551                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1552                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1553                 </fields>
1554                 <links>
1555                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1556                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1557                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1558                 </links>
1559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560                         <actions>
1561                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1562                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1563                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1564                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1565                         </actions>
1566                 </permacrud>
1567         </class>
1568
1569         <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">
1570                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1572                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1573                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1574                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1575                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1576                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1577                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1578                 </fields>
1579                 <links>
1580                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1581                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1582                 </links>
1583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1584                         <actions>
1585                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1586                     <context link="grp" field="owner"/>
1587                 </create>
1588                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1589                     <context link="grp" field="owner"/>
1590                 </retrieve>
1591                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1592                     <context link="grp" field="owner"/>
1593                 </update>
1594                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1595                     <context link="grp" field="owner"/>
1596                 </delete>
1597                         </actions>
1598                 </permacrud>
1599         </class>
1600
1601         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1602                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1603                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1604                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1605                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1606                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1607                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1608                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1609                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1610                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1611                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1612                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1613                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1614                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1615                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1616                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1617                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1618                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1619                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1620                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1621                 </fields>
1622                 <links>
1623                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1624                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1625                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1626                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1627                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1628                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1629                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1630                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1631                 </links>
1632         </class>
1633
1634         <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">
1635                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1636                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1637                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1638                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1639                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1640                 </fields>
1641                 <links>
1642                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1643                 </links>
1644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1645                         <actions>
1646                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1647                     <context link="event_def" field="owner"/>
1648                 </create>
1649                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1650                     <context link="event_def" field="owner"/>
1651                 </retrieve>
1652                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1653                     <context link="event_def" field="owner"/>
1654                 </update>
1655                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1656                     <context link="event_def" field="owner"/>
1657                 </delete>
1658                         </actions>
1659                 </permacrud>
1660         </class>
1661
1662         <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">
1663                 <oils_persist:source_definition><![CDATA[
1664                 SELECT  atevdef.hook,
1665                         atevdef.name,
1666                         atevdef.reactor,
1667                         atev.id,
1668                         atev.event_def,
1669                         atev.add_time,
1670                         atev.run_time,
1671                         atev.start_time,
1672                         atev.update_time,
1673                         atev.complete_time,
1674                         atev.update_process,
1675                         atev.state,
1676                         atev.user_data,
1677                         atev.template_output,
1678                         atev.error_output,
1679                         atev.async_output,
1680                         targ_circ.id AS target_circ,
1681                         targ_ahr.id AS target_hold,
1682                         COALESCE(
1683                                 targ_circ.circ_lib,
1684                                 targ_ahr.pickup_lib
1685                         ) AS perm_lib
1686                 FROM action_trigger.event atev
1687                 JOIN action_trigger.event_definition atevdef ON
1688                         (atevdef.id = atev.event_def)
1689                 JOIN action_trigger.hook ath ON
1690                         (ath.key = atevdef.hook)
1691                 LEFT JOIN action.circulation targ_circ ON
1692                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1693                 LEFT JOIN action.hold_request targ_ahr ON
1694                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1695                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1696                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1697                                 'circ.staff.max_visible_event_age',
1698                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1699                         ) UNION
1700                         SELECT '1000 YEARS'::INTERVAL AS value
1701                 ) ous)
1702                 ]]></oils_persist:source_definition>
1703                 <fields oils_persist:primary="id">
1704                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1705                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1706                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1707                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1708                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1709                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1710                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1711                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1712                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1713                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1714                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1715                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1716                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1717                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1718                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1719                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1720                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1721                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1722                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1723                 </fields>
1724                 <links>
1725                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1726                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1727                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1728                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1729                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1730                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1731                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1732                 </links>
1733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1734                         <actions>
1735                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1736                         </actions>
1737                 </permacrud>
1738         </class>
1739
1740         <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">
1741                 <oils_persist:source_definition><![CDATA[
1742                 SELECT  atevdef.hook,
1743                         atevdef.name,
1744                         atevdef.reactor,
1745                         atev.id,
1746                         atev.event_def,
1747                         atev.add_time,
1748                         atev.run_time,
1749                         atev.start_time,
1750                         atev.update_time,
1751                         atev.complete_time,
1752                         atev.update_process,
1753                         atev.state,
1754                         atev.user_data,
1755                         atev.template_output,
1756                         atev.error_output,
1757                         atev.async_output,
1758             atev.target,
1759                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1760                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1761             atev.context_user,
1762                         atev.context_library,
1763             atev.context_bib,
1764             atev.context_item,
1765             rssr.title,
1766             rssr.author
1767                 FROM action_trigger.event atev
1768                 JOIN action_trigger.event_definition atevdef ON
1769                         (atevdef.id = atev.event_def)
1770                 JOIN action_trigger.hook ath ON
1771                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1772         LEFT JOIN reporter.super_simple_record rssr ON
1773             (atev.context_bib = rssr.id)
1774                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1775                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1776                                 'circ.staff.max_visible_event_age',
1777                                 atev.context_library
1778                         ) UNION
1779                         SELECT '1000 YEARS'::INTERVAL AS value
1780                 ) ous)
1781                 ]]></oils_persist:source_definition>
1782                 <fields oils_persist:primary="id">
1783                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1785                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1786                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1787                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1788                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1789                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1790                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1791                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1792                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1793                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1794                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1795                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1796                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1797                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1798                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1799                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1800                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1801                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1802                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1803                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1804                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1805                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1806                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1807                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1808                 </fields>
1809                 <links>
1810                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1811                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1812                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1813                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1814                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1815                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1816                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1817                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1818                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1819                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1820                 </links>
1821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1822                         <actions>
1823                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1824                         </actions>
1825                 </permacrud>
1826         </class>
1827
1828         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1829                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1830                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1831                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1832                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1833                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1834                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1835                 </fields>
1836                 <links>
1837                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1838                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1839                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1840                 </links>
1841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1842                         <actions>
1843                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1844                         </actions>
1845                 </permacrud>
1846         </class>
1847
1848         <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">
1849                 <fields oils_persist:primary="code">
1850                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1851                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1852                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1853                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1854                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1855                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1863                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <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">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1871                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1872                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1873                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1874                 </fields>
1875                 <links/>
1876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1877             <actions>
1878                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1879                 <retrieve/>
1880                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1881                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1882             </actions>
1883         </permacrud>
1884         </class>
1885
1886         <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">
1887                 <fields oils_persist:primary="code">
1888                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1889                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1890                 </fields>
1891                 <links/>
1892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1893             <actions>
1894                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1895                 <retrieve/>
1896                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1897                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1898             </actions>
1899         </permacrud>
1900         </class>
1901
1902         <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">
1903                 <fields oils_persist:primary="code">
1904                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1905                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1906                 </fields>
1907                 <links/>
1908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1909             <actions>
1910                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1913                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1914             </actions>
1915         </permacrud>
1916         </class>
1917
1918         <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">
1919                 <fields oils_persist:primary="code">
1920                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1921                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1922                 </fields>
1923                 <links/>
1924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1925             <actions>
1926                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1927                 <retrieve/>
1928                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1929                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1930             </actions>
1931         </permacrud>
1932         </class>
1933
1934         <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">
1935                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1936                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1937                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1938                 </fields>
1939                 <links/>
1940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1941             <actions>
1942                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1943                 <retrieve/>
1944                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1945                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1946             </actions>
1947         </permacrud>
1948         </class>
1949
1950         <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">
1951                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1952                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1953                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1954                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1955                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1956                 </fields>
1957         <links>
1958             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1959             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1960             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1961         </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="UPDATE_COPY">
1965                     <context link="target_copy" field="circ_lib"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="UPDATE_COPY">
1969                     <context link="target_copy" field="circ_lib"/>
1970                 </update>
1971                 <delete permission="UPDATE_COPY">
1972                     <context link="target_copy" field="circ_lib"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977
1978         <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">
1979                 <fields oils_persist:primary="code">
1980                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1981                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1982                 </fields>
1983                 <links/>
1984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1985             <actions>
1986                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1987                 <retrieve/>
1988                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1989                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1990             </actions>
1991         </permacrud>
1992         </class>
1993
1994         <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">
1995                 <fields oils_persist:primary="code">
1996                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1997                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1998                 </fields>
1999                 <links/>
2000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2001             <actions>
2002                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
2003                 <retrieve/>
2004                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
2005                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
2006             </actions>
2007         </permacrud>
2008         </class>
2009
2010         <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">
2011                 <fields oils_persist:primary="code">
2012                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
2013                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2014                 </fields>
2015                 <links/>
2016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2017             <actions>
2018                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2019                 <retrieve/>
2020                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2021                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2022             </actions>
2023         </permacrud>
2024         </class>
2025
2026     <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">
2027         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
2028             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2029             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2030             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
2031             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
2032             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
2033             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2034             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2035             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2036             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2037             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2038             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2039             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2040             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2041             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2042             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2043             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2044             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2045         </fields>
2046         <links/>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2050                 <retrieve/>
2051                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2052                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057     <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">
2058         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2059             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2060             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2061             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2062             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2063             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2064             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2065             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2066             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2067             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2068             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2069             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2070             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2071             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2072             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2073             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2074             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2075             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2076             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2077             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2078         </fields>
2079         <links/>
2080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2081             <actions>
2082                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2083                 <retrieve/>
2084                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2085                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2086             </actions>
2087         </permacrud>
2088     </class>
2089
2090     <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">
2091         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2092             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2093             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2094             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2095             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2096             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2097         </fields>
2098         <links>
2099             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2100             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2101             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2102         </links>
2103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2104             <actions>
2105                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2106                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2107                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2108                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2109             </actions>
2110         </permacrud>
2111     </class>
2112
2113         <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">
2114                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2115                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2116                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2117                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2118                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2120                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2121                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2122                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2123                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2124                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2125                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2127                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2128                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2129                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2130                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2131             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2132                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2133                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2134                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2135                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2136                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2137                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2138                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2139                 </fields>
2140                 <links>
2141                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2142                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2147                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2149                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2150                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2151                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2152                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2153                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2154             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2155                 </links>
2156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2157             <actions>
2158                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2159                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162             </actions>
2163         </permacrud>
2164         </class>
2165
2166         <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">
2167                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2168                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2169                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2170                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2172                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2173                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2175                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2176                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2177                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2178                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2183             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2184                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2185                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2186             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2187                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2188                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2189                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2191             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2192             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2193             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2194                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2195                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2196                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2197                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2198                 </fields>
2199                 <links>
2200                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2201                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2202                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2205                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2206                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2207                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2208                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2209                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2210                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2211                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2212                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2213                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2214             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2215                 </links>
2216         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217             <actions>
2218                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2219                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2220                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222             </actions>
2223         </permacrud>
2224         </class>
2225
2226     <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">
2227         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2228             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2229             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2230             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2231         </fields>
2232         <links/>
2233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2234             <actions>
2235                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2236                 <retrieve/>
2237                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2239             </actions>
2240         </permacrud>
2241     </class>
2242
2243     <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">
2244         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2245             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2246             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2247             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2248             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2249             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2250             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2251             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2252         </fields>
2253         <links>
2254             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2255         </links>
2256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2257             <actions>
2258                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2259                 <retrieve/>
2260                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2262             </actions>
2263         </permacrud>
2264     </class>
2265
2266     <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">
2267         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2268             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2269             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2270             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2271             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2272             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2273         </fields>
2274         <links>
2275             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2276             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2277         </links>
2278         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2279             <actions>
2280                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2281                     <context link="matchpoint" field="org_unit"/>
2282                 </create>
2283                 <retrieve/>
2284                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2285                     <context link="matchpoint" field="org_unit"/>
2286                 </update>
2287                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2288                     <context link="matchpoint" field="org_unit"/>
2289                 </delete>
2290             </actions>
2291         </permacrud>
2292     </class>
2293
2294     <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">
2295         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2296             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2297             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2298             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2299         </fields>
2300         <links>
2301             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2302             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2303         </links>
2304         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2305             <actions>
2306                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2307                     <context link="limit_set" field="owning_lib"/>
2308                 </create>
2309                 <retrieve/>
2310                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2311                     <context link="limit_set" field="owning_lib"/>
2312                 </update>
2313                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2314                     <context link="limit_set" field="owning_lib"/>
2315                 </delete>
2316             </actions>
2317         </permacrud>
2318     </class>
2319     <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">
2320         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2321             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2322             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2323             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2324         </fields>
2325         <links>
2326             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2327             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2328         </links>
2329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2330             <actions>
2331                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                     <context link="limit_set" field="owning_lib"/>
2333                 </create>
2334                 <retrieve/>
2335                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2336                     <context link="limit_set" field="owning_lib"/>
2337                 </update>
2338                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2339                     <context link="limit_set" field="owning_lib"/>
2340                 </delete>
2341             </actions>
2342         </permacrud>
2343     </class>
2344
2345     <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">
2346         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2347             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2348             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2349             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2350             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2351         </fields>
2352         <links>
2353             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2354             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2355         </links>
2356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2357             <actions>
2358                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2359                     <context link="limit_set" field="owning_lib"/>
2360                 </create>
2361                 <retrieve/>
2362                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2363                     <context link="limit_set" field="owning_lib"/>
2364                 </update>
2365                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2366                     <context link="limit_set" field="owning_lib"/>
2367                 </delete>
2368             </actions>
2369         </permacrud>
2370     </class>
2371
2372         <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">
2373                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2374                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2375                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2376                 </fields>
2377                 <links/>
2378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2379             <actions>
2380                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2381                 <retrieve/>
2382                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387
2388         <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">
2389                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2390                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2391                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2392                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2394                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2395                 </fields>
2396                 <links>
2397                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2398                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2399                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2400                 </links>
2401         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2402             <actions>
2403                 <create permission="ADMIN_SURVEY">
2404                     <context link="survey" field="owner"/>
2405                 </create>
2406                 <retrieve/>
2407                 <update permission="ADMIN_SURVEY">
2408                     <context link="survey" field="owner"/>
2409                 </update>
2410                 <delete permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </delete>
2413             </actions>
2414         </permacrud>
2415         </class>
2416         <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">
2417                 <fields oils_persist:primary="id" oils_persist:sequence="">
2418                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2419                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2420                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2423                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2424                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2425                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2426                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2427                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2428                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2429                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2430                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2431                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2432                 </fields>
2433                 <links>
2434                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2435                 </links>
2436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2437                         <actions>
2438                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2439                                         <context link="usr" field="home_ou" />
2440                                 </retrieve>
2441                         </actions>
2442                 </permacrud>
2443         </class>
2444         <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">
2445                 <fields oils_persist:primary="id" oils_persist:sequence="">
2446                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2447                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2448                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2449                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2450                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2451                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2452                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2453                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2454                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2455                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2456                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2457                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2458                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2459                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2460                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2461                 </fields>
2462                 <links>
2463                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2464                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2465                 </links>
2466         </class>
2467         <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">
2468                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2469                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2470                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2471                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2472                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2473                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2474                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2475                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2476                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2477                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2478                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2479                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2480                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2481                 </fields>
2482                 <links>
2483                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2485                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2486                 </links>
2487                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488                         <actions> <!-- created magically, so no create action -->
2489                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2490                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2491                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <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)">
2496                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2497                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2499                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2500                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2501                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2502                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2503                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2504                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2505                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2506                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2507                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2508                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2509                 </fields>
2510                 <links>
2511                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2512                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2513                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2514                 </links>
2515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2516                         <actions> <!-- created magically, so no create action -->
2517                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2518                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2519                         </actions>
2520                 </permacrud>
2521         </class>
2522         <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">
2523         <fields oils_persist:primary="id">
2524                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2525                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2526                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2527                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2530                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2531                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2533                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2534                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2535                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2536                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2537                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2538                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2539                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2540                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2541                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2542                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2543                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2545                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2546                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2547                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2548                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2549                 </fields>
2550                 <links>
2551                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2552                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2553                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2554                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2555                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2559                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2560                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2562                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2563                 </links>
2564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2565                         <actions> <!-- created magically, so no create action -->
2566                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2567                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571
2572         <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">
2573                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2574                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2576                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2577                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2578                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2579                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2580                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2581                 </fields>
2582                 <links>
2583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2584                 </links>
2585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2586                         <actions>
2587                                 <create permission="UPDATE_USER">
2588                                         <context link="usr" field="home_ou"/>
2589                                 </create>
2590                                 <retrieve permission="VIEW_USER">
2591                                         <context link="usr" field="home_ou"/>
2592                                 </retrieve>
2593                                 <update permission="UPDATE_USER">
2594                                         <context link="usr" field="home_ou"/>
2595                                 </update>
2596                                 <delete permission="UPDATE_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </delete>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <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">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2604                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2605                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2606                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2607                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2608                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2609                 </fields>
2610                 <links>
2611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2612                 </links>
2613         </class>
2614         <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">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2616                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2617                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2618                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2619                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2620                 </fields>
2621                 <links>
2622                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2623                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <retrieve permission="VIEW_USER">
2628                                         <context link="usr" field="home_ou" />
2629                                 </retrieve>
2630                         </actions>
2631                 </permacrud>
2632         </class>
2633         <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">
2634                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2635                         <field name="field" reporter:datatype="link"/>
2636                         <field name="id" reporter:datatype="id" />
2637                         <field name="source" reporter:datatype="link"/>
2638                         <field name="value" reporter:datatype="text"/>
2639                 </fields>
2640                 <links>
2641                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2642                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2643                 </links>
2644         </class>
2645         <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">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2647                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2648                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2649                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2650                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2651                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2652                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2653                 </fields>
2654                 <links>
2655                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2656                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2657                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2658                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2659                 </links>
2660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2661                         <actions>
2662                                 <retrieve/>
2663                         </actions>
2664                 </permacrud>
2665         </class>
2666         <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">
2667                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2668                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2669                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2670                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2671                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2672                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2673                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2674                 </fields>
2675                 <links>
2676                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2677                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2678                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2679                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2680                 </links>
2681                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2682                         <actions>
2683                                 <retrieve/>
2684                         </actions>
2685                 </permacrud>
2686         </class>
2687         <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">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2689                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2690                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2691                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2692                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2693                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2694                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2695                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2696                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2697                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2698                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2699                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2701                 </fields>
2702                 <links>
2703                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2704                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2705                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2706                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2707                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2709                 </links>
2710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2711             <actions>
2712                 <create permission="TRANSIT_COPY" context_field="owner">
2713                     <context link="target_copy" field="circ_lib"/>
2714                 </create>
2715                 <retrieve/>
2716                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2717                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <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">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2723                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2724                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2725                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2726                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2727                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2728                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2729                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2730                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2731                 </fields>
2732                 <links>
2733                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2734                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2735                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2736                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2737                 </links>
2738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739             <actions>
2740                 <create permission="ADMIN_SURVEY">
2741                     <context link="survey" field="owner"/>
2742                 </create>
2743                 <retrieve permission="VIEW_USER">
2744                     <context link="usr" field="home_ou"/>
2745                 </retrieve>
2746                 <update permission="ADMIN_SURVEY">
2747                     <context link="survey" field="owner"/>
2748                 </update>
2749                 <delete permission="ADMIN_SURVEY">
2750                     <context link="survey" field="owner"/>
2751                 </delete>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <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">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2757                         <field name="bucket" reporter:datatype="link"/>
2758                         <field name="id" reporter:datatype="id" />
2759                         <field name="target_copy" reporter:datatype="link"/>
2760                         <field name="create_time" reporter:datatype="timestamp" />
2761                         <field name="pos" reporter:datatype="int" />
2762                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2763                 </fields>
2764                 <links>
2765                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2766                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2767             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <retrieve permission="ADMIN_COPY_BUCKET">
2772                     <context link="bucket" field="owning_lib"/>
2773                 </retrieve>
2774             </actions>
2775         </permacrud>
2776         </class>
2777         <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">
2778                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2779                         <field name="id" reporter:datatype="id" />
2780                         <field name="item" reporter:datatype="link"/>
2781                         <field name="note" reporter:datatype="text" />
2782                 </fields>
2783                 <links>
2784                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2785                 </links>
2786         </class>
2787
2788         <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">
2789                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2790                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2791                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2792                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2793                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2794                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2795                 </fields>
2796                 <links>
2797                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2798                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2799                 </links>
2800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2801                         <actions>
2802                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2803                                 <retrieve/>
2804                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                         </actions>
2807                 </permacrud>
2808         </class>
2809
2810         <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">
2811                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2812                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2813                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2814                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2815                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2816                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2817                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2818                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2819                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2820                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2821                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2822                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2823                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2824                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2827                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2828                 </fields>
2829                 <links>
2830                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2831                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2832                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2833                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2834                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2835                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2836                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2837                 </links>
2838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2839                         <actions>
2840                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2841                                 <retrieve/>
2842                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2844                         </actions>
2845                 </permacrud>
2846         </class>
2847
2848         <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">
2849                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2850                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2851                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2852                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2853                 </fields>
2854                 <links>
2855                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2856                 </links>
2857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2858                         <actions>
2859                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2860                                 <retrieve/>
2861                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2863                         </actions>
2864                 </permacrud>
2865         </class>
2866
2867         <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">
2868                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2869                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2870                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2871                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2872                 </fields>
2873                 <links>
2874                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2875                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2880                                 <retrieve/>
2881                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886
2887         <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">
2888                 <fields oils_persist:primary="code">
2889                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2890                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2891                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2892                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2893                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2894                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2895                 </fields>
2896                 <links>
2897                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2898                 </links>
2899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2900                         <actions>
2901                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2902                                 <retrieve/>
2903                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2905                         </actions>
2906                 </permacrud>
2907         </class>
2908
2909         <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">
2910                 <fields oils_persist:primary="code">
2911                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2912                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2913                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2914                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2915                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2916                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2917                 </fields>
2918                 <links>
2919                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2920                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2921                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2922                 </links>
2923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2924                         <actions>
2925                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2926                                 <retrieve/>
2927                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2929                         </actions>
2930                 </permacrud>
2931         </class>
2932
2933     <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">
2934         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2935             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2936             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2937             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2938         </fields>
2939         <links>
2940             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2941             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2942         </links>
2943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2944             <actions>
2945                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2946                 <retrieve/>
2947                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2949             </actions>
2950         </permacrud>
2951     </class>
2952
2953         <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">
2954                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2955                         <field name="active" reporter:datatype="bool"/>
2956                         <field name="create_date" reporter:datatype="timestamp"/>
2957                         <field name="creator" />
2958                         <field name="deleted" reporter:datatype="bool"/>
2959                         <field name="edit_date" reporter:datatype="timestamp"/>
2960                         <field name="editor" />
2961                         <field name="id" reporter:datatype="id" />
2962                         <field name="last_xact_id" />
2963                         <field name="marc" />
2964                         <field name="source" />
2965                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2966                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2967                         <field name="heading" />
2968                         <field name="simple_heading" />
2969                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2970                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2971                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2972                 </fields>
2973                 <links>
2974                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2976                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2977                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2978                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2979                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2980                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2981                 </links>
2982                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2983                         <actions>
2984                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2985                                 <retrieve/>
2986                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2987                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2988                         </actions>
2989                 </permacrud>
2990         </class>
2991         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2992                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2993                         <field name="char_encoding" />
2994                         <field name="id" />
2995                         <field name="record" />
2996                         <field name="record_status" />
2997                         <field name="thesaurus" />
2998                 </fields>
2999                 <links>
3000                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3001                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3002                 </links>
3003         </class>
3004         <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">
3005                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3006                         <field name="id" reporter:datatype="id" />
3007                         <field name="bib" reporter:datatype="link" />
3008                         <field name="authority" reporter:datatype="link" />
3009                 </fields>
3010                 <links>
3011                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3012                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3013                 </links>
3014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3015                         <actions>
3016                                 <retrieve/>
3017                         </actions>
3018                 </permacrud>
3019         </class>
3020         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3021                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3022                         <field name="id" reporter:datatype="id" />
3023                         <field name="record" reporter:datatype="link" />
3024                         <field name="atag" reporter:datatype="link" />
3025                         <field name="value" reporter:datatype="text" />
3026                         <field name="thesaurus" reporter:datatype="text" />
3027                 </fields>
3028                 <links>
3029                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3030                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3031                 </links>
3032         </class>
3033
3034         <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">
3035                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3036                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3037                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3038                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3039                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3040                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3041                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3042                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3043                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3044                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3045                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3046                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3047                 </fields>
3048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3049                         <actions>
3050                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3051                                 <retrieve/>
3052                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3054                         </actions>
3055                 </permacrud>
3056         </class>
3057
3058         <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">
3059                 <fields oils_persist:primary="code" oils_persist:sequence="">
3060                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3061                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3062                 </fields>
3063                 <links/>
3064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3065             <actions>
3066                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3067                 <retrieve/>
3068                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3069                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3070             </actions>
3071         </permacrud>
3072         </class>
3073         <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">
3074                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3075                         <field name="accepting_usr" />
3076                         <field name="amount" reporter:datatype="money" />
3077                         <field name="amount_collected" reporter:datatype="money" />
3078                         <field name="approval_code" reporter:datatype="text"/>
3079                         <field name="cash_drawer" reporter:datatype="link"/>
3080                         <field name="cc_number" reporter:datatype="text"/>
3081                         <field name="cc_order_number" reporter:datatype="text"/>
3082                         <field name="cc_processor" reporter:datatype="text"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="note" reporter:datatype="text"/>
3085                         <field name="payment_ts" reporter:datatype="timestamp"/>
3086                         <field name="xact" reporter:datatype="link"/>
3087                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3088                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3089                 </fields>
3090                 <links>
3091                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3092                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3093                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3094                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3095                 </links>
3096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3097             <actions>
3098                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3099                     <context link="xact" jump="usr" field="home_ou"/>
3100                 </retrieve>
3101                         </actions>
3102                 </permacrud>
3103         </class>
3104         <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">
3105                 <fields oils_persist:primary="name">
3106                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3107                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3108                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3109                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3110                 </fields>
3111                 <links/>
3112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3113             <actions>
3114                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3115                 <retrieve/>
3116                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3117                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3118             </actions>
3119         </permacrud>
3120         </class>
3121
3122         <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">
3123                 <fields oils_persist:primary="alias">
3124                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3125                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3126                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3127                 </fields>
3128                 <links>
3129                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3130                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3131                 </links>
3132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3133             <actions>
3134                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3135                 <retrieve/>
3136                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3138             </actions>
3139         </permacrud>
3140         </class>
3141
3142         <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">
3143                 <fields oils_persist:primary="name">
3144                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3145                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3146                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3147                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3148                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3149                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3150                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3151                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3152                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3153                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3154                 </fields>
3155                 <links>
3156                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3157                 </links>
3158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3159             <actions>
3160                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3161                 <retrieve/>
3162                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3163                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3164             </actions>
3165         </permacrud>
3166         </class>
3167
3168         <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">
3169                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3171                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3172                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3173                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3174                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3175                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3176                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3177                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3178                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3179                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3180                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3181                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3182                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3183                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3184                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3185                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3186                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3187                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3188                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3189                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3190                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3191                 </fields>
3192                 <links>
3193                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3194                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3195                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3196                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3197                 </links>
3198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3199             <actions>
3200                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3201                 <retrieve/>
3202                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3203                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3204             </actions>
3205         </permacrud>
3206         </class>
3207
3208         <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">
3209                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3210                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3211                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3212                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3213                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3214                 </fields>
3215                 <links>
3216                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3217                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3218                 </links>
3219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3220             <actions>
3221                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3222                 <retrieve/>
3223                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3224                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3225             </actions>
3226         </permacrud>
3227         </class>
3228
3229         <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">
3230                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3231                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3232                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3233                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3234                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3235                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3236                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3237                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3238                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3239                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3240                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3241                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3242                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3243                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3244                 </fields>
3245                 <links>
3246                 </links>
3247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248                         <actions>
3249                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3250                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3251                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3252                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3253                         </actions>
3254                 </permacrud>
3255         </class>
3256         <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">
3257                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3258                         <field name="id" reporter:datatype="id" />
3259                         <field name="name" reporter:datatype="text"/>
3260                         <field name="xpath" reporter:datatype="text"/>
3261                         <field name="format" reporter:datatype="link"/>
3262                         <field name="first_word" reporter:datatype="bool" />
3263                 </fields>
3264                 <links/>
3265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266             <actions>
3267                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3268                 <retrieve/>
3269                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3270                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3271             </actions>
3272         </permacrud>
3273         </class>
3274         <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">
3275                 <fields oils_persist:primary="code" oils_persist:sequence="">
3276                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3277                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3278                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3279                 </fields>
3280                 <links/>
3281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3282             <actions>
3283                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3284                 <retrieve/>
3285                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3286                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3287             </actions>
3288         </permacrud>
3289         </class>
3290         <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">
3291                 <fields oils_persist:primary="code" oils_persist:sequence="">
3292                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3293                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297             <actions>
3298                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3299                 <retrieve/>
3300                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3301                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3302             </actions>
3303         </permacrud>
3304         </class>
3305     <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">
3306         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3307             <field reporter:label="ID" name="id" reporter:datatype="id" />
3308             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3309             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3310             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3311             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3312             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3313             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3314             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3315                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3316         </fields>
3317         <links>
3318             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3319             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3320             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3321                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3322         </links>
3323         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3324             <actions>
3325                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3326                 <retrieve/>
3327                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3328                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3329             </actions>
3330         </permacrud>
3331     </class>
3332     <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">
3333         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3334             <field reporter:label="ID" name="id" reporter:datatype="id" />
3335             <field reporter:label="Course" name="course" reporter:datatype="link" />
3336             <field reporter:label="User" name="usr" reporter:datatype="link" />
3337             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3338         </fields>
3339         <links>
3340             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3341             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3342             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3343         </links>
3344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3345             <actions>
3346                 <create permission="MANAGE_RESERVES">
3347                                         <context link="course" field="owning_lib" />
3348                 </create>
3349                 <retrieve/>
3350                 <update permission="MANAGE_RESERVES">
3351                                         <context link="course" field="owning_lib" />
3352                 </update>
3353                 <delete permission="MANAGE_RESERVES">
3354                                         <context link="course" field="owning_lib" />
3355                 </delete>
3356             </actions>
3357         </permacrud>
3358     </class>
3359     <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">
3360         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3361             <field reporter:label="ID" name="id" reporter:datatype="id" />
3362             <field reporter:label="Course" name="course" reporter:datatype="link" />
3363             <field reporter:label="Item" name="item" reporter:datatype="link" />
3364             <field reporter:label="Record" name="record" reporter:datatype="link" />
3365             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3366             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3367             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3368             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3369             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3370             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3371         </fields>
3372         <links>
3373             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3374             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3375             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3376             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3377             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3378             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3379             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3380         </links>
3381         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3382             <actions>
3383                 <create permission="MANAGE_RESERVES">
3384                                         <context link="course" field="owning_lib" />
3385                 </create>
3386                 <retrieve/>
3387                 <update permission="MANAGE_RESERVES">
3388                                         <context link="course" field="owning_lib" />
3389                 </update>
3390                 <delete permission="MANAGE_RESERVES">
3391                                         <context link="course" field="owning_lib" />
3392                 </delete>
3393             </actions>
3394         </permacrud>
3395     </class>
3396         <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">
3397                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3398                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3399                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3400             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3401                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3402                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3403                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3404                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3405                 </fields>
3406                 <links>
3407             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3408                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3409                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3410                 </links>
3411                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3412                         <actions>
3413                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3414                                 <retrieve/>
3415                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3416                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3417                         </actions>
3418                 </permacrud>
3419         </class>
3420     <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">
3421         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3422             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3423             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3424             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3425         </fields>
3426         <links>
3427             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3428             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3429         </links>
3430         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3431             <actions>
3432                 <create permission="MANAGE_RESERVES">
3433                                         <context link="course" field="owning_lib" />
3434                 </create>
3435                 <retrieve/>
3436                 <update permission="MANAGE_RESERVES">
3437                                         <context link="course" field="owning_lib" />
3438                 </update>
3439                 <delete permission="MANAGE_RESERVES">
3440                                         <context link="course" field="owning_lib" />
3441                 </delete>
3442             </actions>
3443         </permacrud>
3444     </class>
3445         <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">
3446                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3447                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3448                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3449             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3450                 </fields>
3451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3452                         <actions>
3453                                 <create permission="MANAGE_RESERVES" global_required="true" />
3454                                 <retrieve/>
3455                                 <update permission="MANAGE_RESERVES" global_required="true" />
3456                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3457                         </actions>
3458                 </permacrud>
3459         </class>
3460         
3461     <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">
3462         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3463             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3464             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3465             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3466             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3467         </fields>
3468         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3469             <actions>
3470                 <retrieve/>
3471             </actions>
3472         </permacrud>
3473     </class>
3474         <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">
3475                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3476                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3477                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3478                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3479                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3480                 </fields>
3481                 <links>
3482                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3483                 </links>
3484         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3485             <actions>
3486                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3487                 <retrieve/>
3488                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3489                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3490             </actions>
3491         </permacrud>
3492         </class>
3493         <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">
3494                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3495                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3496                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3497                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3498                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3499                 </fields>
3500                 <links>
3501                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3502                 </links>
3503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3504             <actions>
3505                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3506                 <retrieve/>
3507                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3508                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3509             </actions>
3510         </permacrud>
3511         </class>
3512         <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">
3513                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3514                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3515                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3516                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3517                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3518                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3519                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3520                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3521                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3522                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3523                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3524                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3525                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3526                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3527                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3528                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3529                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3530                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3531                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3532                 </fields>
3533                 <links>
3534                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3535                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3536                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3537                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3538                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3539                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3540                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3541                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3542                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3543                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3544                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3545                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3546                 </links>
3547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3548             <actions>
3549                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3550                 <retrieve/>
3551                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3552                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3553             </actions>
3554         </permacrud>
3555         </class>
3556         <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">
3557                 <fields oils_persist:primary="call_number">
3558                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3559                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3560                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3561                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3562                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3563                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3564                 </fields>
3565                 <links>
3566                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3567                 </links>
3568         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3569             <actions>
3570                 <retrieve/>
3571             </actions>
3572         </permacrud>
3573         </class>
3574         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3575                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3576                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3577                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3578                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3579                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3580                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3581                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3582                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3583                 </fields>
3584                 <links>
3585                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3586                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3587         </links>
3588         </class>
3589         <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">
3590                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3591                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3592                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3593                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3594                 </fields>
3595                 <links>
3596                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3597                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3598                 </links>
3599         </class>
3600         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3601                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3602                         <field name="id" reporter:datatype="id" />
3603                         <field name="value" oils_persist:i18n="true" />
3604                 </fields>
3605                 <links/>
3606         </class>
3607         <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">
3608                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3609                         <field name="balance_owed" reporter:datatype="money" />
3610                         <field name="total_owed" reporter:datatype="money" />
3611                         <field name="total_paid" reporter:datatype="money" />
3612                         <field name="usr" reporter:datatype="link"/>
3613                 </fields>
3614                 <links>
3615                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3616         </links>
3617         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3618             <actions>
3619                 <retrieve permission="VIEW_USER">
3620                     <context link="usr" field="home_ou"/>
3621                 </retrieve>
3622             </actions>
3623         </permacrud>
3624         </class>
3625         <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">
3626                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3627                         <field name="balance_owed" reporter:datatype="money" />
3628                         <field name="total_owed" reporter:datatype="money" />
3629                         <field name="total_paid" reporter:datatype="money" />
3630                         <field name="usr" reporter:datatype="link"/>
3631                 </fields>
3632                 <links>
3633                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3634         </links>
3635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3636             <actions>
3637                 <retrieve permission="VIEW_USER">
3638                     <context link="usr" field="home_ou"/>
3639                 </retrieve>
3640             </actions>
3641         </permacrud>
3642         </class>
3643         <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">
3644                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3645                         <field name="collector" />
3646                         <field name="enter_time" reporter:datatype="timestamp"/>
3647                         <field name="id" reporter:datatype="id" />
3648                         <field name="location" reporter:datatype="link"/>
3649                         <field name="usr" reporter:datatype="link"/>
3650                 </fields>
3651                 <links>
3652                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3653                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3654                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3655                 </links>
3656         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3657             <actions>
3658                 <create permission="money.collections_tracker.create" context_field="location"/>
3659                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3660                 <delete permission="money.collections_tracker.create" context_field="location"/>
3661             </actions>
3662         </permacrud>
3663         </class>
3664         <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">
3665                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3666                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3667                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3668                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3669                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3670                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3671                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3672                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3673                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3674                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3675                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3676                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3677                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3678                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3679                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3680                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3681                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3682                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3683                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3684                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3685                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3686                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3687                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3688                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3704                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3705                 </fields>
3706                 <links>
3707                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3708                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3709                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3710                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3711                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3712                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3713                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3714                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3715                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3716                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3717                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3718                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3719                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3720                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3721                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3722                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3723                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3724                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3725                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3726                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3727                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3728                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3729                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3730                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3731                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3732                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3733                 </links>
3734         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3735             <actions>
3736                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3737                 <retrieve/>
3738                 <update permission="UPDATE_MARC" global_required="true"/>
3739                 <!-- 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. -->
3740                 <delete permission="DELETE_RECORD" global_required="true"/>
3741             </actions>
3742         </permacrud>
3743         </class>
3744         <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">
3745                 <fields oils_persist:primary="id">
3746                         <field name="dow_0_close" />
3747                         <field name="dow_0_open" />
3748                         <field name="dow_1_close" />
3749                         <field name="dow_1_open" />
3750                         <field name="dow_2_close" />
3751                         <field name="dow_2_open" />
3752                         <field name="dow_3_close" />
3753                         <field name="dow_3_open" />
3754                         <field name="dow_4_close" />
3755                         <field name="dow_4_open" />
3756                         <field name="dow_5_close" />
3757                         <field name="dow_5_open" />
3758                         <field name="dow_6_close" />
3759                         <field name="dow_6_open" />
3760                         <field name="id" reporter:datatype="id" />
3761                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3762                 </fields>
3763                 <links>
3764                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3765                 </links>
3766         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3767             <actions>
3768                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3769                 <retrieve/>
3770                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3771                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3772             </actions>
3773         </permacrud>
3774         </class>
3775         <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">
3776                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3777                         <field name="id" reporter:datatype="id" />
3778                         <field name="record" reporter:datatype="link"/>
3779                         <field name="label" reporter:datatype="text"/>
3780                         <field name="label_sortkey" reporter:datatype="text"/>
3781                         <field name="deleted" reporter:datatype="bool"/>
3782                 </fields>
3783                 <links>
3784                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3785                 </links>
3786         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3787             <actions>
3788                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3789                 <retrieve/>
3790                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3791                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3792             </actions>
3793         </permacrud>
3794         </class>
3795         <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">
3796                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3797                         <field name="id" reporter:datatype="id" />
3798                         <field name="target_copy" reporter:datatype="link" />
3799                         <field name="part" reporter:datatype="link"/>
3800                 </fields>
3801                 <links>
3802                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3803                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3804                 </links>
3805         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3806             <actions>
3807                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3808                 <retrieve/>
3809                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3810                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3811             </actions>
3812         </permacrud>
3813         </class>
3814     <class  id="aecc"
3815             controller="open-ils.cstore open-ils.pcrud"
3816             oils_obj:fieldmapper="action::emergency_closing_circulation"
3817             oils_persist:tablename="action.emergency_closing_circulation"
3818             reporter:label="Emergency Closing Circulation Entry"
3819             oils_persist:readonly="true"
3820     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3821         <fields oils_persist:primary="id">
3822             <field name="id" reporter:datatype="id" />
3823             <field name="circulation" reporter:datatype="link" />
3824                         <field name="emergency_closing" reporter:datatype="link"/>
3825             <field name="original_due_date" reporter:datatype="timestamp" />
3826             <field name="process_time" reporter:datatype="timestamp" />
3827         </fields>
3828         <links>
3829             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3830             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3831         </links>
3832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3833             <actions>
3834                 <retrieve/>
3835             </actions>
3836         </permacrud>
3837     </class>
3838     <class  id="aecr"
3839             controller="open-ils.cstore open-ils.pcrud"
3840             oils_obj:fieldmapper="action::emergency_closing_reservation"
3841             oils_persist:tablename="action.emergency_closing_reservation"
3842             reporter:label="Emergency Closing Reservation Entry"
3843             oils_persist:readonly="true"
3844     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3845         <fields oils_persist:primary="id">
3846             <field name="id" reporter:datatype="id" />
3847             <field name="reservation" reporter:datatype="link" />
3848                         <field name="emergency_closing" reporter:datatype="link"/>
3849             <field name="original_end_time" reporter:datatype="timestamp" />
3850             <field name="process_time" reporter:datatype="timestamp" />
3851         </fields>
3852         <links>
3853             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3854             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3855         </links>
3856         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3857             <actions>
3858                 <retrieve/>
3859             </actions>
3860         </permacrud>
3861     </class>
3862     <class  id="aech"
3863             controller="open-ils.cstore open-ils.pcrud"
3864             oils_obj:fieldmapper="action::emergency_closing_hold"
3865             oils_persist:tablename="action.emergency_closing_hold"
3866             reporter:label="Emergency Closing Hold Entry"
3867             oils_persist:readonly="true"
3868     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3869         <fields oils_persist:primary="id">
3870             <field name="id" reporter:datatype="id" />
3871             <field name="hold" reporter:datatype="link" />
3872                         <field name="emergency_closing" reporter:datatype="link"/>
3873             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3874             <field name="process_time" reporter:datatype="timestamp" />
3875         </fields>
3876         <links>
3877             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3878             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3879         </links>
3880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3881             <actions>
3882                 <retrieve/>
3883             </actions>
3884         </permacrud>
3885     </class>
3886     <class  id="aecs"
3887             controller="open-ils.cstore open-ils.pcrud"
3888             oils_obj:fieldmapper="action::emergency_closing_status"
3889             oils_persist:tablename="action.emergency_closing_status"
3890             reporter:label="Emergency Closing Status"
3891             oils_persist:readonly="true"
3892     >
3893         <fields oils_persist:primary="id">
3894             <field name="id" reporter:datatype="id" />
3895             <field name="creator" reporter:datatype="link" />
3896             <field name="create_time" reporter:datatype="timestamp" />
3897             <field name="process_start_time" reporter:datatype="timestamp" />
3898             <field name="process_end_time" reporter:datatype="timestamp" />
3899             <field name="last_update_time" reporter:datatype="timestamp" />
3900             <field name="circulations" reporter:datatype="int" />
3901             <field name="circulations_complete" reporter:datatype="int" />
3902             <field name="reservations" reporter:datatype="int" />
3903             <field name="reservations_complete" reporter:datatype="int" />
3904             <field name="holds" reporter:datatype="int" />
3905             <field name="holds_complete" reporter:datatype="int" />
3906         </fields>
3907         <links>
3908             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3909         </links>
3910         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3911             <actions>
3912                 <retrieve/>
3913             </actions>
3914         </permacrud>
3915     </class>
3916     <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">
3917         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3918             <field name="id" reporter:datatype="id" />
3919             <field name="creator" reporter:datatype="link" />
3920             <field name="create_time" reporter:datatype="timestamp" />
3921             <field name="process_start_time" reporter:datatype="timestamp" />
3922             <field name="process_end_time" reporter:datatype="timestamp" />
3923             <field name="last_update_time" reporter:datatype="timestamp" />
3924             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3925             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3926             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3927             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3928             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3929         </fields>
3930         <links>
3931             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3932             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3933             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3934             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3935             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3936             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3937         </links>
3938         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3939             <actions>
3940                 <create permission="EMERGENCY_CLOSING">
3941                     <context link="closing" field="org_unit" />
3942                 </create>
3943                 <retrieve/>
3944                 <update permission="EMERGENCY_CLOSING">
3945                     <context link="closing" field="org_unit" />
3946                 </update>
3947                 <delete permission="EMERGENCY_CLOSING">
3948                     <context link="closing" field="org_unit" />
3949                 </delete>
3950             </actions>
3951         </permacrud>
3952     </class>
3953         <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">
3954                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3955                         <field name="close_end" reporter:datatype="timestamp" />
3956                         <field name="close_start" reporter:datatype="timestamp" />
3957                         <field name="id" reporter:datatype="id" />
3958                         <field name="org_unit" reporter:datatype="org_unit"/>
3959                         <field name="reason" reporter:datatype="text"/>
3960                         <field name="full_day" reporter:datatype="bool"/>
3961                         <field name="multi_day" reporter:datatype="bool"/>
3962                         <field name="emergency_closing" reporter:datatype="link"/>
3963                 </fields>
3964                 <links>
3965                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3966                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3967                 </links>
3968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3969             <actions>
3970                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3971                 <retrieve/>
3972                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3973                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3974             </actions>
3975         </permacrud>
3976         </class>
3977         <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">
3978                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3979                         <field name="extended" reporter:datatype="interval"/>
3980                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3981                         <field name="max_renewals" reporter:datatype="int" />
3982                         <field name="name" reporter:datatype="text"/>
3983                         <field name="normal" reporter:datatype="interval"/>
3984                         <field name="shrt" reporter:datatype="interval"/>
3985                         <field name="max_auto_renewals" reporter:datatype="int" />
3986                 </fields>
3987                 <links>
3988                 </links>
3989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3990             <actions>
3991                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3992                 <retrieve/>
3993                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3994                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3995             </actions>
3996         </permacrud>
3997         </class>
3998
3999         <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">
4000                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4001                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4002                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4003             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4004                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4005             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4006                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4007                                 reporter:datatype="link" config_field="true"/>
4008                 </fields>
4009                 <links>
4010             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4011                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4012                 </links>
4013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4014             <actions>
4015                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4016                 <retrieve/>
4017                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4018                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4019             </actions>
4020                 </permacrud>
4021         </class>
4022
4023         <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">
4024                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4025                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4026                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4027                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4028             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4029                 </fields>
4030                 <links>
4031                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4032                 </links>
4033                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4034             <actions>
4035                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4036                 <retrieve/>
4037                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4038                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4039             </actions>
4040                 </permacrud>
4041         </class>
4042
4043         <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">
4044                 <fields oils_persist:primary="id" oils_persist:sequence="">
4045                         <field name="balance_owed" reporter:datatype="money"/>
4046                         <field name="id" reporter:datatype="id" />
4047                         <field name="last_billing_note" reporter:datatype="text"/>
4048                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4049                         <field name="last_billing_type" reporter:datatype="text"/>
4050                         <field name="last_payment_note" reporter:datatype="text"/>
4051                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4052                         <field name="last_payment_type" reporter:datatype="text"/>
4053                         <field name="total_owed" reporter:datatype="money"/>
4054                         <field name="total_paid" reporter:datatype="money"/>
4055                         <field name="usr" reporter:datatype="link"/>
4056                         <field name="xact_finish" reporter:datatype="timestamp" />
4057                         <field name="xact_start" reporter:datatype="timestamp" />
4058                         <field name="xact_type" reporter:datatype="text"/>
4059                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4060                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4061                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4062                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4063                         <field name="billing_location" reporter:datatype="link"/>
4064                 </fields>
4065                 <links>
4066                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4067                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4068                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4069                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4070                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4071                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4072                 </links>
4073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4074                         <actions>
4075                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4076                                         <context link="usr" field="home_ou" />
4077                                 </retrieve>
4078                         </actions>
4079                 </permacrud>
4080         </class>
4081         <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">
4082                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4083                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4084                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4085                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4086                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4087                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4088                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4089                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4090                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4091                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4092                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4093                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4094                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4096                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4097                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4098                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4099                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4100                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4101                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4102                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4103                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4104                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4105                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4106                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4107                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4108                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4109                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4110                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4111                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4112                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4113                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4114                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4115                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4116                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4117                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4118                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4119                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4120                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4121                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4122                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4123                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4124                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4125                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4126                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4127                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4128                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4129                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4130                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4131                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4132                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4133                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4134                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4135                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4136                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4137                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4138                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4139                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4140                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4141                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4142                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4143                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4144                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4145                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4146                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4147                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4148                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4149                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4150                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4151                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4152                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4153                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4154                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4155             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4156                 </fields>
4157                 <links>
4158                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4159                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4160                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4161                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4162                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4163                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4164                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4165                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4166                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4167                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4168                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4169                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4170                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4171                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4172                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4173                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4174                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4175                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4176                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4177                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4178                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4179                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4180                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4181                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4182                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4183                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4184                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4185                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4186                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4187                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4188                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4189                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4190             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4191                 </links>
4192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4193                         <actions>
4194                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4195                         </actions>
4196                 </permacrud>
4197         </class>
4198         <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">
4199                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4200                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4201                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4202                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4203                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4204                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4205                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4206                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4207                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4208         </fields>
4209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4210                         <actions>
4211                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4212                                 <retrieve/>
4213                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4214                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4215                         </actions>
4216                 </permacrud>
4217         </class>
4218         <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">
4219                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4220                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4221                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4222                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4223                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4224         </fields>
4225         <links>
4226                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4227                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4228                 </links>
4229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4230                         <actions>
4231                                 <retrieve permission="RUN_REPORTS">
4232                                         <context link="usr" field="home_ou" />
4233                                 </retrieve>
4234                         </actions>
4235                 </permacrud>
4236         </class>
4237         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4238                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4239                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4240                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4241                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4242                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4243                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4244                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4245         </fields>
4246         <links>
4247                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4248                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4249                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4250                 </links>
4251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4252                         <actions>
4253                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4254                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4255                                         <context link="usr" field="home_ou" />
4256                                         <context link="ws" field="owning_lib" />
4257                                 </retrieve>
4258                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4259                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4260                         </actions>
4261                 </permacrud>
4262         </class>
4263         <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">
4264                 <fields oils_persist:primary="name">
4265                         <field name="name" reporter:datatype="text"/>
4266                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4267                 </fields>
4268                 <links/>
4269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4270                         <actions>
4271                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4272                                 <retrieve/>
4273                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4274                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4275                         </actions>
4276                 </permacrud>
4277         </class>
4278         <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">
4279                 <fields oils_persist:primary="name">
4280                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4281                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4282                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4283                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4284                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4285                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4286                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4287                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4288                 </fields>
4289                 <links>
4290                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4291                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4292                 </links>
4293                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4294                         <actions>
4295                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4296                                 <retrieve/>
4297                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4298                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4299                         </actions>
4300                 </permacrud>
4301         </class>
4302         <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">
4303                 <fields oils_persist:primary="name">
4304                         <field name="name" reporter:datatype="text"/>
4305                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4306                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4307                         <field name="datatype" reporter:datatype="text"/>
4308                         <field name="view_perm" reporter:datatype="link"/>
4309                         <field name="update_perm" reporter:datatype="link"/>
4310                         <field name="fm_class" reporter:datatype="text"/>
4311                         <field name="grp" reporter:datatype="link"/>
4312                 </fields>
4313                 <links>
4314                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4315                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4316                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4317                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4318                 </links>
4319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4320                         <actions>
4321                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4322                                 <retrieve/>
4323                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4324                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4325                         </actions>
4326                 </permacrud>
4327         </class>
4328         <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">
4329                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4330                         <field name="id" />
4331                         <field name="name"  reporter:datatype="text"/>
4332                         <field name="org_unit" reporter:datatype="org_unit"/>
4333                         <field name="value"  reporter:datatype="text"/>
4334                 </fields>
4335                 <links>
4336                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4337                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4338                 </links>
4339         </class>
4340         <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">
4341                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4342                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4343                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4344                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4345                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4346                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4347                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4348                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4349                 </fields>
4350                 <links>
4351                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4352                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4353                 </links>
4354         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4355             <actions>
4356                 <create permission="CREATE_COPY_NOTE">
4357                     <context link="owning_copy" field="circ_lib"/>
4358                 </create>
4359                 <retrieve permission="VIEW_COPY_NOTES">
4360                     <context link="owning_copy" field="circ_lib"/>
4361                 </retrieve>
4362                 <update permission="UPDATE_COPY_NOTE">
4363                     <context link="owning_copy" field="circ_lib"/>
4364                 </update>
4365                 <delete permission="DELETE_COPY_NOTE">
4366                     <context link="owning_copy" field="circ_lib"/>
4367                 </delete>
4368             </actions>
4369         </permacrud>
4370         </class>
4371         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4372                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4373                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4374                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4375                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4376                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4377                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4378                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4379                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4380                 </fields>
4381                 <links>
4382                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4383                 </links>
4384         </class>
4385         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4386                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4387                         <field name="fingerprint"  reporter:datatype="text"/>
4388                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4389                         <field name="master_record" reporter:datatype="link"/>
4390                         <field name="mods"  reporter:datatype="text"/>
4391                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4392                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4393                 </fields>
4394                 <links>
4395                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4396                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4397                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4398                 </links>
4399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4400                         <actions>
4401                                 <retrieve/>
4402                         </actions>
4403                 </permacrud>
4404         </class>
4405         <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">
4406                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4407                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4408                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4409                 </fields>
4410                 <links/>
4411         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4412             <actions>
4413                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4414                 <retrieve/>
4415                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4416                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4417             </actions>
4418         </permacrud>
4419         </class>
4420         <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">
4421                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4422                         <field name="code"  reporter:datatype="text"/>
4423                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4424                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4425                 </fields>
4426                 <links/>
4427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4428             <actions>
4429                 <create permission="CREATE_PERM" global_required="true"/>
4430                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4431                 <update permission="UPDATE_PERM" global_required="true"/>
4432                 <delete permission="DELETE_PERM" global_required="true"/>
4433             </actions>
4434         </permacrud>
4435         </class>
4436         <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">
4437                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4438                         <field name="id" reporter:datatype="id" />
4439                         <field name="metarecord" reporter:datatype="link"/>
4440                         <field name="source" reporter:datatype="link"/>
4441                 </fields>
4442                 <links>
4443                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4444                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4445                 </links>
4446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4447                         <actions>
4448                                 <retrieve/>
4449                         </actions>
4450                 </permacrud>
4451         </class>
4452         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4453                         oils_obj:fieldmapper="metabib::display_entry" 
4454                         oils_persist:tablename="metabib.display_entry" 
4455                         oils_persist:field_safe="true"
4456                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4457                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4458                         <field name="id" reporter:datatype="id" />
4459                         <field name="field" reporter:datatype="link"/>
4460                         <field name="source" reporter:datatype="link"/>
4461                         <field name="value"  reporter:datatype="text"/>
4462                         <field name="highlight" oils_persist:virtual="true"  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                 </links>
4468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4469                         <actions>
4470                                 <retrieve/>
4471                         </actions>
4472                 </permacrud>
4473         </class>
4474         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4475                 oils_persist:tablename="metabib.flat_display_entry"
4476                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4477                 oils_persist:field_safe="true"
4478                 reporter:label="Flat Display Entry" 
4479                 oils_persist:readonly="true">
4480                 <fields>
4481                         <field name="source" reporter:datatype="id" />
4482                         <field name="name" reporter:datatype="text"/>
4483                         <field name="multi" reporter:datatype="bool"/>
4484                         <field name="label" reporter:datatype="text"/>
4485                         <field name="field" reporter:datatype="link"/>
4486                         <field name="value" reporter:datatype="text"/>
4487                 </fields>
4488                 <links>
4489                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4490                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4491                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4492                 </links>
4493                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4494                         <actions>
4495                                 <retrieve/>
4496                         </actions>
4497                 </permacrud>
4498         </class>
4499         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4500                 oils_persist:tablename="metabib.compressed_display_entry"
4501                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4502                 oils_persist:field_safe="true"
4503                 reporter:label="Compressed Display Entry" 
4504                 oils_persist:readonly="true">
4505                 <fields>
4506                         <field name="source" reporter:datatype="id" />
4507                         <field name="name" reporter:datatype="text"/>
4508                         <field name="multi" reporter:datatype="bool"/>
4509                         <field name="label" reporter:datatype="text"/>
4510                         <field name="field" reporter:datatype="link"/>
4511                         <field name="value" reporter:datatype="text"/>
4512                 </fields>
4513                 <links>
4514                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4515                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4516                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4517                 </links>
4518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4519                         <actions>
4520                                 <retrieve/>
4521                         </actions>
4522                 </permacrud>
4523         </class>
4524         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4525                 oils_persist:tablename="metabib.wide_display_entry"
4526                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4527                 oils_persist:field_safe="true"
4528                 reporter:label="Wide Display Entry" 
4529                 oils_persist:readonly="true">
4530                 <fields oils_persist:primary="source">
4531                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4532                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4533                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4534                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4535                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4536                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4537                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4538                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4539                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4540                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4541                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4542                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4543                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4544                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4545                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4546                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4547                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4548                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4549                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4550                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4551                 </fields>
4552                 <links>
4553                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4554                 </links>
4555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4556                         <actions>
4557                                 <retrieve/>
4558                         </actions>
4559                 </permacrud>
4560         </class>
4561
4562         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4563                 oils_persist:tablename="config.display_field_map"
4564                 oils_obj:fieldmapper="config::display_field_map"
4565                 oils_persist:field_safe="true"
4566                 reporter:label="Display Field Map">
4567                 <fields oils_persist:primary="name">
4568                         <field name="name" reporter:datatype="text"/>
4569                         <field name="field" reporter:datatype="link"/>
4570                         <field name="multi" reporter:datatype="bool"/>
4571                 </fields>
4572                 <links>
4573                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4574                 </links>
4575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4576                         <actions>
4577                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4578                                 <retrieve/>
4579                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4580                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4581                         </actions>
4582                 </permacrud>
4583         </class>
4584
4585         <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">
4586                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4587                         <field name="id" reporter:datatype="id" />
4588                         <field name="field" reporter:datatype="link"/>
4589                         <field name="source" reporter:datatype="link"/>
4590                         <field name="value"  reporter:datatype="text"/>
4591                 </fields>
4592                 <links>
4593                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4594                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4595                 </links>
4596         </class>
4597         <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">
4598                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4599                         <field name="id" reporter:datatype="id" />
4600                         <field name="value" reporter:datatype="text"/>
4601                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4602                 </fields>
4603                 <links>
4604                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4605                 </links>
4606                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4607                         <actions>
4608                                 <retrieve/>
4609                         </actions>
4610                 </permacrud>
4611         </class>
4612         <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">
4613                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4614                         <field name="id" reporter:datatype="id" />
4615                         <field name="entry" reporter:datatype="link"/>
4616                         <field name="def" reporter:datatype="link"/>
4617                         <field name="source" reporter:datatype="link"/>
4618                 </fields>
4619                 <links>
4620                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4621                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4622                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4623                 </links>
4624         </class>
4625         <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">
4626                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4627                         <field name="id" reporter:datatype="id" />
4628                         <field name="entry" reporter:datatype="link"/>
4629                         <field name="simple_heading" reporter:datatype="link"/>
4630                 </fields>
4631                 <links>
4632                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4633                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4634                 </links>
4635         </class>
4636         <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">
4637                 <oils_persist:source_definition><![CDATA[
4638                         SELECT * FROM metabib.author_field_entry
4639                                                 UNION ALL
4640                         SELECT * FROM metabib.keyword_field_entry
4641                                                 UNION ALL
4642                         SELECT * FROM metabib.identifier_field_entry
4643                                                 UNION ALL
4644                         SELECT * FROM metabib.title_field_entry
4645                                                 UNION ALL
4646                         SELECT * FROM metabib.subject_field_entry
4647                                                 UNION ALL
4648                         SELECT * FROM metabib.series_field_entry
4649                 ]]></oils_persist:source_definition>
4650                 <fields>
4651                         <field name="field" reporter:datatype="link"/>
4652                         <field name="id" reporter:datatype="id" />
4653                         <field name="source" reporter:datatype="link"/>
4654                         <field name="value"  reporter:datatype="text"/>
4655                 </fields>
4656                 <links>
4657                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4658                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4659                 </links>
4660         </class>
4661         <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">
4662                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4663                         <field name="field" reporter:datatype="link"/>
4664                         <field name="id" reporter:datatype="id" />
4665                         <field name="source" reporter:datatype="link"/>
4666                         <field name="value"  reporter:datatype="text"/>
4667                 </fields>
4668                 <links>
4669                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4670                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4671                 </links>
4672         </class>
4673         <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">
4674                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4675                         <field name="accepting_usr" reporter:datatype="link"/>
4676                         <field name="amount" reporter:datatype="money" />
4677                         <field name="amount_collected" reporter:datatype="money" />
4678                         <field name="cash_drawer" reporter:datatype="link"/>
4679                         <field name="id" reporter:datatype="id" />
4680                         <field name="note"  reporter:datatype="text"/>
4681                         <field name="payment_ts" reporter:datatype="timestamp"/>
4682                         <field name="xact" reporter:datatype="link"/>
4683                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4684                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4685                 </fields>
4686                 <links>
4687                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4688                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4689                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4690                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4691                 </links>
4692         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4693             <actions>
4694                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4695                     <context link="xact" jump="usr" field="home_ou"/>
4696                 </retrieve>
4697                         </actions>
4698                 </permacrud>
4699         </class>
4700         <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">
4701                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4702                         <field name="accepting_usr" reporter:datatype="link"/>
4703                         <field name="amount" reporter:datatype="money" />
4704                         <field name="amount_collected" reporter:datatype="money" />
4705                         <field name="id" reporter:datatype="id" />
4706                         <field name="note"  reporter:datatype="text"/>
4707                         <field name="payment_ts" reporter:datatype="timestamp"/>
4708                         <field name="xact" reporter:datatype="link"/>
4709                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4710                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4711                 </fields>
4712                 <links>
4713                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4714                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4715                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4716                 </links>
4717         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4718             <actions>
4719                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4720                     <context link="xact" jump="usr" field="home_ou"/>
4721                 </retrieve>
4722                         </actions>
4723                 </permacrud>
4724         </class>
4725         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4726                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4727                         <field name="accepting_usr" reporter:datatype="link"/>
4728                         <field name="amount" reporter:datatype="money" />
4729                         <field name="amount_collected" reporter:datatype="money" />
4730                         <field name="id" reporter:datatype="id" />
4731                         <field name="note"  reporter:datatype="text"/>
4732                         <field name="payment_ts" reporter:datatype="timestamp"/>
4733                         <field name="xact" reporter:datatype="link"/>
4734                         <field name="billing" reporter:datatype="link"/>
4735                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4736                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4737                 </fields>
4738                 <links>
4739                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4740                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4741                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4742                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4743                 </links>
4744         </class>
4745         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4746                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4747                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4748                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4749                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4750                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4751                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4752                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4753                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4754                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4755                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4756                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4757                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4758                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4759                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4760                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4761                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4762                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4763                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4764                 </fields>
4765                 <links>
4766                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4767                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4768                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4769                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4770                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4771                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4772                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4773                 </links>
4774         </class>
4775
4776         <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">
4777                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4778                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4779                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4780                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4781                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4782                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4783                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4784                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4785                 </fields>
4786                 <links/>
4787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4788             <actions>
4789                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4790                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4791                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4792                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4793             </actions>
4794         </permacrud>
4795         </class>
4796         <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">
4797                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4798                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4799                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4800                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4801                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4802                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4803                 </fields>
4804                 <links>
4805                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4806                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4807                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4808         </links>
4809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4810             <actions>
4811                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4812                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4813                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4814                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4815             </actions>
4816         </permacrud>
4817         </class>
4818         <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">
4819                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4820                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4821                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4822                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4823                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4824             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4825             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4826             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4827             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4828                 </fields>
4829                 <links/>
4830         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4831             <actions>
4832                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4833                 <retrieve/>
4834                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4835                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4836             </actions>
4837         </permacrud>
4838         </class>
4839         <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">
4840                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4841                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4842                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4843                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4844                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4845                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4846                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4847                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4848                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4849                 </fields>
4850                 <links>
4851                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4852                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4853                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4854                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4855                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4856                 </links>
4857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4858                         <actions>
4859                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4860                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4861                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4862                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4863                         </actions>
4864                 </permacrud>
4865         </class>
4866         <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">
4867                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4868                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4869                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4870                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4871                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4872                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4873                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4874                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4875                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4876                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4877                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4878                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4879                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4880                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4881                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4882                 </fields>
4883                 <links>
4884                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4885                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4886                 </links>
4887                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4888                         <actions>
4889                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4890                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4891                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4892                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4893                         </actions>
4894                 </permacrud>
4895         </class>
4896         <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">
4897                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4898                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4899                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4900                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4901                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4902                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4903                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4904                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4905                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4906                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4907                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4908                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4909                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4910                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4911                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4912                 </fields>
4913                 <links>
4914                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4915                 </links>
4916                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4917                         <actions>
4918                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4919                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4920                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4921                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4922                         </actions>
4923                 </permacrud>
4924         </class>
4925
4926
4927         <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">
4928                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4929                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4930                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4931                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4932                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4933                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4934                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4935                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4936                 </fields>
4937                 <links>
4938                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4939                 </links>
4940         </class>
4941
4942         <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">
4943                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4944                         <field name="call_number" />
4945                         <field name="create_date" reporter:datatype="timestamp"/>
4946                         <field name="creator" reporter:datatype="link"/>
4947                         <field name="id" reporter:datatype="id" />
4948                         <field name="pub" reporter:datatype="bool"/>
4949                         <field name="title"  reporter:datatype="text"/>
4950                         <field name="value"  reporter:datatype="text"/>
4951                 </fields>
4952                 <links>
4953                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4954                 </links>
4955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4956             <actions>
4957                 <create permission="CREATE_VOLUME_NOTE">
4958                     <context link="call_number" field="owning_lib"/>
4959                 </create>
4960                 <retrieve permission="VIEW_VOLUME_NOTES">
4961                     <context link="call_number" field="owning_lib"/>
4962                 </retrieve>
4963                 <update permission="UPDATE_VOLUME_NOTE">
4964                     <context link="call_number" field="owning_lib"/>
4965                 </update>
4966                 <delete permission="DELETE_VOLUME_NOTE">
4967                     <context link="call_number" field="owning_lib"/>
4968                 </delete>
4969             </actions>
4970         </permacrud>
4971         </class>
4972         <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">
4973                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4974                         <field name="create_date" reporter:datatype="timestamp"/>
4975                         <field name="creator" reporter:datatype="link"/>
4976                         <field name="edit_date" reporter:datatype="timestamp"/>
4977                         <field name="editor" reporter:datatype="link"/>
4978                         <field name="id" reporter:datatype="id" />
4979                         <field name="record" reporter:datatype="link"/>
4980                         <field name="value" reporter:datatype="text"/>
4981                 </fields>
4982                 <links>
4983                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4984                 </links>
4985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4986             <actions>
4987                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4988                 <retrieve/>
4989                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4990                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4991             </actions>
4992         </permacrud>
4993         </class>
4994         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4995         <oils_persist:source_definition><![CDATA[
4996 SELECT  usr,
4997         SUM(
4998             CASE
4999                 WHEN (
5000                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5001                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5002                 ) THEN 1
5003                 ELSE 0
5004             END
5005         ) AS out,
5006
5007         SUM(
5008             CASE
5009                 WHEN (
5010                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5011                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5012                 ) THEN 1
5013                 ELSE 0
5014             END
5015         ) AS overdue,
5016
5017         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5018         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5019         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5020   FROM  action.circulation
5021   WHERE checkin_time IS NULL
5022   GROUP BY 1
5023         ]]></oils_persist:source_definition>
5024         <fields oils_persist:primary="usr">
5025             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5026             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5027             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5028             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5029             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5030             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5031         </fields>
5032         <links>
5033             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5034         </links>
5035         </class>
5036         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5037         <oils_persist:source_definition><![CDATA[
5038 SELECT  usr,
5039         STRING_AGG(
5040             CASE
5041                 WHEN (
5042                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5043                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5044                 ) THEN id::TEXT
5045                 ELSE '0'
5046             END
5047         ,',') AS out,
5048
5049         STRING_AGG(
5050             CASE
5051                 WHEN (
5052                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5053                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5054                 ) THEN id::TEXT
5055                 ELSE '0'
5056             END
5057         ,',') AS overdue,
5058
5059         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5060         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5061         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5062   FROM  action.circulation
5063   WHERE checkin_time IS NULL
5064   GROUP BY 1
5065         ]]></oils_persist:source_definition>
5066         <fields oils_persist:primary="usr">
5067             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5068             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5069             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5070             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5071             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5072             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5073         </fields>
5074         <links>
5075             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5076         </links>
5077         </class>
5078         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5079                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5080                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5081                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5082                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5083                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5084                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5085                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5086                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5087                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5088                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5089                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5090                 </fields>
5091                 <links>
5092                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5093                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5094                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5095                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5096                 </links>
5097         </class>
5098         <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">
5099                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5100                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5101                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5102                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5103                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5104                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5105                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5106                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5107                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5108                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5109                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5110                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5111                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5112                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5113                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5114                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5115                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5116                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5117                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5118                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5119                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5120                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5121                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5122                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5123                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5124                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5125                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5126                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5127                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5128                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5129                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5130                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5131                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5132                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5133                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5134                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5135                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5136                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5137                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5138                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5139                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5140                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5141                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5142                 </fields>
5143                 <links>
5144                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5145                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5146                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5147                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5148                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5149                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5150                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5151                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5152                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5153                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5154                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5155                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5156                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5157                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5158                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5159                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5160                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5161                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5162                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5163                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5164                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5165                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5166                 </links>
5167                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5168                         <actions>
5169                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5170                         </actions>
5171                 </permacrud>
5172         </class>
5173         <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">
5174                 <fields>
5175                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5176                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5177                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5178                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5179                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5180                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5181                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5182                 </fields>
5183                 <links>
5184                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5185                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5186                 </links>
5187                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5188                         <actions>
5189                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5190                         </actions>
5191                 </permacrud>
5192         </class>
5193         <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">
5194                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5195                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5196                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5197                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5198                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5199                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5200                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5201                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5202                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5203                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5204                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5205                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5206                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5207                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5208                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5209                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5210                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5211                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5212                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5213                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5214                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5215                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5217                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5218                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5219                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5220                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5221                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5222                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5223                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5224                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5225                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5226                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5227                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5228                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5229                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5230                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5231                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5232                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5233                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5234                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5235                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5236                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5237                 </fields>
5238                 <links>
5239                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5240                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5241                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5242                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5243                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5244                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5245                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5246                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5247                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5248                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5249                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5250                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5251                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5252                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5253                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5254                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5255                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5256                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5257                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5258                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5259                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5260                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5261                 </links>
5262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5263                         <actions>
5264                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5265                         </actions>
5266                 </permacrud>
5267         </class>
5268
5269         <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">
5270                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5271                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5272                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5273                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5274                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5275                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5276                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5277                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5278                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5279                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5280                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5281                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5282                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5283                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5284                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5285                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5286                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5287                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5288                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5289                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5290                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5291                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5292                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5293                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5294                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5295                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5296                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5297                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5298                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5299                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5300                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5301                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5302                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5303                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5304                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5305                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5306                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5307                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5308                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5309                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5310                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5311                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5312                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5313                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5314                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5315                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5316                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5317                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5318                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5319                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5320                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5321                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5322                 </fields>
5323                 <links>
5324                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5325                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5326                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5327                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5328                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5329                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5330                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5331                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5332                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5333                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5334                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5335                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5336                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5337                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5338                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5339                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5340                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5341                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5342                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5343                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5344                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5345                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5346                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5347                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5348                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5349                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5350                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5351                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5352                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5353                 </links>
5354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5355                         <actions>
5356                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5357                         </actions>
5358                 </permacrud>
5359         </class>
5360         <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">
5361                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5362                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5363                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5364                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5365                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5366                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5367                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5368                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5369                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5370                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5371                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5372                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5373                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5374                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5375                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5376                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5377                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5378                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5379                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5380                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5381                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5382                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5383                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5384                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5385                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5386                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5387                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5388                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5389                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5390                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5391                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5392                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5393                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5394                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5395                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5396                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5397                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5398                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5399                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5400                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5401                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5402                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5403                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5404                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5405                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5406                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5407                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5408                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5409                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5410                 </fields>
5411                 <links>
5412                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5413                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5414                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5415                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5416                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5417                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5418                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5419                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5420                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5421                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5422                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5423                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5424                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5425                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5426                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5427                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5428                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5429                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5430                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5431                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5432                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5433                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5434                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5435                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5436                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5437                 </links>
5438         </class>
5439         <class id="auch" 
5440                 controller="open-ils.cstore" 
5441                 oils_obj:fieldmapper="action::user_circ_history" 
5442                 oils_persist:tablename="action.usr_circ_history" 
5443                 reporter:label="User Checkout History">
5444                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5445                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5446                         <!-- prevent reporting on the user that owns the checkout history -->
5447                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5448                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5449                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5450                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5451                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5452                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5453                 </fields>
5454                 <links>
5455                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5456                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5457                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5458                 </links>
5459         </class>
5460         <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">
5461                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5462                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5463                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5464                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5465                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5466                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5467                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5468                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5469                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5470                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5471                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5472                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5473                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5474                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5475                 </fields>
5476                 <links>
5477                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5478                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5479                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5480                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5481                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5482                 </links>
5483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5484                         <actions>
5485                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5486                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5487                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5488                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5489                         </actions>
5490                 </permacrud>
5491         </class>
5492
5493         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5494                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5495                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5496                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5497                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5498                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5499                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5500                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5501                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5502                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5503                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5504                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5505                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5506                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5507                 </fields>
5508                 <links>
5509                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5510                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5511                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5512                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5513                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5514                 </links>
5515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5516                         <actions>
5517                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5518                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5519                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5520                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5521                         </actions>
5522                 </permacrud>
5523         </class>
5524         
5525         <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">
5526                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5527                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5528                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5529                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5530                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5531                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5532                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5533                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5534                 </fields>
5535                 <links>
5536                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5537                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5538                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5539                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5540                 </links>
5541                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5542                         <actions>
5543                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5544                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5545                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5546                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5547                         </actions>
5548                 </permacrud>
5549         </class>
5550         
5551         <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">
5552                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5553                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5554                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5555                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5556                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5557                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5558                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5559                 </fields>
5560                 <links>
5561                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5562                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5563                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5564                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5565                 </links>
5566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5567                         <actions>
5568                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5569                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5570                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5571                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5572                         </actions>
5573                 </permacrud>
5574         </class>
5575         
5576         <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">
5577                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5578                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5579                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5580                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5581                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5582                 </fields>
5583                 <links>
5584                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5585                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5586                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5587                 </links>
5588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5589                         <actions>
5590                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5591                     <context link="resource" field="owner" />
5592                 </create>
5593                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5594                     <context link="resource" field="owner" />
5595                 </retrieve>
5596                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5597                     <context link="resource" field="owner" />
5598                 </update>
5599                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5600                     <context link="resource" field="owner" />
5601                 </delete>
5602                         </actions>
5603                 </permacrud>
5604         </class>
5605         
5606         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5607                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5608                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5609                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5610                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5611                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5612                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5613                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5614                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5615                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5616                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5617                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5618                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5619                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5620                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5621                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5622                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5623                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5624                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5625                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5626                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5627                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5628                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5629                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5630                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5631                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5632                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5633                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5634                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5635                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5636                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5637                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5638                 </fields>
5639                 <links>
5640                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5641                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5642                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5643                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5644                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5645                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5646                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5647                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5648                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5649                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5650                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5651                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5652                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5653                 </links>
5654                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5655                         <actions>
5656                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5657                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5658                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5659                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5660                         </actions>
5661                 </permacrud>
5662         </class>
5663         
5664         <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">
5665                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5666                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5667                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5668                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5669                 </fields>
5670                 <links>
5671                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5672                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5673                 </links>
5674                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5675                         <actions>
5676                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5677                                         <context link="reservation" field="pickup_lib"/>
5678                                 </create>
5679                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5680                                         <context link="reservation" field="pickup_lib"/>
5681                                 </retrieve>
5682                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5683                                         <context link="reservation" field="pickup_lib"/>
5684                                 </update>
5685                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5686                                         <context link="reservation" field="pickup_lib"/>
5687                                 </delete>
5688                         </actions>
5689                 </permacrud>
5690         </class>
5691
5692         <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">
5693                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5694                         <field name="bucket" reporter:datatype="link"/>
5695                         <field name="id" reporter:datatype="id" />
5696                         <field name="target_call_number" reporter:datatype="link" />
5697                         <field name="create_time" reporter:datatype="timestamp" />
5698                         <field name="pos" reporter:datatype="int" />
5699                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5700                 </fields>
5701                 <links>
5702                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5703                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5704             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5705                 </links>
5706                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5707                         <actions>
5708                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5709                     <context link="bucket" field="owning_lib"/>
5710                 </retrieve>
5711             </actions>
5712         </permacrud>
5713         </class>
5714         <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">
5715                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5716                         <field name="id" reporter:datatype="id" />
5717                         <field name="item" reporter:datatype="link"/>
5718                         <field name="note" reporter:datatype="text" />
5719                 </fields>
5720                 <links>
5721                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5722                 </links>
5723         </class>
5724         <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">
5725                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5726                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5727                         <field name="btype" reporter:datatype="text"/>
5728                         <field name="id" reporter:datatype="id" />
5729                         <field name="name" reporter:datatype="text"/>
5730                         <field name="description" reporter:datatype="text"/>
5731                         <field name="owner" reporter:datatype="link"/>
5732                         <field name="pub" reporter:datatype="bool"/>
5733                         <field name="create_time" reporter:datatype="timestamp" />
5734                         <field name="owning_lib" reporter:datatype="org_unit" />
5735                 </fields>
5736                 <links>
5737                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5738                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5739                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5740                 </links>
5741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5742                         <actions>
5743                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5744                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5745                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5746                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5747                         </actions>
5748                 </permacrud>
5749         </class>
5750         <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">
5751                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5752                         <field name="id" reporter:datatype="id" />
5753                         <field name="bucket" reporter:datatype="link"/>
5754                         <field name="note" reporter:datatype="text" />
5755                 </fields>
5756                 <links>
5757                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5758                 </links>
5759         </class>
5760         <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">
5761                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5762                         <field name="hold" reporter:datatype="link"/>
5763                         <field name="id" reporter:datatype="id" />
5764                         <field name="target_copy" reporter:datatype="link"/>
5765                         <field name="proximity" reporter:datatype="number"/>
5766                 </fields>
5767                 <links>
5768                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5769                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5770                 </links>
5771         </class>
5772         <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">
5773                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5774                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5775                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5776                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5777                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5778                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5779                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5780                 </fields>
5781                 <links>
5782                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5783                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5784                 </links>
5785         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5786             <actions>
5787                 <create permission="CREATE_HOLD_NOTIFICATION">
5788                                         <context link="hold" jump="usr" field="home_ou" />
5789                                 </create>
5790                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5791                                         <context link="hold" jump="usr" field="home_ou" />
5792                                 </retrieve>
5793                 <update permission="CREATE_HOLD_NOTIFICATION">
5794                                         <context link="hold" jump="usr" field="home_ou" />
5795                                 </update>
5796                 <delete permission="CREATE_HOLD_NOTIFICATION">
5797                                         <context link="hold" jump="usr" field="home_ou" />
5798                                 </delete>
5799             </actions>
5800         </permacrud>
5801         </class>
5802         <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">
5803                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5804                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5805                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5806                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5807                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5808                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5809                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5810                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5811                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5812                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5813                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5814                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5815                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5816                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5817                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5818                 </fields>
5819                 <links>
5820                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5821                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5822                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5823                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5824                 </links>
5825         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5826             <actions>
5827                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5828                 <retrieve/>
5829                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5830                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5831             </actions>
5832         </permacrud>
5833         </class>
5834         <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">
5835                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5836                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5837                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5838                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5839                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5840             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5841             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5842             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5843                 </fields>
5844                 <links>
5845                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5846                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5847                 </links>
5848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5849             <actions>
5850                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5851                 <retrieve/>
5852                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5853                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5854             </actions>
5855         </permacrud>
5856         </class>
5857         <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">
5858                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5859                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5860             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5861             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5862                 </fields>
5863                 <links>
5864                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5865                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5866                 </links>
5867         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5868             <actions>
5869                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5870                                         <context link="lgroup" field="owner" />
5871                 </create>
5872                 <retrieve/>
5873                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5874                                         <context link="lgroup" field="owner" />
5875                 </update>
5876                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5877                                         <context link="lgroup" field="owner" />
5878                 </delete>
5879             </actions>
5880         </permacrud>
5881         </class>
5882
5883     <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">
5884         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5885             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5886             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5887             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5888             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5889         </fields>
5890         <links>
5891             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5892             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5893         </links>
5894         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5895             <actions>
5896                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5897                 <retrieve/>
5898                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5899                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5900             </actions>
5901         </permacrud>
5902     </class>
5903
5904         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5905                 <fields>
5906                         <field name="sre_id" oils_persist:virtual="true" />
5907                         <field name="location" oils_persist:virtual="true" />
5908                         <field name="owning_lib" oils_persist:virtual="true" />
5909                         <field name="basic_holdings" oils_persist:virtual="true" />
5910                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5911                         <field name="supplement_holdings" oils_persist:virtual="true" />
5912                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5913                         <field name="index_holdings" oils_persist:virtual="true" />
5914                         <field name="index_holdings_add" oils_persist:virtual="true" />
5915                         <field name="online" oils_persist:virtual="true" />
5916                         <field name="missing" oils_persist:virtual="true" />
5917                         <field name="incomplete" oils_persist:virtual="true" />
5918                 </fields>
5919         </class>
5920
5921         <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">
5922                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5923                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5924                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5925                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5926                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5927                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5928                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5929                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5930                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5931                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5932                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5933                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5934                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5935                 </fields>
5936                 <links>
5937                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5938                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5939                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5940                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5941                 </links>
5942                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5943                         <actions>
5944                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5945                                 <retrieve/>
5946                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5947                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5948                         </actions>
5949                 </permacrud>
5950         </class>
5951
5952         <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">
5953                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5954                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5955                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5956                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5957                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5958                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5959                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5960                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5961                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5962                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5963                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5964                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5965                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5966                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5967                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5968                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5969                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5970                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5971                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5972                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5973                 </fields>
5974                 <links>
5975                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5976                 </links>
5977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5978                         <actions>
5979                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5980                                         <context link="subscription" field="owning_lib" />
5981                                 </create>
5982                                 <retrieve />
5983                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5984                                         <context link="subscription" field="owning_lib" />
5985                                 </update>
5986                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5987                                         <context link="subscription" field="owning_lib" />
5988                                 </delete>
5989                         </actions>
5990                 </permacrud>
5991         </class>
5992
5993         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5994                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5995                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5996                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5997                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5998                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5999                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6000                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6001                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6002                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6003                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6004                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6005                 </fields>
6006                 <links>
6007                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6008                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6009                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6010                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6011                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6012                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6013                 </links>
6014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6015                         <actions>
6016                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6017                                 <retrieve />
6018                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6019                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6020                         </actions>
6021                 </permacrud>
6022         </class>
6023
6024         <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">
6025                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6026                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6027                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6028                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6029                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6030                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6031                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6032                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6033                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6034                 </fields>
6035                 <links>
6036                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6037                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6038                 </links>
6039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6040                         <actions>
6041                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6042                     <context link="subscription" field="owning_lib"/>
6043                 </create>
6044                                 <retrieve />
6045                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6046                     <context link="subscription" field="owning_lib"/>
6047                 </update>
6048                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6049                     <context link="subscription" field="owning_lib"/>
6050                 </delete>
6051                         </actions>
6052                 </permacrud>
6053         </class>
6054
6055         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6056                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6057                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6058                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6059                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6060                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6061                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6062                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6063                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6064                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6065                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6066                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6067                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6068                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6069                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6070                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6071                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6072                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6073                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6074                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6075                 </fields>
6076                 <links>
6077                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6078                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6079                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6080                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6081                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6082                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6083                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6084                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6085                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6086                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6087                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6088                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6089                 </links>
6090                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6091                         <actions>
6092                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6093                                 <retrieve />
6094                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6095                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6096                         </actions>
6097                 </permacrud>
6098         </class>
6099
6100         <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">
6101                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6102                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6103                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6104                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6105                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6106                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6107                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6108                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6109                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6110                 </fields>
6111                 <links>
6112                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6113                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6114                 </links>
6115                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6116                         <actions>
6117                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6118                                         <context link="distribution" field="holding_lib" />
6119                                 </create>
6120                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6121                                         <context link="distribution" field="holding_lib" />
6122                                 </retrieve>
6123                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6124                                         <context link="distribution" field="holding_lib" />
6125                                 </update>
6126                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6127                                         <context link="distribution" field="holding_lib" />
6128                                 </delete>
6129                         </actions>
6130                 </permacrud>
6131         </class>
6132
6133         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6134                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6135                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6136                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6137                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6138                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6139                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6140                 </fields>
6141                 <links>
6142                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6143                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6144                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6145                 </links>
6146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6147                         <actions>
6148                                 <create permission="ADMIN_SERIAL_STREAM">
6149                                         <context link="distribution" field="holding_lib" />
6150                                 </create>
6151                                 <retrieve />
6152                                 <update permission="ADMIN_SERIAL_STREAM">
6153                                         <context link="distribution" field="holding_lib" />
6154                                 </update>
6155                                 <delete permission="ADMIN_SERIAL_STREAM">
6156                                         <context link="distribution" field="holding_lib" />
6157                                 </delete>
6158                         </actions>
6159                 </permacrud>
6160         </class>
6161
6162         <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">
6163                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6164                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6165                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6166                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6167                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6168                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6169                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6170                 </fields>
6171                 <links>
6172                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6173                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6174                 </links>
6175                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6176                         <actions>
6177                                 <create permission="ADMIN_SERIAL_STREAM">
6178                                         <context link="stream" jump="distribution" field="holding_lib" />
6179                                 </create>
6180                                 <retrieve permission="RECEIVE_SERIAL">
6181                                         <context link="stream" jump="distribution" field="holding_lib" />
6182                                 </retrieve>
6183                                 <update permission="ADMIN_SERIAL_STREAM">
6184                                         <context link="stream" jump="distribution" field="holding_lib" />
6185                                 </update>
6186                                 <delete permission="ADMIN_SERIAL_STREAM">
6187                                         <context link="stream" jump="distribution" field="holding_lib" />
6188                                 </delete>
6189                         </actions>
6190                 </permacrud>
6191         </class>
6192
6193         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6194                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6195                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6196                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6197                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6198                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6199                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6200                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6201                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6202                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6203                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6204                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6205                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6206                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6207                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6208                 </fields>
6209                 <links>
6210                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6211                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6212                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6213                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6214                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6215                 </links>
6216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6217                         <actions>
6218                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6219                                         <context link="subscription" field="owning_lib" />
6220                                 </create>
6221                                 <retrieve/>
6222                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6223                                         <context link="subscription" field="owning_lib" />
6224                                 </update>
6225                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6226                                         <context link="subscription" field="owning_lib" />
6227                                 </delete>
6228                         </actions>
6229                 </permacrud>
6230         </class>
6231
6232         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6233                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6234                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6235                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6236                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6237                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6238                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6239                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6240                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6241                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6242                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6243                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6244                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6245                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6246                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6247                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6248                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6249                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6250                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6251                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6252                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6253                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6255                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6256                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6257                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6258                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6259                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6260                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6261                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6262                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6263                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6264                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6265                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6266                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6267                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6268                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6269                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6270                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6271                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6272                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6273                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6274                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6275                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6276                 </fields>
6277                 <links>
6278                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6279                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6280                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6281                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6282                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6283                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6284                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6285                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6286                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6287                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6288                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6289                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6290                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6291                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6292                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6293                 </links>
6294                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6295                         <actions>
6296                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6297                                 <retrieve/>
6298                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6299                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6300                         </actions>
6301                 </permacrud>
6302         </class>
6303
6304         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6305                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6306                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6307                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6308                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6309                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6310                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6311                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6312                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6313                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6314                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6315                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6316                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6317                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6318                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6319                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6320                 </fields>
6321                 <links>
6322                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6323                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6324                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6325                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6326                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6327                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6328                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6329                 </links>
6330                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6331                         <actions>
6332                                 <create permission="ADMIN_SERIAL_ITEM">
6333                                         <context link="stream" jump="distribution" field="holding_lib" />
6334                                 </create>
6335                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6336                                         <context link="stream" jump="distribution" field="holding_lib" />
6337                                 </retrieve>
6338                                 <update permission="ADMIN_SERIAL_ITEM">
6339                                         <context link="stream" jump="distribution" field="holding_lib" />
6340                                 </update>
6341                                 <delete permission="ADMIN_SERIAL_ITEM">
6342                                         <context link="stream" jump="distribution" field="holding_lib" />
6343                                 </delete>
6344                         </actions>
6345                 </permacrud>
6346         </class>
6347
6348         <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">
6349                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6350                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6351                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6352                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6353                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6354                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6355                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6356                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6357                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6358                 </fields>
6359                 <links>
6360                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6361                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6362                 </links>
6363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6364                         <actions>
6365                                 <create permission="ADMIN_SERIAL_ITEM">
6366                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6367                                 </create>
6368                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6369                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6370                                 </retrieve>
6371                                 <update permission="ADMIN_SERIAL_ITEM">
6372                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6373                                 </update>
6374                                 <delete permission="ADMIN_SERIAL_ITEM">
6375                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6376                                 </delete>
6377                         </actions>
6378                 </permacrud>
6379         </class>
6380         <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">
6381                 <fields>
6382                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6383                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6384                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6385                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6386                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6387                 </fields>
6388                 <links>
6389                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6390                 </links>
6391         </class>
6392         <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">
6393                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6394                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6395                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6396                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6397                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6398                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6399                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6400                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6401                 </fields>
6402                 <links>
6403                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6404                 </links>
6405         </class>
6406         <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">
6407                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6408                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6409                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6410                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6411                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6412                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6413                 </fields>
6414                 <links>
6415                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6416                 </links>
6417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6418                         <actions>
6419                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6420                                         <context link="distribution" field="holding_lib" />
6421                                 </create>
6422                                 <retrieve/>
6423                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6424                                         <context link="distribution" field="holding_lib" />
6425                                 </update>
6426                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6427                                         <context link="distribution" field="holding_lib" />
6428                                 </delete>
6429                         </actions>
6430                 </permacrud>
6431         </class>
6432
6433         <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">
6434                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6435                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6436                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6437                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6438                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6439                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6440                 </fields>
6441                 <links>
6442                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6443                 </links>
6444                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6445                         <actions>
6446                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6447                                         <context link="distribution" field="holding_lib" />
6448                                 </create>
6449                                 <retrieve/>
6450                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6451                                         <context link="distribution" field="holding_lib" />
6452                                 </update>
6453                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6454                                         <context link="distribution" field="holding_lib" />
6455                                 </delete>
6456                         </actions>
6457                 </permacrud>
6458         </class>
6459
6460         <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">
6461                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6462                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6463                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6464                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6465                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6466                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6467                 </fields>
6468                 <links>
6469                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6470                 </links>
6471                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6472                         <actions>
6473                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6474                                         <context link="distribution" field="holding_lib" />
6475                                 </create>
6476                                 <retrieve/>
6477                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6478                                         <context link="distribution" field="holding_lib" />
6479                                 </update>
6480                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6481                                         <context link="distribution" field="holding_lib" />
6482                                 </delete>
6483                         </actions>
6484                 </permacrud>
6485         </class>
6486
6487         <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">
6488                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6489                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6490                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6491                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6492                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6493                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6494                 </fields>
6495                 <links>
6496                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6497                 </links>
6498                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6499                         <actions>
6500                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6501                                 <retrieve/>
6502                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6503                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6504                         </actions>
6505                 </permacrud>
6506         </class>
6507
6508         <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">
6509                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6510                         <field name="id" reporter:datatype="id" />
6511                         <field name="owning_copy" reporter:datatype="link"/>
6512                         <field name="stat_cat" reporter:datatype="link"/>
6513                         <field name="stat_cat_entry" reporter:datatype="link"/>
6514                 </fields>
6515                 <links>
6516                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6517                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6518                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6519                 </links>
6520                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6521                         <actions>
6522                                 <retrieve/>
6523                         </actions>
6524                 </permacrud>
6525         </class>
6526         <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">
6527                 <fields oils_persist:primary="code">
6528                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6529                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6530                 </fields>
6531                 <links/>
6532         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6533             <actions>
6534                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6535                 <retrieve/>
6536                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6537                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6538             </actions>
6539         </permacrud>
6540         </class>
6541         <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">
6542                 <fields oils_persist:primary="code">
6543                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6544                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6545                 </fields>
6546                 <links/>
6547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6548             <actions>
6549                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6550                 <retrieve/>
6551                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6552                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6553             </actions>
6554         </permacrud>
6555         </class>
6556         <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">
6557                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6558                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6559                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6560                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6561                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6562                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6563                 </fields>
6564                 <links>
6565             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6566         </links>
6567         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6568             <actions>
6569                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6570                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6571                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6572                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6573             </actions>
6574         </permacrud>
6575         </class>
6576         <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">
6577                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6578                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6579                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6580                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6581                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6582                 </fields>
6583                 <links>
6584                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6585         </links>
6586         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6587             <actions>
6588                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6589                 <retrieve/>
6590                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6591                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6592             </actions>
6593         </permacrud>
6594         </class>
6595         <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">
6596                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6597                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6598                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6599                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6600                 </fields>
6601                 <links>
6602                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6603                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6604                 </links>
6605         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6606             <actions>
6607                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6608                 <retrieve/>
6609                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6610                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6611             </actions>
6612         </permacrud>
6613         </class>
6614         <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">
6615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6616                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6617                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6618                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6619                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6620                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6621                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6622                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6623                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6624                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6625                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6626                 </fields>
6627                 <links>
6628                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6629                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6630                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6631                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6632                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6633                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6634                 </links>
6635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6636             <actions>
6637                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6638                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6639                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6640                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6641             </actions>
6642         </permacrud>
6643         </class>
6644         <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">
6645                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6646                         <field name="id" reporter:datatype="id" />
6647                         <field name="from_org" reporter:datatype="org_unit"/>
6648                         <field name="to_org" reporter:datatype="org_unit"/>
6649                         <field name="prox" reporter:datatype="int" />
6650                 </fields>
6651                 <links>
6652                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6653                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6654                 </links>
6655         </class>
6656         <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">
6657                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6658                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6659                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6660                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6661                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6662                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6663                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6664                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6665                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6666                 </fields>
6667                 <links/>
6668         </class>
6669         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6670                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6671                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6672                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6673                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6674                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6675                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6676                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6677                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6678                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6679                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6680                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6681                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6682                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6683                 </fields>
6684                 <links>
6685                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6686                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6687                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6688                 </links>
6689         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6690             <actions>
6691                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6692                 <retrieve/>
6693                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6694                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6695             </actions>
6696         </permacrud>
6697         </class>
6698         <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">
6699                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6700                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6701                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6702                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6703                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6704                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6705                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6706                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6707                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6708                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6709                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6710                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6711                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6712                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6713                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6714                 </fields>
6715                 <links>
6716                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6717                 </links>
6718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6719             <actions>
6720                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6721                 <retrieve/>
6722                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6723                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6724             </actions>
6725         </permacrud>
6726         </class>
6727         <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">
6728                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6729                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6730                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6731                         <field name="query_text" reporter:datatype="text"/>
6732                 </fields>
6733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6734             <actions>
6735                 <retrieve/>
6736             </actions>
6737         </permacrud>
6738         </class>
6739
6740         <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">
6741                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6742                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6743                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6744                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6745                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6746                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6747                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6748                 </fields>
6749                 <links>
6750                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6751                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6752                 </links>
6753         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6754             <actions>
6755                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6756                 <retrieve/>
6757                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6758                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6759             </actions>
6760         </permacrud>
6761         </class>
6762         <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">
6763                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6764                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6765                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6766                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6767                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6768                 </fields>
6769                 <links>
6770                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6771                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6772                 </links>
6773         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6774             <actions>
6775                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6776                     <context link="grp" field="owner"/>
6777                 </create>
6778                 <retrieve/>
6779                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6780                     <context link="grp" field="owner"/>
6781                 </update>
6782                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6783                     <context link="grp" field="owner"/>
6784                 </delete>
6785             </actions>
6786         </permacrud>
6787         </class>
6788
6789         <!-- A note: Please update alhr and ahopl when updating ahr -->
6790         <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">
6791                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6792                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6793                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6794                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6795                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6796                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6797                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6798                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6799                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6800                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6801                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6802                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6803                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6804                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6805                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6806                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6807                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6808                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6809                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6810                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6811                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6812                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6813                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6814                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6815                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6816                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6817                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6818                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6819                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6820                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6821                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6822                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6823                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6824                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6825                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6826                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6827                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6828                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6829                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6830                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6831                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6832                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6833                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6834                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6835                 </fields>
6836                 <links>
6837                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6838                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6839                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6840                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6841                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6842                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6843                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6844                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6845                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6846                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6847                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6848                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6849                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6850                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6851                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6852                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6853                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6854                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6855                 </links>
6856                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6857                         <actions>
6858                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6859                         </actions>
6860                 </permacrud>
6861         </class>
6862         <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">
6863                 <oils_persist:source_definition><![CDATA[
6864                 SELECT
6865                         ahr.*,
6866                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6867                                 copy_location_order_position,
6868                         CASE WHEN au.alias IS NOT NULL THEN
6869                                 au.alias
6870                         ELSE
6871                                 au.first_given_name
6872                         END AS usr_alias_or_first_given_name,
6873                         au.first_given_name AS usr_first_given_name,
6874                         au.second_given_name AS usr_second_given_name,
6875                         au.family_name AS usr_family_name,
6876                         au.prefix AS usr_prefix,
6877                         au.suffix AS usr_suffix,
6878                         au.alias AS usr_alias,
6879                         CASE WHEN au.alias IS NOT NULL THEN
6880                                 au.alias
6881                         ELSE
6882                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6883                                         COALESCE(au.family_name, ''),
6884                                         COALESCE(au.suffix, ''),
6885                                         ', ',
6886                                         COALESCE(au.prefix, ''),
6887                                         COALESCE(au.first_given_name, ''),
6888                                         COALESCE(au.second_given_name, '')
6889                                 ], ' '), E'\\s+,', ',')
6890                         END AS usr_alias_or_display_name,
6891                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6892                                 COALESCE(au.family_name, ''),
6893                                 COALESCE(au.suffix, ''),
6894                                 ', ',
6895                                 COALESCE(au.prefix, ''),
6896                                 COALESCE(au.first_given_name, ''),
6897                                 COALESCE(au.second_given_name, '')
6898                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6899                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6900                                 AS call_number_label,
6901                         siss.label AS issuance_label,
6902                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6903                         ahcm_1.copy_count AS potential_copies
6904                 FROM action.hold_request ahr
6905                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6906                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6907                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6908                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6909                 JOIN actor.usr au ON (au.id = ahr.usr)
6910                 JOIN (
6911                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6912                         FROM asset.copy_location
6913                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6914                 LEFT JOIN actor.usr_standing_penalty ausp 
6915                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6916                 LEFT JOIN config.standing_penalty csp
6917                         ON (
6918                                 csp.id = ausp.standing_penalty AND 
6919                                 csp.block_list LIKE '%CAPTURE%' AND (
6920                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6921                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6922                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6923                                         )
6924                                 )
6925                         )
6926                 JOIN (
6927                         SELECT COUNT(target_copy) AS copy_count, hold
6928                         FROM action.hold_copy_map
6929                         GROUP BY 2
6930                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6931                 LEFT JOIN serial.issuance siss
6932                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6933                 LEFT JOIN asset.copy_location_order acplo
6934                         ON (acp.location = acplo.location AND
6935                                 acp.circ_lib = acplo.org)
6936                 WHERE
6937                         ahr.capture_time IS NULL AND
6938                         ahr.cancel_time IS NULL AND
6939                         csp.id IS NULL AND
6940                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6941                         acp.status IN (0,7)
6942                 ]]></oils_persist:source_definition>
6943                 <fields oils_persist:primary="id">
6944                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6945                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6946                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6947                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6948                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6949                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6950                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6951                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6952                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6953                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6954                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6955                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6956                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6957                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6958                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6959                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6960                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6961                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6962                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6963                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6964                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6965                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6966                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6967                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6968                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6969                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6970                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6971                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6972                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6973                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6974                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6975                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6976                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6977                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6978                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6979                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6980                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6981                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6982                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6983                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6984                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6985                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6986                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6987                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6988                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6989                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6990                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6991                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6992                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6993                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6994                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6995                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6996                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6997                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6998                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6999                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7000                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7001                 </fields>
7002                 <links>
7003                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7004                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7005                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7006                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7007                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7008                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7009                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7010                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7011                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7012                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7013                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7014                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7015                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7016                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7017                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7018                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7019                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7020                 </links>
7021                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7022                         <actions>
7023                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7024                         </actions>
7025                 </permacrud>
7026         </class>
7027         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7028                 <oils_persist:source_definition><![CDATA[
7029                         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)
7030                 ]]></oils_persist:source_definition>
7031                 <fields oils_persist:primary="id">
7032                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7033                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7034                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7035                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7036                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7037                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7038                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7039                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7040                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7041                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7042                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7043                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7044                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7045                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7046                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7047                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7048                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7049                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7050                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7051                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7052                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7053                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7054                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7055                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7056                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7057                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7058                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7059                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7060                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7061                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7063                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7064                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7065                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7066                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7067                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7068                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7069                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7070                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7071                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7072                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7073                 </fields>
7074                 <links>
7075                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7076                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7077                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7078                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7079                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7080                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7081                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7082                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7083                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7084                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7085                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7086                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7087                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7088                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7089                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7090                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7091                 </links>
7092         </class>
7093
7094         <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">
7095                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7096                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7097                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7098                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7099                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7100                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7101                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7102                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7103                 </fields>
7104                 <links>
7105                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7106                 </links>
7107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7108                         <actions>
7109                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7110                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7111                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7112                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7113                         </actions>
7114                 </permacrud>
7115         </class>
7116         <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">
7117                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7118                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7119                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7120                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7121                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7122                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7123                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7124                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7125                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7126                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7127                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7128                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7129                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7130                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7131                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7132                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7133                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7134                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7135                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7136                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7137                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7138                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7139                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7140                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7141                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7142                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7143                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7144                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7145                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7146                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7147                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7148                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7149                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7150                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7151                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7152                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7153                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7154                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7155                 </fields>
7156                 <links>
7157                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7158                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7159                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7160                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7161                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7162                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7163                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7164                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7165                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7166                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7167                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7168                 </links>
7169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7170                         <actions>
7171                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7172                         </actions>
7173                 </permacrud>
7174         </class>
7175         <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">
7176                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7177                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7178                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7179                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7180                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7181                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7182                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7183                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7184                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7185                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7186                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7187                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7188                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7189                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7190                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7191                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7192                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7193                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7194                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7195                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7196                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7197                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7198                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7199                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7200                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7201                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7202                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7203                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7205                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7206                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7207                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7208                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7209                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7210                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7211                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7212                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7213                 </fields>
7214                 <links>
7215                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7216                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7217                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7218                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7219                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7220                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7221                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7222                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7223                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7224                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7225                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7226                 </links>
7227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7228                         <actions>
7229                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7230                         </actions>
7231                 </permacrud>
7232         </class>
7233
7234         <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">
7235                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7236                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7237                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7238                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7239                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7240                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7241                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7242                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7243                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7244                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7245                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7246                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7247                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7248                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7249                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7250                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7251                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7252                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7253                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7254                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7255                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7256                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7257                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7258                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7259                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7260                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7261                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7262                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7263                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7264                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7265                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7266                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7267                 </fields>
7268                 <links>
7269                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7270                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7271                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7272                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7273                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7274                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7275                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7276                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7277                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7278                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7279                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7280                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7281                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7282                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7283                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7284                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7285                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7286                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7287                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7288                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7289                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7290                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7291                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7292                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7293                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7294                 </links>
7295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7296             <actions>
7297                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7298                 <retrieve />
7299                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7300                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7301             </actions>
7302         </permacrud>
7303         </class>
7304         <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">
7305                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7306                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7307                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7308                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7309                 </fields>
7310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7311                         <actions>
7312                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7313                                 <retrieve/>
7314                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7315                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7316                         </actions>
7317                 </permacrud>
7318         </class>
7319         <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">
7320                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7321                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7322                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7323                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7324                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7325                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7326                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7327                 </fields>
7328                 <links>
7329                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7330                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7331                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7332                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7333                 </links>
7334                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7335                         <actions>
7336                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7337                                 <retrieve/>
7338                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7339                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7340                         </actions>
7341                 </permacrud>
7342         </class>
7343         <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">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7345                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7346                         <field name="btype" reporter:datatype="text"/>
7347                         <field name="id" reporter:datatype="id" />
7348                         <field name="name"  reporter:datatype="text"/>
7349                         <field name="description" reporter:datatype="text"/>
7350                         <field name="owner" reporter:datatype="link"/>
7351                         <field name="pub" reporter:datatype="bool"/>
7352                         <field name="create_time" reporter:datatype="timestamp" />
7353                         <field name="owning_lib" reporter:datatype="org_unit" />
7354                 </fields>
7355                 <links>
7356                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7357                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7358                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7359                 </links>
7360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7361                         <actions>
7362                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7363                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7364                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7365                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7366                         </actions>
7367                 </permacrud>
7368         </class>
7369         <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">
7370                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7371                         <field name="id" reporter:datatype="id" />
7372                         <field name="bucket" reporter:datatype="link"/>
7373                         <field name="note" reporter:datatype="text" />
7374                 </fields>
7375                 <links>
7376                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7377                 </links>
7378         </class>
7379         <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">
7380                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7381                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7382                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7383                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7384                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7385                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7386                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7387                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7388                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7389                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7390                 </fields>
7391                 <links>
7392                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7393                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7394                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7395                 </links>
7396                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7397                         <actions>
7398                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7399                         </actions>
7400                 </permacrud>
7401         </class>
7402         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7403                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7404                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7405                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7406                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7407                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7408                 </fields>
7409                 <links>
7410                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7411                 </links>
7412                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7413                         <actions>
7414                                 <retrieve permission="VIEW_USER user_request.view">
7415                                         <context link="usr" field="home_ou" />
7416                                 </retrieve>
7417                         </actions>
7418                 </permacrud>
7419         </class>
7420     <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">
7421         <fields oils_persist:primary="field">
7422             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7423             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7424             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7425         </fields>
7426         <links/>
7427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7428             <actions>
7429                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7430                 <retrieve />
7431                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7432                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7433             </actions>
7434         </permacrud>
7435     </class>
7436         <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">
7437                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7438                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7439                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7440                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7441                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7442                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7443                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7444                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7445                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7446                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7447                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7448                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7449                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7450                 </fields>
7451                 <links>
7452                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7453                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7454                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7455                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7456                 </links>
7457         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7458             <actions>
7459                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7460                 <retrieve />
7461                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7462                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7463             </actions>
7464         </permacrud>
7465         </class>
7466         <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">
7467                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7468                         <field name="field" reporter:datatype="link"/>
7469                         <field name="id" reporter:datatype="id" />
7470                         <field name="source" reporter:datatype="link"/>
7471                         <field name="value"  reporter:datatype="text"/>
7472                 </fields>
7473                 <links>
7474                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7475                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7476                 </links>
7477         </class>
7478         <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">
7479                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7480                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7481                         <field name="btype" reporter:datatype="text"/>
7482                         <field name="id" reporter:datatype="id" />
7483                         <field name="name"  reporter:datatype="text"/>
7484                         <field name="description" reporter:datatype="text"/>
7485                         <field name="owner" reporter:datatype="link"/>
7486                         <field name="pub" reporter:datatype="bool"/>
7487                         <field name="create_time" reporter:datatype="timestamp" />
7488                         <field name="owning_lib" reporter:datatype="org_unit" />
7489                 </fields>
7490                 <links>
7491                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7492                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7493                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7494                 </links>
7495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7496                         <actions>
7497                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7498                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7499                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7500                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7501                         </actions>
7502                 </permacrud>
7503         </class>
7504         <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">
7505                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7506                         <field name="id" reporter:datatype="id" />
7507                         <field name="bucket" reporter:datatype="link"/>
7508                         <field name="note" reporter:datatype="text" />
7509                 </fields>
7510                 <links>
7511                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7512                 </links>
7513         </class>
7514         <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">
7515                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7516                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7517                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7518                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7519                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7520                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7521                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7522                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7523                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7524                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7525                 </fields>
7526                 <links>
7527                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7528                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7529                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7530                 </links>
7531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7532             <actions>
7533                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7534                     <context link="xact" jump="usr" field="home_ou"/>
7535                 </retrieve>
7536                         </actions>
7537                 </permacrud>
7538         </class>
7539         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7540                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7541                         <field name="id" reporter:datatype="id" />
7542                         <field name="ind1" />
7543                         <field name="ind2" />
7544                         <field name="record" />
7545                         <field name="subfield" />
7546                         <field name="tag" />
7547                         <field name="value" />
7548                 </fields>
7549                 <links>
7550                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7551                 </links>
7552         </class>
7553         <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">
7554                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7555                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7556                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7557                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7558                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7559                 </fields>
7560                 <links>
7561                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7562                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7563                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7564                 </links>
7565         </class>
7566         <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">
7567                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7568                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7569                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7570                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7571                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7572                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7573                 </fields>
7574                 <links>
7575                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7576                 </links>
7577         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7578             <actions>
7579                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7580                 <retrieve/>
7581                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7582                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7583             </actions>
7584         </permacrud>
7585
7586         </class>
7587         <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">
7588                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7589                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7590                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7591                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7592                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7593                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7594                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7595                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7596                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7597                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7598                 </fields>
7599                 <links>
7600                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7601                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7602                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7603                 </links>
7604         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7605             <actions>
7606                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7607                 <retrieve/>
7608                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7609                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7610             </actions>
7611         </permacrud>
7612         </class>
7613         <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">
7614                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7615                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7616                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7617                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7618                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7619                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7620                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7621                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7622                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7623                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7624                 </fields>
7625                 <links>
7626                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7627                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7628                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7629                 </links>
7630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7631                 <actions>
7632                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7633                     <retrieve/>
7634                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7635                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7636                 </actions>
7637              </permacrud>
7638         </class>
7639         <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">
7640                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7641                         <field name="balance_owed" reporter:datatype="money" />
7642                         <field name="total_owed" reporter:datatype="money" />
7643                         <field name="total_paid" reporter:datatype="money" />
7644                         <field name="usr" reporter:datatype="link"/>
7645                 </fields>
7646                 <links>
7647                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7648                 </links>
7649         </class>
7650     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7651                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7652                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7653                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7654                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7655                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7656                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7657                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7658                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7659                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7660                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7661                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7662                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7663                 </fields>
7664                 <links>
7665                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7666                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7667                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7668                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7669                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7670                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7671                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7672                 </links>
7673         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7674             <actions>
7675                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7676             </actions>
7677         </permacrud>
7678         </class>
7679         <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">
7680                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7681                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7682                         <field name="quality" reporter:datatype="int" />
7683                         <field name="source" reporter:datatype="text"/>
7684                         <field name="transcendant" reporter:datatype="bool"/>
7685                         <field name="can_have_copies" reporter:datatype="bool"/>
7686                 </fields>
7687                 <links/>
7688         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7689             <actions>
7690                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7691                 <retrieve/>
7692                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7693                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7694             </actions>
7695         </permacrud>
7696         </class>
7697         <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">
7698                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7699                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7700                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7701                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7702                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7703                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7704                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7705                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7706                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7707                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7708                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7709                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7710                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7711                 </fields>
7712                 <links>
7713                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7714                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7715                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7716                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7717                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7718                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7719                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7720                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7721                 </links>
7722                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7723                         <actions>
7724                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7725                                         <context link="usr" field="home_ou" />
7726                                 </retrieve>
7727                         </actions>
7728                 </permacrud>
7729         </class>
7730         <class id="actsce" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7731                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7732                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7733                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7734                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7735                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7736                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7737                 </fields>
7738                 <links>
7739                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7740                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7741                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7742                 </links>
7743         </class>
7744         <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">
7745                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7746                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7747                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7748                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7749                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7750                 </fields>
7751                 <links>
7752                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7753                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7754                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7755                 </links>
7756         </class>
7757         <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">
7758                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7759                         <field name="bucket" reporter:datatype="link"/>
7760                         <field name="id" reporter:datatype="id" />
7761                         <field name="target_user" reporter:datatype="link"/>
7762                         <field name="create_time" reporter:datatype="timestamp" />
7763                         <field name="pos" reporter:datatype="int" />
7764                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7765                 </fields>
7766                 <links>
7767                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7768                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7769             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7770                 </links>
7771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7772                         <actions>
7773                                 <retrieve permission="ADMIN_USER_BUCKET">
7774                     <context link="bucket" field="owning_lib"/>
7775                 </retrieve>
7776             </actions>
7777         </permacrud>
7778         </class>
7779         <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">
7780                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7781                         <field name="id" reporter:datatype="id" />
7782                         <field name="staff" reporter:datatype="link"/>
7783                         <field name="bucket" reporter:datatype="link"/>
7784                         <field name="target" reporter:datatype="int" />
7785                         <field name="hold_type" reporter:datatype="text" />
7786                         <field name="run_date" reporter:datatype="timestamp" />
7787                         <field name="cancelled" reporter:datatype="timestamp" />
7788                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7789                 </fields>
7790                 <links>
7791                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7792                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7793                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7794                 </links>
7795                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7796                         <actions>
7797                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7798                 <retrieve/>
7799                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7800                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7801             </actions>
7802         </permacrud>
7803         </class>
7804         <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">
7805                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7806                         <field name="id" reporter:datatype="id" />
7807                         <field name="batch_hold_event" reporter:datatype="link"/>
7808                         <field name="hold" reporter:datatype="link"/>
7809                 </fields>
7810                 <links>
7811                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7812                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7813                 </links>
7814                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7815                         <actions>
7816                 <retrieve/>
7817             </actions>
7818         </permacrud>
7819         </class>
7820         <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">
7821                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7822                         <field name="id" reporter:datatype="id" />
7823                         <field name="item" reporter:datatype="link"/>
7824                         <field name="note" reporter:datatype="text" />
7825                 </fields>
7826                 <links>
7827                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7828                 </links>
7829         </class>
7830         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7831                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7832                         <field name="balance_owed" reporter:datatype="money" />
7833                         <field name="total_owed" reporter:datatype="money" />
7834                         <field name="total_paid" reporter:datatype="money" />
7835                         <field name="usr" reporter:datatype="link"/>
7836                 </fields>
7837                 <links>
7838                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7839                 </links>
7840         </class>
7841         <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">
7842                 <fields oils_persist:primary="code" oils_persist:sequence="">
7843                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7844                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7845                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7846                 </fields>
7847                 <links/>
7848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7849             <actions>
7850                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7851                 <retrieve/>
7852                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7853                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7854             </actions>
7855         </permacrud>
7856         </class>
7857         <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">
7858                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7859                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7860                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7861                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7862                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7863                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7864                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7865                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7866                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7867                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7868                 </fields>
7869                 <links>
7870                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7871                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7872                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7873                 </links>
7874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7875             <actions>
7876                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7877                     <context link="xact" jump="usr" field="home_ou"/>
7878                 </retrieve>
7879                         </actions>
7880                 </permacrud>
7881         </class>
7882         <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">
7883                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7884                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7885                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7886                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7887                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7888                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7889                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7890                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7891                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7892                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7893                 </fields>
7894                 <links>
7895                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7896                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7897                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7898                 </links>
7899         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7900             <actions>
7901                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7902                     <context link="xact" jump="usr" field="home_ou"/>
7903                 </retrieve>
7904                         </actions>
7905                 </permacrud>
7906         </class>
7907         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7908                 <fields oils_persist:primary="id" oils_persist:sequence="">
7909                         <field name="checkin_lib" reporter:datatype="link"/>
7910                         <field name="checkin_staff" reporter:datatype="link"/>
7911                         <field name="checkin_time" reporter:datatype="timestamp"/>
7912                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7913                         <field name="circ_staff" reporter:datatype="link"/>
7914                         <field name="desk_renewal" reporter:datatype="bool"/>
7915                         <field name="due_date" reporter:datatype="timestamp"/>
7916                         <field name="duration" reporter:datatype="interval"/>
7917                         <field name="duration_rule" reporter:datatype="link"/>
7918                         <field name="fine_interval" reporter:datatype="interval"/>
7919                         <field name="id" reporter:datatype="id" />
7920                         <field name="max_fine" reporter:datatype="money" />
7921                         <field name="max_fine_rule" reporter:datatype="link"/>
7922                         <field name="opac_renewal" reporter:datatype="bool"/>
7923                         <field name="phone_renewal" reporter:datatype="bool"/>
7924                         <field name="recurring_fine" reporter:datatype="money" />
7925                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7926                         <field name="renewal_remaining" reporter:datatype="int" />
7927             <field name="grace_period" reporter:datatype="interval" />
7928                         <field name="stop_fines" reporter:datatype="text"/>
7929                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7930                         <field name="target_copy" reporter:datatype="link"/>
7931                         <field name="usr" reporter:datatype="link"/>
7932                         <field name="xact_finish" reporter:datatype="timestamp" />
7933                         <field name="xact_start" reporter:datatype="timestamp" />
7934                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7935                         <field name="auto_renewal" reporter:datatype="bool"/>
7936                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7937                 </fields>
7938                 <links>
7939                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7940                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7941                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7942                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7943                 </links>
7944         </class>
7945         <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">
7946                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7947                         <field name="field" reporter:datatype="link"/>
7948                         <field name="id" reporter:datatype="id" />
7949                         <field name="source" reporter:datatype="link"/>
7950                         <field name="value" reporter:datatype="text"/>
7951                 </fields>
7952                 <links>
7953                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7954                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7955                 </links>
7956         </class>
7957         <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">
7958                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7959                         <field name="high" reporter:datatype="money" />
7960                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7961                         <field name="low" reporter:datatype="money" />
7962                         <field name="name" reporter:datatype="text"/>
7963                         <field name="normal" reporter:datatype="money" />
7964                         <field name="recurrence_interval" reporter:datatype="interval"/>
7965             <field name="grace_period" reporter:datatype="interval" />
7966                 </fields>
7967                 <links/>
7968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7969             <actions>
7970                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7971                 <retrieve/>
7972                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7973                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7974             </actions>
7975         </permacrud>
7976         </class>
7977         <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">
7978                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7979                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7980                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7981                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7982                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7983                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7984                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7985                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7986                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7987                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7988                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7989                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7990                 </fields>
7991                 <links>
7992                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7993                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7994                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7995                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7996                 </links>
7997         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7998             <actions>
7999                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8000                     <context link="xact" jump="usr" field="home_ou"/>
8001                 </retrieve>
8002                         </actions>
8003                 </permacrud>
8004         </class>
8005         <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">
8006                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8007                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8008                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8009                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8010                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8011                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8012                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8013                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8014                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8015                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8016                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8017                 </fields>
8018                 <links>
8019                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8020                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8021                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8022                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8023                 </links>
8024         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8025             <actions>
8026                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8027                     <context link="xact" jump="usr" field="home_ou"/>
8028                 </retrieve>
8029                         </actions>
8030                 </permacrud>
8031         </class>
8032         <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">
8033                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8034                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8035                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8036                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8037                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8038                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8039                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8040                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8041                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8042                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8043                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8044                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8045                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8046                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8047                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8048                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8049                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8050                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8051                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8052                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8053                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8054                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8055                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8056                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8057                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8058                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8059                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8060                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8061                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8062                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8063                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8064                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8065                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8066                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8067                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8068                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8069                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8070                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8071                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8072                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8073                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8074                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8075                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8076                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8077                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8078                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8079                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8080                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8081                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8082                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8083                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8084                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8085                 </fields>
8086                 <links>
8087                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8088                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8089                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8090                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8091                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8092                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8093                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8094                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8095                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8096                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8097                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8098                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8099                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8100                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8101                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8102                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8103                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8104                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8105                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8106                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8107                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8108                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8109                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8110                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8111                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8112                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8113                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8114                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8115                 </links>
8116         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8117             <actions>
8118                 <create permission="CREATE_COPY">
8119                     <context link="call_number" field="owning_lib"/>
8120                 </create>
8121                 <retrieve/>
8122                 <update permission="UPDATE_COPY">
8123                     <context link="call_number" field="owning_lib"/>
8124                 </update>
8125                 <delete permission="DELETE_COPY">
8126                     <context link="call_number" field="owning_lib"/>
8127                 </delete>
8128             </actions>
8129         </permacrud>
8130         </class>
8131
8132         <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">
8133                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8134                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8135                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8136                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8137                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8138                 </fields>
8139                 <links>
8140                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8141                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8142                 </links>
8143                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8144                         <actions>
8145                 <create permission="STAFF_LOGIN"/>
8146                 <retrieve/>
8147                 <update permission="STAFF_LOGIN"/>
8148                 <delete permission="STAFF_LOGIN"/>
8149                         </actions>
8150                 </permacrud>
8151         </class>
8152
8153         <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">
8154                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8155             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8156                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8157                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8158                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8159                 </fields>
8160                 <links>
8161                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8162                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8163                 </links>
8164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8165             <actions>
8166                                 <retrieve/>
8167             </actions>
8168         </permacrud>
8169         </class>
8170
8171         <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">
8172                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8173                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8174                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8175                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8176                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8177                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8178                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8179                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8180                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8181                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8182                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8183                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8184                 </fields>
8185                 <links>
8186                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8187                 </links>
8188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8189             <actions>
8190                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8191                 <retrieve/>
8192                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8193                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8194             </actions>
8195         </permacrud>
8196         </class>
8197
8198         <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">
8199                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8200                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8201                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8202                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8203                 </fields>
8204                 <links>
8205                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8206                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8207                 </links>
8208         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8209             <actions>
8210                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8211                 <retrieve/>
8212                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8213                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8214             </actions>
8215         </permacrud>
8216         </class>
8217
8218         <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">
8219                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8220                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8221                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8222                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8223                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8224                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8225                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8226                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8227                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8228                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8229                 </fields>
8230                 <links>
8231                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8232                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8233                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8234                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8235                 </links>
8236         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8237             <actions>
8238                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8239                     <context link="copy" field="circ_lib"/>
8240                 </create>
8241                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8242                     <context link="copy" field="circ_lib"/>
8243                                 </retrieve>
8244                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8245                     <context link="copy" field="circ_lib"/>
8246                                 </update>
8247                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8248                     <context link="copy" field="circ_lib"/>
8249                                 </delete>
8250             </actions>
8251         </permacrud>
8252         </class>
8253
8254         <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">
8255                 <fields oils_persist:primary="id">
8256                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8257                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8258                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8259                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8260                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8261                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8262                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8263                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8264                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8265                 </fields>
8266                 <links>
8267                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8268                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8269                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8270                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8271                 </links>
8272         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8273             <actions>
8274                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8275                     <context link="copy" field="circ_lib"/>
8276                 </create>
8277                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8278                     <context link="copy" field="circ_lib"/>
8279                                 </retrieve>
8280                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8281                     <context link="copy" field="circ_lib"/>
8282                                 </update>
8283                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8284                     <context link="copy" field="circ_lib"/>
8285                                 </delete>
8286             </actions>
8287         </permacrud>
8288         </class>
8289
8290         <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">
8291                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8292                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8293                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8294                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8295                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8296                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8297                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8299                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8300                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8301                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8302                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8303                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8304                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8305                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8306                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8307                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8308                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8309                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8310                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8311                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8312                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8313                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8314                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8315                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8316                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8317                 </fields>
8318                 <links>
8319                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8320                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8321                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8322                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8323                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8324                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8325                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8326                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8327                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8328                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8329                 </links>
8330                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8331                         <actions>
8332                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8333                                 <retrieve />
8334                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8335                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8336                         </actions>
8337                 </permacrud>
8338         </class>
8339
8340         <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">
8341                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8342                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8343                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8344                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8345                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8346                 </fields>
8347                 <links/>
8348         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8349             <actions>
8350                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8351                 <retrieve/>
8352                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8353                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8354             </actions>
8355         </permacrud>
8356         </class>
8357         <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">
8358                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8359                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8360                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8361                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8362                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8363                 </fields>
8364                 <links/>
8365         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8366             <actions>
8367                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8368                 <retrieve/>
8369                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8370                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8371             </actions>
8372         </permacrud>
8373         </class>
8374         <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">
8375                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8376                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8377                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8378                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8379                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8380                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8381                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8382                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8383                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8384                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8385                 </fields>
8386                 <links>
8387                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8388                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8389                 </links>
8390         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8391             <actions>
8392                 <create permission="CREATE_PERM" global_required="true"/>
8393                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8394                 <update permission="UPDATE_PERM" global_required="true"/>
8395                 <delete permission="DELETE_PERM" global_required="true"/>
8396             </actions>
8397         </permacrud>
8398         </class>
8399         <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">
8400                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8401                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8402                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8403                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8404                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8405                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8406                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8407                 </fields>
8408                 <links>
8409                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8410                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8411                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8412                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8413                 </links>
8414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8415                         <actions>
8416                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8417                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8418                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8419                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8420                         </actions>
8421                 </permacrud>
8422         </class>
8423         <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">
8424                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8425                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8426                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8427                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8428                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8429                 </fields>
8430                 <links>
8431                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8432                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8433                 </links>
8434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8435             <actions>
8436                 <create permission="ADMIN_SURVEY">
8437                     <context link="question" jump="survey" field="owner"/>
8438                 </create>
8439                 <retrieve/>
8440                 <update permission="ADMIN_SURVEY">
8441                     <context link="question" jump="survey" field="owner"/>
8442                 </update>
8443                 <delete permission="ADMIN_SURVEY">
8444                     <context link="question" jump="survey" field="owner"/>
8445                 </delete>
8446             </actions>
8447         </permacrud>
8448         </class>
8449         <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">
8450                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8451                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8452                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8453                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8454                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8455                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8456                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8457                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8458                 </fields>
8459                 <links>
8460                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8461                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8462                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8463                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8464                 </links>
8465                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8466                         <actions>
8467                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8468                         </actions>
8469                 </permacrud>
8470         </class>
8471         <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">
8472                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8473                         <field name="balance_owed" reporter:datatype="money" />
8474                         <field name="total_owed" reporter:datatype="money" />
8475                         <field name="total_paid" reporter:datatype="money" />
8476                         <field name="usr" reporter:datatype="link"/>
8477                 </fields>
8478                 <links>
8479                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8480                 </links>
8481         </class>
8482         <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">
8483                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8484                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8485                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8486                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8487                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8488                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8489                 </fields>
8490                 <links>
8491                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8492                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8493                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8494                 </links>
8495         </class>
8496         <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">
8497                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8498                         <field name="field" reporter:datatype="link"/>
8499                         <field name="id" reporter:datatype="id" />
8500                         <field name="source" reporter:datatype="link"/>
8501                         <field name="value" reporter:datatype="text"/>
8502                 </fields>
8503                 <links>
8504                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8505                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8506                 </links>
8507         </class>
8508         <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">
8509                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8510                         <field name="field" reporter:datatype="link"/>
8511                         <field name="id" reporter:datatype="id" />
8512                         <field name="source" reporter:datatype="link"/>
8513                         <field name="value" reporter:datatype="text"/>
8514                 </fields>
8515                 <links>
8516                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8517                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8518                 </links>
8519         </class>
8520         <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">
8521                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8522                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8523                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8524                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8525                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8526                 </fields>
8527                 <links>
8528                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8529                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8530                 </links>
8531         </class>
8532         <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">
8533                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8534                         <field name="depth" reporter:datatype="int" />
8535                         <field name="grantable" reporter:datatype="bool"/>
8536                         <field name="grp" reporter:datatype="link"/>
8537                         <field name="id" reporter:datatype="id" />
8538                         <field name="perm" reporter:datatype="link"/>
8539                 </fields>
8540                 <links>
8541                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8542                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8543                 </links>
8544         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8545             <actions>
8546                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8547                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8548                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8549                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8550             </actions>
8551         </permacrud>
8552         </class>
8553         <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">
8554                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8555                         <field name="items" oils_persist:virtual="true" />
8556                         <field name="btype" reporter:datatype="text"/>
8557                         <field name="id" reporter:datatype="id" />
8558                         <field name="name" reporter:datatype="text"/>
8559                         <field name="description" reporter:datatype="text"/>
8560                         <field name="owner" reporter:datatype="link"/>
8561                         <field name="pub" reporter:datatype="bool"/>
8562                         <field name="create_time" reporter:datatype="timestamp" />
8563                         <field name="owning_lib" reporter:datatype="org_unit" />
8564                 </fields>
8565                 <links>
8566                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8567                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8568                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8569                 </links>
8570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8571                         <actions>
8572                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8573                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8574                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8575                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8576                         </actions>
8577                 </permacrud>
8578         </class>
8579         <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">
8580                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8581                         <field name="id" reporter:datatype="id" />
8582                         <field name="bucket" reporter:datatype="link"/>
8583                         <field name="note" reporter:datatype="text" />
8584                 </fields>
8585                 <links>
8586                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8587                 </links>
8588         </class>
8589         <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">
8590                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8591                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8592                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8593                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8594                 </fields>
8595                 <links>
8596                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8597                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8598                 </links>
8599         </class>
8600         <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">
8601                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8602                         <field name="depth" reporter:datatype="int"/>
8603                         <field name="grantable" reporter:datatype="bool"/>
8604                         <field name="id" reporter:datatype="id" />
8605                         <field name="perm" reporter:datatype="link"/>
8606                         <field name="usr" reporter:datatype="link"/>
8607                 </fields>
8608                 <links>
8609                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8610                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8611                 </links>
8612         </class>
8613         <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">
8614                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8615                         <field name="object_id" reporter:datatype="text"/>
8616                         <field name="grantable" reporter:datatype="bool"/>
8617                         <field name="id" reporter:datatype="id" />
8618                         <field name="perm" reporter:datatype="link"/>
8619                         <field name="usr" reporter:datatype="link"/>
8620                         <field name="object_type" reporter:datatype="text"/>
8621                 </fields>
8622                 <links>
8623                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8624                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8625                 </links>
8626         </class>
8627         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8628                 <fields oils_persist:primary="id" oils_persist:sequence="">
8629                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8630                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8631                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8632                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8633                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8634                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8635                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8636                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8637                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8638                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8639                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8640                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8641                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8642                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8643                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8644                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8645                 </fields>
8646                 <links>
8647                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8648                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8649                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8650                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8651                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8652                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8653                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8654                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8655                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8656                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8657                 </links>
8658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8659             <actions>
8660                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8661                     <context link="xact" jump="usr" field="home_ou"/>
8662                 </retrieve>
8663                         </actions>
8664                 </permacrud>
8665         </class>
8666         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8667                 oils_obj:fieldmapper="money::aged_payment" 
8668                 oils_persist:tablename="money.aged_payment" 
8669                 reporter:label="Payments: Aged">
8670                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8671                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8672                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8673                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8674                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8675                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8676                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8677                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8678                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8679                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8680                         <field name="billing" reporter:datatype="link"/>
8681                 </fields>
8682                 <links>
8683                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8684                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8685                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8686                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8687                 </links>
8688                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8689                         <actions>
8690                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8691                                         <context link="xact" field="usr_home_ou"/>
8692                                 </retrieve>
8693                         </actions>
8694                 </permacrud>
8695         </class>
8696         <class id="mallp" controller="open-ils.cstore" 
8697                 oils_obj:fieldmapper="money::all_payments" 
8698                 oils_persist:tablename="money.all_payments" 
8699                 oils_persist:readonly="true" reporter:core="true"
8700                 reporter:label="Payments: All">
8701                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8702                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8703                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8704                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8705                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8706                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8707                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8708                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8709                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8710                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8711                         <field name="billing" reporter:datatype="link"/>
8712                 </fields>
8713                 <links>
8714                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8715                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8716                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8717                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8718                 </links>
8719         </class>
8720
8721         <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">
8722                 <fields oils_persist:primary="id" oils_persist:sequence="">
8723                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8724                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8725                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8726                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8727                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8728                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8729                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8730                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8731                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8732                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8733                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8734                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8735                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8736                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8737                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8738                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8739                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8740                 </fields>
8741                 <links>
8742                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8743                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8744                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8745                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8746                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8747                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8748                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8749                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8750                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8751                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8752                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8753                 </links>
8754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8755                         <actions>
8756                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8757                                         <context link="xact" jump="usr" field="home_ou"/>
8758                                 </retrieve>
8759                         </actions>
8760                 </permacrud>
8761         </class>
8762         <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">
8763                 <fields oils_persist:primary="id" oils_persist:sequence="">
8764                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8765                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8766                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8767                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8768                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8769                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8770                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8771                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8772                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8773                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8774                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8775                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8776                 </fields>
8777                 <links>
8778                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8779                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8780                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8781                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8782                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8783                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8784                 </links>
8785         </class>
8786         <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">
8787                 <fields oils_persist:primary="id" oils_persist:sequence="">
8788                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8789                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8790                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8791                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8792                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8793                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8794                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8795                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8796                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8797                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8798                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8799                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8800                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8801                 </fields>
8802                 <links>
8803                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8804                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8805                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8806                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8807                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8808                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8809                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8810                 </links>
8811         </class>
8812         <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">
8813                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8814                         <field name="bucket" reporter:datatype="link"/>
8815                         <field name="id" reporter:datatype="id" />
8816                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8817                         <field name="create_time" reporter:datatype="timestamp" />
8818                         <field name="pos" reporter:datatype="int" />
8819                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8820                 </fields>
8821                 <links>
8822                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8823                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8824             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8825                 </links>
8826                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8827                         <actions>
8828                                 <retrieve permission="ADMIN_COPY_BUCKET">
8829                     <context link="bucket" field="owning_lib"/>
8830                 </retrieve>
8831             </actions>
8832         </permacrud>
8833         </class>
8834         <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">
8835                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8836                         <field name="id" reporter:datatype="id" />
8837                         <field name="item" reporter:datatype="link"/>
8838                         <field name="note" reporter:datatype="text" />
8839                 </fields>
8840                 <links>
8841                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8842                 </links>
8843         </class>
8844         <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">
8845                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8846                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8847                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8848                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8849                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8850                 </fields>
8851                 <links>
8852                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8853                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8854                 </links>
8855                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8856                         <actions>
8857                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8858                         </actions>
8859                 </permacrud>
8860         </class>
8861     <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">
8862         <fields oils_persist:primary="field">
8863             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8864             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8865             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8866         </fields>
8867         <links/>
8868         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8869             <actions>
8870                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8871                 <retrieve />
8872                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8873                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8874             </actions>
8875         </permacrud>
8876     </class>
8877         <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">
8878                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8879                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8880                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8881                 </fields>
8882                 <links/>
8883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8884             <actions>
8885                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8886                 <retrieve/>
8887                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8888                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8889             </actions>
8890         </permacrud>
8891         </class>
8892
8893
8894         <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">
8895                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8896                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8897                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8898                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8899                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8900                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8901                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8902                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8903                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8904                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8905                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8906                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8907                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8908                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8909                 </fields>
8910                 <links>
8911                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8912                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8913                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8914                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8915                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8916                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8917                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8918                 </links>
8919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8920             <actions>
8921                 <create permission="TRANSIT_COPY">
8922                     <context link="target_copy" field="owner"/>
8923                 </create>
8924                 <retrieve/>
8925                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8926                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8927             </actions>
8928         </permacrud>
8929         </class>
8930         <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">
8931                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8932                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8933                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8934                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8935                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8936                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8937                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8938                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8939                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8940                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8941                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8942                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8943                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8944                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8945                 </fields>
8946                 <links>
8947                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8948                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8949                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8950                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8951                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8952                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8953                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8954                 </links>
8955         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8956             <actions>
8957                 <create permission="TRANSIT_COPY" context_field="owner">
8958                     <context link="target_copy" field="circ_lib"/>
8959                 </create>
8960                 <retrieve/>
8961                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8962                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8963             </actions>
8964         </permacrud>
8965         </class>
8966         <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">
8967                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8968                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8969                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8970                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8971                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8972                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8973                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8974                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8975                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8976                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8977                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8978                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8979                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8980                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8981                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8982                 </fields>
8983                 <links>
8984                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8985                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8986                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8987                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8988                 </links>
8989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8990             <actions>
8991                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8992                     <context link="xact" jump="usr" field="home_ou"/>
8993                 </retrieve>
8994                         </actions>
8995                 </permacrud>
8996         </class>
8997         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
8998                 oils_obj:fieldmapper="money::aged_billing" 
8999                 oils_persist:tablename="money.aged_billing" 
9000                 reporter:label="Aged Billing Line Item">
9001                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9002                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9003                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9004                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9005                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9006                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9007                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9008                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9009                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9010                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9011                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9012                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9013                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9014                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9015                 </fields>
9016                 <links>
9017                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9018                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9019                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9020                 </links>
9021                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9022                         <actions>
9023                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9024                                         <context link="xact" field="usr_home_ou"/>
9025                                 </retrieve>
9026                         </actions>
9027                 </permacrud>
9028         </class>
9029         <class id="mallb" controller="open-ils.cstore" 
9030                 oils_obj:fieldmapper="money::all_billings" 
9031                 oils_persist:tablename="money.all_billings" 
9032                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9033                 <fields oils_persist:primary="id" oils_persist:sequence="">
9034                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9035                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9036                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9037                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9038                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9039                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9040                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9041                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9042                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9043                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9044                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9045                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9046                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9047                 </fields>
9048                 <links>
9049                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9050                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9051                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9052                 </links>
9053         </class>
9054         <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">
9055                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9056                         <field name="grp" />
9057                         <field name="id" reporter:datatype="id" />
9058                         <field name="usr" />
9059                 </fields>
9060                 <links>
9061                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9062                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9063                 </links>
9064         </class>
9065         <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">
9066                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9067                         <field name="id" reporter:datatype="id" />
9068                         <field name="fq_field" reporter:datatype="text"/>
9069                         <field name="identity_value" reporter:datatype="text"/>
9070                         <field name="translation" reporter:datatype="text"/>
9071                         <field name="string" reporter:datatype="text"/>
9072                 </fields>
9073                 <links>
9074                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9075                 </links>
9076         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9077             <actions>
9078                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9079                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9080                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9081                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9082             </actions>
9083         </permacrud>
9084         </class>
9085         <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">
9086                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9087                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9088                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9089                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9090                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9091                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9092                 </fields>
9093                 <links>
9094                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9095                 </links>
9096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9097             <actions>
9098                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9099                 <retrieve/>
9100                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9101                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9102             </actions>
9103         </permacrud>
9104         </class>
9105         <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">
9106                 <fields oils_persist:primary="code">
9107                         <field name="code" reporter:datatype="id" />
9108                         <field name="marc_code" reporter:datatype="text"/>
9109                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9110                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9111                         <field name="rtl" reporter:datatype="bool"/>
9112                 </fields>
9113                 <links/>
9114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9115             <actions>
9116                 <create permission="CREATE_LOCALE" global_required="true"/>
9117                 <retrieve/>
9118                 <update permission="UPDATE_LOCALE" global_required="true"/>
9119                 <delete permission="DELETE_LOCALE" global_required="true"/>
9120             </actions>
9121         </permacrud>
9122         </class>
9123         <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">
9124                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9125                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9126                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9127                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9128                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9129                 </fields>
9130                 <links>
9131                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9132                 </links>
9133         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9134             <actions>
9135                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9136                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9137                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9138                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9139             </actions>
9140         </permacrud>
9141         </class>
9142
9143         <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">
9144                 <fields oils_persist:primary="id">
9145                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9146                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9147                 </fields>
9148                 <links/>
9149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9150             <actions>
9151                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9152                 <retrieve/>
9153                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9154                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9155             </actions>
9156         </permacrud>
9157         </class>
9158
9159         <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">
9160                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9161                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9162                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9163                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9164                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9165                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9166                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9167                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9168                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9169                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9170                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9171                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9172                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9173                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9174                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9175                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9176                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9177                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9178                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9179                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9180                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9181                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9182                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9183                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9184                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9185                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9186                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9187                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9188                 </fields>
9189                 <links>
9190                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9191                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9192                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9193                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9194                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9195                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9196                 </links>
9197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9198             <actions>
9199                 <create permission="user_request.create">
9200                     <context link="usr" field="home_ou"/>
9201                                 </create>
9202                 <retrieve permission="user_request.view">
9203                     <context link="usr" field="home_ou"/>
9204                                 </retrieve>
9205                 <update permission="user_request.update">
9206                     <context link="usr" field="home_ou"/>
9207                                 </update>
9208                 <delete permission="user_request.delete">
9209                     <context link="usr" field="home_ou"/>
9210                                 </delete>
9211             </actions>
9212         </permacrud>
9213         </class>
9214
9215         <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">
9216         <oils_persist:source_definition><![CDATA[
9217             SELECT r.*, CASE
9218                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9219                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9220                         WHEN l.state = 'received' THEN 5 -- Received
9221                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9222                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9223                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9224                         WHEN l.id IS NULL THEN 1 -- New
9225                         ELSE 0 -- Error
9226                     END AS request_status
9227                     ,u.home_ou
9228             FROM      acq.user_request r
9229             JOIN actor.usr u ON (r.usr = u.id)
9230             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9231             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9232             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9233         ]]></oils_persist:source_definition>
9234                 <fields oils_persist:primary="id">
9235                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9236                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9237                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9238                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9239                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9240                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9241                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9242                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9243                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9244                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9245                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9246                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9247                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9248                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9249                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9250                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9251                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9252                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9253                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9254                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9255                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9256                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9257                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9258                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9259                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9260                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9261                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9262                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9263                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9264                 </fields>
9265                 <links>
9266                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9267                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9268                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9269                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9270                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9271                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9272                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9273                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9274                 </links>
9275         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9276             <actions>
9277                 <retrieve permission="user_request.view">
9278                     <context link="usr" field="home_ou"/>
9279                                 </retrieve>
9280             </actions>
9281         </permacrud>
9282         </class>
9283
9284         <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">
9285                 <fields oils_persist:primary="id">
9286                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9287                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9288                 </fields>
9289                 <links/>
9290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9291             <actions>
9292                 <retrieve/>
9293             </actions>
9294         </permacrud>
9295         </class>
9296
9297         <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">
9298                 <fields oils_persist:primary="code">
9299                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9300                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9301                 </fields>
9302                 <links/>
9303         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9304             <actions>
9305                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9306                 <retrieve/>
9307                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9308                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9309             </actions>
9310         </permacrud>
9311         </class>
9312
9313         <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">
9314                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9315                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9316                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9317                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9318                         <field reporter:label="Ratio" name="ratio" />
9319                 </fields>
9320                 <links>
9321                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9322                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9323                 </links>
9324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9325                         <actions>
9326                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9327                                 <retrieve/>
9328                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9329                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9330                         </actions>
9331                 </permacrud>
9332         </class>
9333
9334         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9335                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9336                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9337                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9338                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9339                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9340                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9341                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9342                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9343                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9344                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9345                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9346                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9347                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9348                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9349                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9350                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9351                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9352                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9353                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9354                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9355                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9356                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9357                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9358                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9359                 </fields>
9360                 <links>
9361                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9362                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9363                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9364                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9365                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9366                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9367                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9368                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9369                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9370                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9371                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9372                 </links>
9373         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9374             <actions>
9375                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9376                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9377                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9378                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9379             </actions>
9380         </permacrud>
9381         </class>
9382
9383         <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">
9384                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9385                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9386                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9387                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9388                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9389                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9390                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9391                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9392                 </fields>
9393                 <links>
9394                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9395                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9396                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9397                 </links>
9398         </class>
9399
9400         <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">
9401                 <fields oils_persist:primary="code">
9402                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9403                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9404                 </fields>
9405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9406             <actions>
9407                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9408                 <retrieve/>
9409                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9410                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9411             </actions>
9412                 </permacrud>
9413         </class>
9414
9415         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9416                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9417                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9418                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9419                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9420                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9421                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9422                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9423                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9424                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9425                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9426                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9427                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9428                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9429                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9430                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9431                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9432                 </fields>
9433                 <links>
9434                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9435                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9436                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9437                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9438                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9439                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9440                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9441                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9442                 </links>
9443         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9444             <actions>
9445                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9446                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9447                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9448                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9449             </actions>
9450         </permacrud>
9451         </class>
9452
9453         <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">
9454                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9455                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9456                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9457                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9458                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9459                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9460                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9461                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9462                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9463                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9464                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9465                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9466                 </fields>
9467                 <links>
9468                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9469                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9470                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9471                 </links>
9472         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9473             <actions>
9474                 <create   permission="ADMIN_INVOICE">
9475                                         <context link="invoice" field="receiver"/>
9476                                 </create>
9477                 <retrieve permission="ADMIN_INVOICE">
9478                                         <context link="invoice" field="receiver"/>
9479                                 </retrieve>
9480                 <update   permission="ADMIN_INVOICE">
9481                                         <context link="invoice" field="receiver"/>
9482                                 </update>
9483                                 <delete   permission="ADMIN_INVOICE">
9484                                         <context link="invoice" field="receiver"/>
9485                                 </delete>
9486             </actions>
9487         </permacrud>
9488         </class>
9489
9490         <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">
9491                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9492                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9493                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9494                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9495                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9496                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9497                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9498                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9499                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9500                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9501                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9502                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9503                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9504                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9505                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9506                 </fields>
9507                 <links>
9508                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9509                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9510                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9511                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9512                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9513                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9514                 </links>
9515         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9516             <actions>
9517                 <create   permission="ADMIN_INVOICE">
9518                                         <context link="invoice" field="receiver"/>
9519                                 </create>
9520                 <retrieve permission="ADMIN_INVOICE">
9521                                         <context link="invoice" field="receiver"/>
9522                                 </retrieve>
9523                 <update   permission="ADMIN_INVOICE">
9524                                         <context link="invoice" field="receiver"/>
9525                                 </update>
9526                                 <delete   permission="ADMIN_INVOICE">
9527                                         <context link="invoice" field="receiver"/>
9528                                 </delete>
9529             </actions>
9530         </permacrud>
9531         </class>
9532
9533         <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">
9534                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9535                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9536                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9537                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9538                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9539                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9540                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9541                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9542                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9543                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9544                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9545                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9546                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9547                 </fields>
9548                 <links>
9549                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9550                 </links>
9551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9552             <actions>
9553                 <create permission="ADMIN_PROVIDER">
9554                     <context link="provider" field="owner"/>
9555                 </create>
9556                 <retrieve permission="ADMIN_PROVIDER">
9557                     <context link="provider" field="owner"/>
9558                 </retrieve>
9559                 <update permission="ADMIN_PROVIDER">
9560                     <context link="provider" field="owner"/>
9561                 </update>
9562                 <delete permission="ADMIN_PROVIDER">
9563                     <context link="provider" field="owner"/>
9564                 </delete>
9565             </actions>
9566         </permacrud>
9567         </class>
9568
9569         <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">
9570                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9572                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9573                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9574                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9575                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9576                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9577                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9578         </fields>
9579                 <links>
9580                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9581                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9582                 </links>
9583         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9584             <actions>
9585                 <create permission="ADMIN_PROVIDER">
9586                     <context link="provider" field="owner"/>
9587                 </create>
9588                 <retrieve permission="ADMIN_PROVIDER">
9589                     <context link="provider" field="owner"/>
9590                 </retrieve>
9591                 <update permission="ADMIN_PROVIDER">
9592                     <context link="provider" field="owner"/>
9593                 </update>
9594                 <delete permission="ADMIN_PROVIDER">
9595                     <context link="provider" field="owner"/>
9596                 </delete>
9597             </actions>
9598         </permacrud>
9599     </class>
9600         <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">
9601                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9602                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9603                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9604                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9605                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9606                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9607                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9608                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9609                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9610                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9611                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9612                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9613                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9614                 </fields>
9615                 <links>
9616                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9617                 </links>
9618         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9619             <actions>
9620                 <create permission="ADMIN_PROVIDER">
9621                     <context link="contact" jump='provider' field="owner"/>
9622                 </create>
9623                 <retrieve permission="ADMIN_PROVIDER">
9624                     <context link="contact" jump='provider' field="owner"/>
9625                 </retrieve>
9626                 <update permission="ADMIN_PROVIDER">
9627                     <context link="contact" jump='provider' field="owner"/>
9628                 </update>
9629                 <delete permission="ADMIN_PROVIDER">
9630                     <context link="contact" jump='provider' field="owner"/>
9631                 </delete>
9632             </actions>
9633         </permacrud>
9634         </class>
9635
9636         <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">
9637                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9638                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9639                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9640                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9641                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9642                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9643                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9644                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9645                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9646                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9647                 </fields>
9648                 <links>
9649                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9650                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9651                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9652                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9653                 </links>
9654         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9655             <actions>
9656                 <create permission="ADMIN_ACQ_FUND">
9657                     <context link="src_fund" field="org"/>
9658                 </create>
9659                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9660                     <context link="src_fund" field="org"/>
9661                     <context link="dest_fund" field="org"/>
9662                 </retrieve>
9663                 <update permission="ADMIN_ACQ_FUND">
9664                     <context link="src_fund" field="org"/>
9665                 </update>
9666                 <delete permission="ADMIN_ACQ_FUND">
9667                     <context link="src_fund" field="org"/>
9668                 </delete>
9669             </actions>
9670         </permacrud>
9671         </class>
9672
9673         <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">
9674                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9675                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9676                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9677                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9678                 </fields>
9679                 <links>
9680             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9681                 </links>
9682                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9683                         <actions>
9684                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9685                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9686                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9687                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9688                         </actions>
9689                 </permacrud>
9690         </class>
9691
9692         <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">
9693                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9694                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9695                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9696                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9697                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9698                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9699                 </fields>
9700                 <links>
9701                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9702                 </links>
9703                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9704                         <actions>
9705                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9706                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9707                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9708                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9709                         </actions>
9710                 </permacrud>
9711         </class>
9712
9713         <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">
9714                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9715                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9716                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9717                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9718                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9719                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9720                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9721                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9722                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9723                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9724                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9725                 </fields>
9726                 <links>
9727                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9728                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9729             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9730             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9731                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9732                 </links>
9733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9734             <actions>
9735                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9736                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9737                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9738                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9739             </actions>
9740         </permacrud>
9741         </class>
9742
9743         <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">
9744                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9745                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9746                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9747                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9748                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9749                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9750                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9751                 </fields>
9752                 <links>
9753                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9754                 </links>
9755                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9756                         <actions>
9757                                 <create permission="ADMIN_FUNDING_SOURCE">
9758                     <context link="funding_source" field="owner"/>
9759                 </create>
9760                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9761                     <context link="funding_source" field="owner"/>
9762                 </retrieve>
9763                                 <update permission="ADMIN_FUNDING_SOURCE">
9764                     <context link="funding_source" field="owner"/>
9765                 </update>
9766                                 <delete permission="ADMIN_FUNDING_SOURCE">
9767                     <context link="funding_source" field="owner"/>
9768                 </delete>
9769                         </actions>
9770                 </permacrud>
9771         </class>
9772
9773         <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">
9774                 <fields oils_persist:primary="id">
9775                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9776                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9777                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9778                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9779                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9780                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9781                 </fields>
9782                 <links>
9783                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9784                 </links>
9785         </class>
9786
9787         <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">
9788                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9789                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9790                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9791                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9792                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9793                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9794                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9795                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9796                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9797                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9798                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9799                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9800                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9801                 </fields>
9802                 <links>
9803                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9804                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9805                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9806                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9807                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9808                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9809                 </links>
9810                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9811                         <actions>
9812                                 <create permission="ADMIN_ACQ_FUND">
9813                     <context link="fund" field="org"/>
9814                 </create>
9815                                 <retrieve permission="ADMIN_ACQ_FUND">
9816                     <context link="fund" field="org"/>
9817                 </retrieve>
9818                                 <update permission="ADMIN_ACQ_FUND">
9819                     <context link="fund" field="org"/>
9820                 </update>
9821                                 <delete permission="ADMIN_ACQ_FUND">
9822                     <context link="fund" field="org"/>
9823                 </delete>
9824                         </actions>
9825                 </permacrud>
9826         </class>
9827
9828         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9829                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9830                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9831                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9832                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9833                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9834                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9835                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9836                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9837                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9838                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9839                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9840                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9841                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9842                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9843                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9844                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9845                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9846                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9847                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9848                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9849                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9850                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9851                 </fields>
9852                 <links>
9853                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9854                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9855             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9856             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9857             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9858             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9859             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9860             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9861             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9862             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9863             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9864                 </links>
9865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9866             <actions>
9867                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9868                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9869                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9870                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9871             </actions>
9872         </permacrud>
9873         </class>
9874
9875         <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">
9876                 <fields oils_persist:primary="fund">
9877                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9878                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9879                 </fields>
9880                 <links>
9881                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9882                 </links>
9883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9884             <actions>
9885                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9886                                         <context link="fund" field="org" />
9887                 </retrieve>
9888             </actions>
9889         </permacrud>
9890         </class>
9891
9892         <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">
9893                 <fields oils_persist:primary="fund">
9894                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9895                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9896                 </fields>
9897                 <links>
9898                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9899                 </links>
9900         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9901             <actions>
9902                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9903                                         <context link="fund" field="org" />
9904                 </retrieve>
9905             </actions>
9906         </permacrud>
9907         </class>
9908
9909         <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">
9910                 <fields oils_persist:primary="fund">
9911                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9912                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9913                 </fields>
9914                 <links>
9915                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9916                 </links>
9917         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9918             <actions>
9919                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9920                                         <context link="fund" field="org" />
9921                 </retrieve>
9922             </actions>
9923         </permacrud>
9924         </class>
9925
9926         <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">
9927                 <fields oils_persist:primary="fund">
9928                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9929                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9930                 </fields>
9931                 <links>
9932                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9933                 </links>
9934         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9935             <actions>
9936                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9937                                         <context link="fund" field="org" />
9938                 </retrieve>
9939             </actions>
9940         </permacrud>
9941         </class>
9942
9943         <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">
9944                 <fields oils_persist:primary="fund">
9945                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9946                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9947                 </fields>
9948                 <links>
9949                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9950                 </links>
9951         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9952             <actions>
9953                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9954                                         <context link="fund" field="org" />
9955                 </retrieve>
9956             </actions>
9957         </permacrud>
9958         </class>
9959
9960    <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">
9961         <fields oils_persist:primary="fund">
9962             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9963             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9964         </fields>
9965         <links>
9966             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9967         </links>
9968     </class>
9969
9970    <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">
9971         <fields oils_persist:primary="fund">
9972             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9973             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9974         </fields>
9975         <links>
9976             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9977         </links>
9978     </class>
9979
9980    <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">
9981         <fields oils_persist:primary="fund">
9982             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9983             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9984         </fields>
9985         <links>
9986             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9987         </links>
9988     </class>
9989
9990    <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">
9991         <fields oils_persist:primary="fund">
9992             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9993             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
9994         </fields>
9995         <links>
9996             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9997         </links>
9998     </class>
9999
10000    <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">
10001         <fields oils_persist:primary="fund">
10002             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10003             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10004         </fields>
10005         <links>
10006             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10007         </links>
10008     </class>
10009
10010         <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">
10011                 <fields oils_persist:primary="funding_source">
10012                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10013                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10014                 </fields>
10015                 <links>
10016                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10017                 </links>
10018         </class>
10019
10020         <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">
10021                 <fields oils_persist:primary="funding_source">
10022                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10023                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10024                 </fields>
10025                 <links>
10026                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10027                 </links>
10028         </class>
10029
10030         <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">
10031                 <fields oils_persist:primary="funding_source">
10032                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10033                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10034                 </fields>
10035                 <links>
10036                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10037                 </links>
10038         </class>
10039
10040         <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">
10041                 <fields oils_persist:primary="fund">
10042                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10043                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10044                 </fields>
10045                 <links>
10046                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10047                 </links>
10048         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10049             <actions>
10050                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10051                                         <context link="fund" field="org" />
10052                 </retrieve>
10053             </actions>
10054         </permacrud>
10055     </class>
10056     <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">
10057         <oils_persist:source_definition><![CDATA[
10058             SELECT
10059                 acqf.*,
10060                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10061                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10062                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10063                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10064             FROM
10065                 acq.fund acqf
10066                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10067                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10068                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10069                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10070         ]]></oils_persist:source_definition>
10071         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10072             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10073             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10074             <field reporter:label="Name" name="name" reporter:datatype="text" />
10075             <field reporter:label="Year" name="year" reporter:datatype="int" />
10076             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10077             <field reporter:label="Code" name="code" reporter:datatype="text" />
10078             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10079             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10080             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10081             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10082             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10083
10084             <!-- non fund-native fields -->
10085             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10086             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10087             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10088             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10089         </fields>
10090         <links>
10091             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10092             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10093             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10094         </links>
10095         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10096             <actions>
10097                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10098             </actions>
10099         </permacrud>
10100         </class>
10101         <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">
10102                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10103                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10104                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10105                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10106                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10107                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10108                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10109                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10110                 </fields>
10111                 <links>
10112                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10113                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10114                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10115                 </links>
10116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10117                         <actions>
10118                                 <create permission="ADMIN_ACQ_FUND">
10119                     <context link="fund" field="org"/>
10120                 </create>
10121                                 <retrieve permission="ADMIN_ACQ_FUND">
10122                     <context link="fund" field="org"/>
10123                 </retrieve>
10124                                 <update permission="ADMIN_ACQ_FUND">
10125                     <context link="fund" field="org"/>
10126                 </update>
10127                                 <delete permission="ADMIN_ACQ_FUND">
10128                     <context link="fund" field="org"/>
10129                 </delete>
10130                         </actions>
10131                 </permacrud>
10132         </class>
10133
10134     <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">
10135         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10136             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10137             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10138             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10139             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10140             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10141             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10142             <field reporter:label="Note" name="note" reporter:datatype="text" />
10143             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10144         </fields>
10145         <links>
10146             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10147             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10148             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10149         </links>
10150                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10151                         <actions>
10152                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10153                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10154                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10155                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10156                         </actions>
10157                 </permacrud>
10158     </class>
10159
10160         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10161                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10162                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10163                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10164                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10165                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10166                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10167                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10168                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10169                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10170                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10171                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10172                 </fields>
10173                 <links>
10174                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10175                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10176                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10177                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10178                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10179                 </links>
10180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10181                         <actions>
10182                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10183                         </actions>
10184                 </permacrud>
10185         </class>
10186
10187         <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">
10188                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10189                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10190                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10191                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10192                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10193                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10194                 </fields>
10195                 <links>
10196                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10197                 </links>
10198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10199                         <actions>
10200                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10201                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10202                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10203                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10204                         </actions>
10205                 </permacrud>
10206         </class>
10207
10208         <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">
10209                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10210                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10211                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10212                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10213                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10214                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10215                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10216                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10217                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10218                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10219                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10220                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10221                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10222                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10223                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10224                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10225                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10226                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10227                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10228                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10229                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10230                 </fields>
10231                 <links>
10232                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10233                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10234                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10235                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10236                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10237                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10238                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10239                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10240                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10241                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10242                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10243                 </links>
10244                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10245                         <actions>
10246                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10247                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10248                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10249                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10250                         </actions>
10251                 </permacrud>
10252         </class>
10253
10254         <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">
10255                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10256                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10257                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10258                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10259                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10260                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10261                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10262                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10263                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10264                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10265                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10266                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10267                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10268                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10269                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10270                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10271                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10272                 </fields>
10273                 <links>
10274                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10275                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10276                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10277                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10278                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10279                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10280                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10281                 </links>
10282                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10283             <actions>
10284                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10285             </actions>
10286                 </permacrud>
10287         </class>
10288
10289         <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">
10290                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10291                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10292                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10293                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10294                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10295                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10296                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10297                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10298                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10299                 </fields>
10300                 <links>
10301                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10302                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10303                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10304                 </links>
10305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10306             <actions>
10307                 <create permission="CREATE_PURCHASE_ORDER">
10308                     <context link="purchase_order" field="ordering_agency"/>
10309                 </create>
10310                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10311                     <context link="purchase_order" field="ordering_agency"/>
10312                 </retrieve>
10313                 <update permission="CREATE_PURCHASE_ORDER">
10314                     <context link="purchase_order" field="ordering_agency"/>
10315                 </update>
10316                 <delete permission="CREATE_PURCHASE_ORDER">
10317                     <context link="purchase_order" field="ordering_agency"/>
10318                 </delete>
10319             </actions>
10320                 </permacrud>
10321         </class>
10322
10323         <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">
10324                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10325                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10326                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10327                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10328                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10329                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10330                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10331                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10332                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10333                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10334                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10335                 </fields>
10336                 <links>
10337                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10338                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10339                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10340                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10341                 </links>
10342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10343             <actions>
10344                 <create permission="CREATE_PURCHASE_ORDER">
10345                     <context link="purchase_order" field="ordering_agency"/>
10346                 </create>
10347                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10348                     <context link="purchase_order" field="ordering_agency"/>
10349                 </retrieve>
10350                 <update permission="CREATE_PURCHASE_ORDER">
10351                     <context link="purchase_order" field="ordering_agency"/>
10352                 </update>
10353                 <delete permission="CREATE_PURCHASE_ORDER">
10354                     <context link="purchase_order" field="ordering_agency"/>
10355                 </delete>
10356             </actions>
10357                 </permacrud>
10358         </class>
10359
10360         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10361                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10362                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10363                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10364                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10365                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10366                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10367                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10368                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10369                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10370                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10371                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10372                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10373                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10374                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10375                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10376                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10377                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10378                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10379                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10380                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10381                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10382                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10383                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10384                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10385                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10386                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10387                 </fields>
10388                 <links>
10389                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10390                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10391                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10392                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10393                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10394                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10395                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10396                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10397                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10398                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10399                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10400                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10401                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10402                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10403                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10404                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10405                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10406                 </links>
10407                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10408                         <actions>
10409                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10410                                         <context link="purchase_order" field="ordering_agency"/>
10411                                         <context link="picklist" field="org_unit"/>
10412                                 </retrieve>
10413                         </actions>
10414                 </permacrud>
10415         </class>
10416
10417         <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">
10418                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10419                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10420                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10421                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10422                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10423                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10424                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10425                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10426                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10427                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10428                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10429                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10430                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10431                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10432                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10433                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10434                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10435                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10436                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10437                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10438                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10439                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10440                 </fields>
10441                 <links>
10442                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10443                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10444                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10445                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10446                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10447                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10448                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10449                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10450                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10451                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10452                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10453                 </links>
10454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10455                         <actions>
10456                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10457                                         <context link="purchase_order" field="ordering_agency"/>
10458                                         <context link="picklist" field="org_unit"/>
10459                                 </retrieve>
10460                         </actions>
10461                 </permacrud>
10462         </class>
10463
10464         <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">
10465                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10466                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
10467                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10468                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10469                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10470                 </fields>
10471                 <links>
10472                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10473                 </links>
10474                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10475                         <actions>
10476                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10477                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10478                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10479                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10480                         </actions>
10481                 </permacrud>
10482         </class>
10483
10484         <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">
10485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10486                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10487                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10488                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10489                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10490                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10491                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10492                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10493                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10494                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10495                 </fields>
10496                 <links>
10497                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10498                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10499                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10500                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10501                 </links>
10502         </class>
10503
10504         <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">
10505                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10506                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10507                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10508                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10509                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10510                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10511                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10512                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10513                 </fields>
10514                 <links>
10515                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10516                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10517                 </links>
10518         </class>
10519
10520         <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">
10521                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10522                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10523                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10524                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10525                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10526                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10527                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10528                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10529                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10530                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10531                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10532                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10533                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10534                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10535                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10536                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10537                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10538                 </fields>
10539                 <links>
10540                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10541                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10542                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10543                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10544                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10545                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10546                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10547                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10548                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10549                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10550                 </links>
10551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10552             <actions>
10553                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10554                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10555                     <context link="lineitem" jump="picklist" field="org_unit"/>
10556                 </retrieve>
10557             </actions>
10558         </permacrud>
10559         </class>
10560
10561         <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">
10562                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10563                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10564                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10565                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10566                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10567                 </fields>
10568                 <links/>
10569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10570                         <actions>
10571                                 <retrieve />
10572                         </actions>
10573                 </permacrud>
10574         </class>
10575
10576         <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">
10577                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10578                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10579                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10580                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10581                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10582                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10583             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10584                 </fields>
10585                 <links/>
10586         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10587             <actions>
10588                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10589                 <retrieve />
10590                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10591                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10592             </actions>
10593         </permacrud>
10594         </class>
10595
10596         <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">
10597                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10598                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10599                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10600                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10601                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10602                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10603                 </fields>
10604                 <links/>
10605         </class>
10606         <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">
10607                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10608                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10609                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10610                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10611                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10612                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10613                 </fields>
10614                 <links>
10615                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10616                 </links>
10617         </class>
10618
10619         <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">
10620             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10621                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10622                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10623                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10624                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10625                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10626                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10627         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10628
10629             </fields>
10630             <links>
10631                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10632             </links>
10633             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10634                 <actions>
10635                     <create permission="ADMIN_PROVIDER">
10636                         <context link="provider" field="owner"/>
10637                     </create>
10638                     <retrieve permission="ADMIN_PROVIDER">
10639                         <context link="provider" field="owner"/>
10640                     </retrieve>
10641                     <update permission="ADMIN_PROVIDER">
10642                         <context link="provider" field="owner"/>
10643                     </update>
10644                     <delete permission="ADMIN_PROVIDER">
10645                         <context link="provider" field="owner"/>
10646                     </delete>
10647                 </actions>
10648             </permacrud>
10649         </class>
10650         
10651         <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">
10652             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10653                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10654                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10655                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10656                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10657             </fields>
10658             <links>
10659                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10660             </links>
10661             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10662                 <actions>
10663                     <create permission="ADMIN_PROVIDER">
10664                         <context link="provider" field="owner"/>
10665                     </create>
10666                     <retrieve permission="ADMIN_PROVIDER">
10667                         <context link="provider" field="owner"/>
10668                     </retrieve>
10669                     <update permission="ADMIN_PROVIDER">
10670                         <context link="provider" field="owner"/>
10671                     </update>
10672                     <delete permission="ADMIN_PROVIDER">
10673                         <context link="provider" field="owner"/>
10674                     </delete>
10675                 </actions>
10676             </permacrud>
10677         </class>
10678         
10679         <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">
10680             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10681                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10682                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10683                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10684                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10685                 </fields>
10686                 <links/>
10687         </class>
10688
10689         <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">
10690                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10691                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10692                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10693                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10694                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10695                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10696                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10697                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10698                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10699                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10700                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10701                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10702                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10703                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10704                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10705                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10706                 </fields>
10707                 <links>
10708                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10709                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10710                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10711                 </links>
10712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10713             <actions>
10714                 <create permission="ADMIN_PROVIDER">
10715                     <context link="provider" field="owner"/>
10716                 </create>
10717                 <retrieve permission="ADMIN_PROVIDER">
10718                     <context link="provider" field="owner"/>
10719                 </retrieve>
10720                 <update permission="ADMIN_PROVIDER">
10721                     <context link="provider" field="owner"/>
10722                 </update>
10723                 <delete permission="ADMIN_PROVIDER">
10724                     <context link="provider" field="owner"/>
10725                 </delete>
10726             </actions>
10727         </permacrud>
10728         </class>
10729
10730         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10731                 oils_obj:fieldmapper="acq::edi_attr" 
10732                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10733                 <fields oils_persist:primary="key">
10734                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10735                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10736                 </fields>
10737         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10738             <actions>
10739                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10740                 <retrieve/>
10741                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10742                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10743             </actions>
10744         </permacrud>
10745         </class>
10746         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10747                 oils_obj:fieldmapper="acq::edi_attr_set" 
10748                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10749                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10750                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10751                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10752                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10753                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10754                 </fields>
10755                 <links>
10756                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10757                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10758                 </links>
10759         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10760             <actions>
10761                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10762                 <retrieve/>
10763                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10764                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10765             </actions>
10766         </permacrud>
10767         </class>
10768         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10769                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10770                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10771                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10772                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10773                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10774                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10775                 </fields>
10776                 <links>
10777                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10778                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10779                 </links>
10780         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10781             <actions>
10782                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10783                 <retrieve/>
10784                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10785                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10786             </actions>
10787         </permacrud>
10788         </class>
10789
10790
10791         <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">
10792                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10793                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10794                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10795                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10796                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10797                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10798                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10799                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10800                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10801                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10802                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10803                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10804                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10805                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10806                 </fields>
10807                 <links>
10808                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10809                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10810                 </links>
10811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10812             <actions>
10813                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10814                     <context link="account" jump="provider" field="owner"/>
10815                 </retrieve>
10816                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10817                     <context link="account" jump="provider" field="owner"/>
10818                 </update>
10819                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10820                     <context link="account" jump="provider" field="owner"/>
10821                 </delete>
10822             </actions>
10823         </permacrud>
10824         </class>
10825
10826
10827         <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">
10828                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10829                         <field name="id" reporter:datatype="id" />
10830                         <field name="parent" reporter:datatype="link"/>
10831                         <field name="owner" reporter:datatype="link"/>
10832                         <field name="create_time" reporter:datatype="timestamp"/>
10833                         <field name="name" reporter:datatype="text"/>
10834                         <field name="shared" reporter:datatype="bool"/>
10835                         <field name="share_with" reporter:datatype="link"/>
10836                         <field name="simple_reporter" reporter:datatype="bool"/>
10837                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10838                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10839                 </fields>
10840                 <links>
10841                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10842                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10843                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10844                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10845                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10846                 </links>
10847         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10848             <actions>
10849                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10850                     <context link="owner" field="home_ou"/>
10851                 </create>
10852                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10853                     <context link="owner" field="home_ou"/>
10854                 </retrieve>
10855                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10856                     <context link="owner" field="home_ou"/>
10857                 </update>
10858                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10859                     <context link="owner" field="home_ou"/>
10860                 </delete>
10861             </actions>
10862         </permacrud>
10863         </class>
10864         <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">
10865                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10866                         <field name="id" reporter:datatype="id" />
10867                         <field name="parent" reporter:datatype="link"/>
10868                         <field name="owner" reporter:datatype="link"/>
10869                         <field name="create_time" reporter:datatype="timestamp"/>
10870                         <field name="name" reporter:datatype="text"/>
10871                         <field name="shared" reporter:datatype="bool"/>
10872                         <field name="share_with" reporter:datatype="link"/>
10873                         <field name="simple_reporter" reporter:datatype="bool"/>
10874                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10875                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10876                 </fields>
10877                 <links>
10878                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10879                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10880                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10881                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10882                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10883                 </links>
10884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10885             <actions>
10886                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10887                     <context link="owner" field="home_ou"/>
10888                 </create>
10889                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10890                     <context link="owner" field="home_ou"/>
10891                 </retrieve>
10892                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10893                     <context link="owner" field="home_ou"/>
10894                 </update>
10895                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10896                     <context link="owner" field="home_ou"/>
10897                 </delete>
10898             </actions>
10899         </permacrud>
10900         </class>
10901         <class id="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">
10902                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10903                         <field name="id" reporter:datatype="id" />
10904                         <field name="parent" reporter:datatype="link"/>
10905                         <field name="owner" reporter:datatype="link"/>
10906                         <field name="create_time" reporter:datatype="timestamp"/>
10907                         <field name="name" reporter:datatype="text"/>
10908                         <field name="shared" reporter:datatype="bool"/>
10909                         <field name="share_with" reporter:datatype="link"/>
10910                         <field name="simple_reporter" reporter:datatype="bool"/>
10911                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10912                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10913                 </fields>
10914                 <links>
10915                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10916                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10917                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10918                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10919                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10920                 </links>
10921         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10922             <actions>
10923                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10924                     <context link="owner" field="home_ou"/>
10925                 </create>
10926                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10927                     <context link="owner" field="home_ou"/>
10928                 </retrieve>
10929                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10930                     <context link="owner" field="home_ou"/>
10931                 </update>
10932                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10933                     <context link="owner" field="home_ou"/>
10934                 </delete>
10935             </actions>
10936         </permacrud>
10937         </class>
10938         <class id="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">
10939                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10940                         <field name="id" reporter:datatype="id" />
10941                         <field name="owner" reporter:datatype="link"/>
10942                         <field name="create_time" reporter:datatype="timestamp"/>
10943                         <field name="name" reporter:datatype="text"/>
10944                         <field name="data" reporter:datatype="text"/>
10945                         <field name="folder" reporter:datatype="link"/>
10946                         <field name="description" reporter:datatype="text"/>
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="folder" reltype="has_a" key="id" map="" class="rtf"/>
10952                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10953                 </links>
10954         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10955             <actions>
10956                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10957                     <context link="owner" field="home_ou"/>
10958                 </create>
10959                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10960                     <context link="owner" field="home_ou"/>
10961                 </retrieve>
10962                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10963                     <context link="owner" field="home_ou"/>
10964                 </update>
10965                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10966                     <context link="owner" field="home_ou"/>
10967                 </delete>
10968             </actions>
10969         </permacrud>
10970         </class>
10971         <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">
10972                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10973                         <field name="id" reporter:datatype="id" />
10974                         <field name="owner" reporter:datatype="link"/>
10975                         <field name="create_time" reporter:datatype="timestamp"/>
10976                         <field name="template" reporter:datatype="link"/>
10977                         <field name="data" reporter:datatype="text"/>
10978                         <field name="folder" reporter:datatype="link"/>
10979                         <field name="recur" reporter:datatype="bool"/>
10980                         <field name="recurrence" reporter:datatype="interval"/>
10981                         <field name="name" reporter:datatype="text"/>
10982                         <field name="description" reporter:datatype="text"/>
10983                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10984                 </fields>
10985                 <links>
10986                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10987                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10988                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10989                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10990                 </links>
10991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10992             <actions>
10993                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10994                     <context link="owner" field="home_ou"/>
10995                 </create>
10996                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10997                     <context link="owner" field="home_ou"/>
10998                 </retrieve>
10999                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11000                     <context link="owner" field="home_ou"/>
11001                 </update>
11002                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11003                     <context link="owner" field="home_ou"/>
11004                 </delete>
11005             </actions>
11006         </permacrud>
11007         </class>
11008         <class id="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">
11009                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11010                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11011                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11012                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11013                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11014                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11015                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11016                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11017                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11018                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11019                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11020                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11021                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11022                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11023                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11024                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11025                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11026                 </fields>
11027                 <links>
11028                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11029                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11030                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11031                 </links>
11032         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11033             <actions>
11034                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11035                     <context link="runner" field="home_ou"/>
11036                 </create>
11037                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11038                     <context link="runner" field="home_ou"/>
11039                 </retrieve>
11040                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11041                     <context link="runner" field="home_ou"/>
11042                 </update>
11043                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11044                     <context link="runner" field="home_ou"/>
11045                 </delete>
11046             </actions>
11047         </permacrud>
11048         </class>
11049     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11050            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11051            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11052                 <fields oils_persist:primary="run">
11053             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11054             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11055             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11056             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11057             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11058             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11059             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11060             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11061             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11062             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11063             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11064             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11065             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11066             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11067             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11068             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11069                 </fields>
11070                 <links>
11071             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11072             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11073             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11074             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11075             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11076             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11077             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11078             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11079             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11080                 </links>
11081         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11082             <actions>
11083                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11084                     <context link="runner" field="home_ou"/>
11085                 </retrieve>
11086             </actions>
11087         </permacrud>
11088     </class>
11089         <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">
11090                 <fields oils_persist:primary="id">
11091                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11092                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11093                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11094                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11095                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11096                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11097                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11098                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11099                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11100                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11101                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11102                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11103                 </fields>
11104                 <links>
11105                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11106                 </links>
11107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11108                         <actions>
11109                                 <retrieve />
11110                         </actions>
11111                 </permacrud>
11112         </class>
11113         <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">
11114                 <fields oils_persist:primary="id">
11115                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11116                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11117                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11118                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11119                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11120                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11121                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11122                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11123                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11124                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11125                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11126                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11127                 </fields>
11128                 <links>
11129                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11130                 </links>
11131         </class>
11132         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11133                 <fields oils_persist:primary="id">
11134                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11135                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11136                         <field reporter:label="Fingerprint" name="fingerprint" />
11137                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11138                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11139                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11140                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11141                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11142                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11143                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11144                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11145                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11146                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11147                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11148                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11149                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11150                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11151                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11152                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11153                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11154                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11155                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11156                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11157                 </fields>
11158                 <links>
11159                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11160                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11161                 </links>
11162         </class>
11163         <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">
11164                 <fields oils_persist:primary="id">
11165                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11166                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11167                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11168                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11169                 </fields>
11170                 <links>
11171                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11172                 </links>
11173         </class>
11174         <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">
11175                 <fields oils_persist:primary="id">
11176                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11177                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11178                 </fields>
11179                 <links>
11180                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11181                 </links>
11182         </class>
11183         <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">
11184                 <fields oils_persist:primary="id">
11185                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11186                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11187                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11188                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11189                 </fields>
11190                 <links>
11191                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11192                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11193                 </links>
11194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11195                         <actions>
11196                                 <retrieve permission="VIEW_HOLD">
11197                                         <context link="id" field="pickup_lib"/>
11198                                 </retrieve>
11199                         </actions>
11200                 </permacrud>
11201         </class>
11202         <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">
11203                 <fields oils_persist:primary="xact">
11204                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11205                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11206                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11207                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11208                 </fields>
11209                 <links>
11210                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11211                 </links>
11212         </class>
11213         <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">
11214                 <fields oils_persist:primary="xact">
11215                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11216                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11217                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11218                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11219                 </fields>
11220                 <links>
11221                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11222                 </links>
11223         </class>
11224         <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)">
11225                 <fields oils_persist:primary="id">
11226                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11227                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11228                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11229                 </fields>
11230                 <links>
11231                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11232                 </links>
11233         </class>
11234         <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">
11235                 <fields oils_persist:primary="id">
11236                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11237                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11238                 </fields>
11239                 <links>
11240                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11241                 </links>
11242                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11243                         <actions>
11244                                 <retrieve permission="STAFF_LOGIN">
11245                                         <context link="id" field="circ_lib"/>
11246                                 </retrieve>
11247                         </actions>
11248                 </permacrud>
11249         </class>
11250         <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">
11251                 <fields oils_persist:primary="bibid">
11252                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11253                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11254                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11255                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11256                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11257                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11258                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11259                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11260                 </fields>
11261                 <links>
11262                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11263                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11264                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11265                 </links>
11266         </class>
11267         <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">
11268                 <fields oils_persist:primary="copy_id">
11269                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11270                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11271                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11272                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11273                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11274                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11275                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11276                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11277                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11278                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11279                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11280                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11281                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11282                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11283                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11284                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11285                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11286                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11287                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11288                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11289                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11290                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11291                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11292                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11293                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11294                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11295                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11296                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11297                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11298                 </fields>
11299                 <links>
11300                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11301                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11302                 </links>
11303         </class>
11304         <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">
11305                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11306                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11307                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11308                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11309                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11310                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11311                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11312                 </fields>
11313                 <links>
11314                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11315                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11316                 </links>
11317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11318                         <actions>
11319                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11320                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11321                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11322                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11323                         </actions>
11324                 </permacrud>
11325         </class>
11326         <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">
11327                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11328                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11329                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11330                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11331                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11332                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11333                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11334                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11335                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11336                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11337                 </fields>
11338                 <links>
11339                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11340                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11341                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11342                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11343                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11344                 </links>
11345                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11346                         <actions>
11347                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11348                                         <context link="formula" field="owner"/>
11349                                 </create>
11350                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11351                                         <context link="formula" field="owner"/>
11352                                 </retrieve>
11353                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11354                                         <context link="formula" field="owner"/>
11355                                 </update>
11356                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11357                                         <context link="formula" field="owner"/>
11358                                 </delete>
11359                         </actions>
11360                 </permacrud>
11361         </class>
11362
11363         <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">
11364                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11365                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11366                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11367                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11368                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11369                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11370                 </fields>
11371                 <links>
11372                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11373                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11374                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11375                 </links>
11376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11377                         <actions>
11378                                 <create permission="CREATE_PURCHASE_ORDER">
11379                                         <context link="formula" field="owner"/>
11380                 </create>
11381                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11382                                         <context link="formula" field="owner"/>
11383                 </retrieve>
11384                                 <update permission="CREATE_PURCHASE_ORDER">
11385                                         <context link="formula" field="owner"/>
11386                 </update>
11387                                 <delete permission="CREATE_PURCHASE_ORDER">
11388                                         <context link="formula" field="owner"/>
11389                 </delete>
11390                         </actions>
11391                 </permacrud>
11392         </class>
11393
11394         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11395                 <fields oils_persist:primary="id">
11396                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11397                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11398                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11399                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11400                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11401                 </fields>
11402                 <links>
11403                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11404                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11405                 </links>
11406         </class>
11407
11408         <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">
11409                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11410                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11411                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11412                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11413                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11414                 </fields>
11415                 <links>
11416                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11417                 </links>
11418                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11419                         <actions>
11420                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11421                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11422                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11423                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11424                         </actions>
11425                 </permacrud>
11426         </class>
11427
11428         <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">
11429                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11430                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11431                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11432                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11433                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11434                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11435                 </fields>
11436                 <links>
11437                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11438                 </links>
11439                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11440                         <actions>
11441                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11442                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11443                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11444                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11445                         </actions>
11446                 </permacrud>
11447         </class>
11448
11449         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11450                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11451                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11452                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11453                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11454                 </fields>
11455                 <links>
11456                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11457                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11458                 </links>
11459         </class>
11460
11461         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11462                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11463                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11464                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11465                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11466                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11467                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11468                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11469                 </fields>
11470                 <links>
11471                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11472                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11473                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11474                 </links>
11475         </class>
11476
11477         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11478                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11479                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11480                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11481                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11482                 </fields>
11483                 <links>
11484                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11485                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11486                 </links>
11487         </class>
11488
11489         <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">
11490                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11491                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11492                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11493                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11494                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11495                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11496                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11497                 </fields>
11498                 <links>
11499                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11500                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11501                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11502                 </links>
11503         </class>
11504
11505         <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">
11506                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11507                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11508                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11509                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11510                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11511                 </fields>
11512                 <links>
11513                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11514                 </links>
11515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11516             <actions>
11517                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11518                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11519                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11520                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11521             </actions>
11522                 </permacrud>
11523         </class>
11524
11525         <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">
11526                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11527                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11528                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11529                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11530                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11531                 </fields>
11532                 <links>
11533                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11534                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11535                 </links>
11536                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11537                         <actions>
11538                                 <create permission="ADMIN_CLAIM_POLICY">
11539                                         <context link="claim_policy" field="org_unit"/>
11540                 </create>
11541                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11542                                         <context link="claim_policy" field="org_unit"/>
11543                 </retrieve>
11544                                 <update permission="ADMIN_CLAIM_POLICY">
11545                                         <context link="claim_policy" field="org_unit"/>
11546                 </update>
11547                                 <delete permission="ADMIN_CLAIM_POLICY">
11548                                         <context link="claim_policy" field="org_unit"/>
11549                 </delete>
11550                         </actions>
11551                 </permacrud>
11552         </class>
11553
11554     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11555         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11556             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11557             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11558             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11559             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11560             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11561             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11562             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11563             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11564             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11565             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11566             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11567             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11568             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11569             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11570             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11571             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11572                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11573                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11574                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11575         </fields>
11576         <links>
11577             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11578             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11579         </links>
11580     </class>
11581
11582     <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">
11583         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11584             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11585             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11586             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11587             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11588             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11589         </fields>
11590     </class>
11591
11592     <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">
11593         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11594             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11595             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11596             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11597             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11598             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11599             <field reporter:label="City" name="city" reporter:datatype="text"/>
11600             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11601             <field reporter:label="State" name="state" reporter:datatype="text"/>
11602             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11603             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11604             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11605         </fields>
11606     </class>
11607
11608     <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">
11609         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11610             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11611             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11612             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11613             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11614             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11615             <field reporter:label="City" name="city" reporter:datatype="text"/>
11616             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11617             <field reporter:label="State" name="state" reporter:datatype="text"/>
11618             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11619             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11620             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11621         </fields>
11622     </class>
11623
11624     <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">
11625         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11626             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11627             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11628             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11629             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11630             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11631             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11632         </fields>
11633     </class>
11634
11635     <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">
11636         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11637             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11638             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11639             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11640             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11641             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11642             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11643         </fields>
11644     </class>
11645
11646         <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">
11647                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11648                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11649                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11650                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11651                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11652                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11653                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11654                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11655                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11656                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11657                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11658                 </fields>
11659                 <links>
11660                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11661                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11662                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11663                 </links>
11664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11665                         <actions>
11666                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11667                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11668                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11669                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11670                         </actions>
11671                 </permacrud>
11672         </class>
11673
11674         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11675                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11676                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11677                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11678                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11679                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11680                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11681                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11682                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11683                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11684                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11685                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11686                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11687                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11688                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11689                 </fields>
11690                 <links>
11691                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11692                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11693                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11694                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11695                 </links>
11696                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11697                         <actions>
11698                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11699                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11700                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11701                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11702                         </actions>
11703                 </permacrud>
11704         </class>
11705
11706         <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">
11707                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11708                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11709                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11710                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11711                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11712                 </fields>
11713                 <links>
11714                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11715                 </links>
11716                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11717                         <actions>
11718                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11719                     <context link="fieldset" field="owning_lib"/>
11720                 </create>
11721                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11722                     <context link="fieldset" field="owning_lib"/>
11723                 </retrieve>
11724                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11725                     <context link="fieldset" field="owning_lib"/>
11726                 </update>
11727                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11728                     <context link="fieldset" field="owning_lib"/>
11729                 </delete>
11730                         </actions>
11731                 </permacrud>
11732         </class>
11733
11734     <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">
11735         <fields>
11736             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11737             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11738             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11739         </fields>
11740                 <links>
11741                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11742                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11743                 </links>
11744     </class>
11745
11746     <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">
11747         <fields>
11748             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11749             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11750         </fields>
11751                 <links>
11752                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11753                 </links>
11754     </class>
11755
11756     <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">
11757         <fields>
11758             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11759             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11760             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11761         </fields>
11762                 <links>
11763                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11764                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11765                 </links>
11766     </class>
11767
11768     <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">
11769         <fields>
11770             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11771             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11772         </fields>
11773                 <links>
11774                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11775                 </links>
11776     </class>
11777
11778     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11779                 <oils_persist:source_definition><![CDATA[
11780
11781             SELECT  DISTINCT l.*
11782               FROM  action.unfulfilled_hold_loops l
11783                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11784               WHERE l.count = m.max
11785
11786                 ]]></oils_persist:source_definition>
11787         <fields>
11788             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11789             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11790             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11791         </fields>
11792                 <links>
11793                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11794                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11795                 </links>
11796     </class>
11797
11798         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11799                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11800                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11801                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11802                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11803                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11804                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11805                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11806                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11807                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11808                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11809                 </fields>
11810                 <links>
11811                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11812                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11813                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11814                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11815                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11816                 </links>
11817         </class>
11818
11819         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11820                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11821                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11822                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11823                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11824                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11825                 </fields>
11826                 <links>
11827                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11828                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11829                 </links>
11830         </class>
11831
11832         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11833                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11834                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11835                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11836                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11837                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11838                 </fields>
11839                 <links>
11840                 </links>
11841         </class>
11842
11843         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11844                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11845                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11846                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11847                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11848                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11849                 </fields>
11850                 <links>
11851                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11852                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11853                 </links>
11854         </class>
11855         
11856         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11857                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11858                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11859                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11860                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11861                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11862                 </fields>
11863                 <links>
11864                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11865                 </links>
11866         </class>
11867         
11868         <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">
11869                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11870                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11871                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11872                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11873                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11874                 </fields>
11875                 <links>
11876                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11877                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11878                 </links>
11879         </class>
11880
11881         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11882                 <fields oils_persist:primary="name">
11883                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11884                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11885                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11886                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11887                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11888                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11889                 </fields>
11890                 <links>
11891                 </links>
11892         </class>
11893
11894         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11895                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11896                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11897                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11898                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11899                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11900                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11901                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11902                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11903                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11904                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11905                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11906                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11907                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11908                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11909                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11910                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11911                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11912                 </fields>
11913                 <links>
11914                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11915                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11916                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11917                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11918                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11919                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11920                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11921                 </links>
11922         </class>
11923
11924         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11925                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11926                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11927                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11928                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11929                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11930                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11931                 </fields>
11932                 <links>
11933                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11934                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11935                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11936                 </links>
11937         </class>
11938
11939         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11940                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11941                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11942                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11943                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11944                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11945                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11946                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11947                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11948                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11949                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11950                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11951                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11952                 </fields>
11953                 <links>
11954                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11955                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11956                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11957                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11958                 </links>
11959         </class>
11960
11961         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11962                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11963                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11964                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11965                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11966                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11967                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11968                 </fields>
11969                 <links>
11970                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11971                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11972                 </links>
11973         </class>
11974
11975         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11976                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11977                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11978                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11979                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11980                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11981                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11982                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11983                 </fields>
11984                 <links>
11985                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11986                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11987                 </links>
11988         </class>
11989
11990         <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">
11991                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
11992                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
11993                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11994                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11995                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11996                 </fields>
11997                 <links>
11998                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11999                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12000                 </links>
12001         </class>
12002
12003         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12004                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12005                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12006                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12007                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12008                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12009                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12010                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12011                 </fields>
12012                 <links>
12013                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12014                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12015                 </links>
12016         </class>
12017
12018         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12019                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12020                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12021                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12022                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12023                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12024                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12025                 </fields>
12026                 <links>
12027                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12028                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12029                 </links>
12030         </class>
12031
12032         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12033                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12034                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12035                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12036                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12037                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12038                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12039                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12040                 </fields>
12041                 <links>
12042                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12043                 </links>
12044         </class>
12045
12046         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12047                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12048                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12049                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12050                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12051                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12052                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12053                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12054                 </fields>
12055                 <links>
12056                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12057                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12058                 </links>
12059         </class>
12060
12061         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12062                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12063                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12064                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12065                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12066                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12067                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12068                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12069                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12070                 </fields>
12071                 <links>
12072                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12073                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12074                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12075                 </links>
12076         </class>
12077
12078         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12079                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12080                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12081                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12082                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12083                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12084                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12085                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
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                 </links>
12091         </class>
12092
12093         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12094                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12095                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12096                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12097                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12098                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12099                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12100                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12101                 </fields>
12102                 <links>
12103                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12104                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12105                 </links>
12106         </class>
12107
12108         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12109                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12110                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12111                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12112                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12113                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12114                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12115                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12116                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12117                 </fields>
12118                 <links>
12119                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12120                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12121                 </links>
12122         </class>
12123
12124         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12125                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12126                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12127                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12128                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12129                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12130                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12131                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12132                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12133                 </fields>
12134                 <links>
12135                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12136                         <link field="left_operand" 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="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL 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="Left Operand" name="left_operand" reporter:datatype="link"/>
12148                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12149                 </fields>
12150                 <links>
12151                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12152                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12153                 </links>
12154         </class>
12155
12156         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12157                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12158                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12159                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12160                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12161                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12162                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12163                 </fields>
12164                 <links>
12165                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12166                 </links>
12167         </class>
12168
12169         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12170                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12171                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12172                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12173                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12174                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12175                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12176                 </fields>
12177                 <links>
12178                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12179                 </links>
12180         </class>
12181
12182         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12183                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12184                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12185                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12186                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12187                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12188                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12189                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12190                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12191                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12192                 </fields>
12193                 <links>
12194                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12195                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12196                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12197                 </links>
12198         </class>
12199
12200         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12201                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12202                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12203                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12204                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12205                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12206                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12207                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12208                 </fields>
12209                 <links>
12210                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12211                 </links>
12212         </class>
12213
12214         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12215                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12216                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12217                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12218                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12219                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12220                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12221                 </fields>
12222                 <links>
12223                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12224                 </links>
12225         </class>
12226
12227         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12228                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12229                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12230                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12231                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12232                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12233                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12234                 </fields>
12235                 <links>
12236                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12237                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12238                 </links>
12239         </class>
12240
12241         <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">
12242                 <fields oils_persist:primary="id">
12243                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12244                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12245                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12246                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12247                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12248                 </fields>
12249                 <links>
12250                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12251                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12252                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12253                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12254                 </links>
12255         </class>
12256
12257         <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">
12258                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12259                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12260                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12261                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12262                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12263                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12264                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12265                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12266                 </fields>
12267                 <links/>
12268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12269                         <actions>
12270                                 <retrieve/>
12271                         </actions>
12272                 </permacrud>
12273         </class>
12274
12275         <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">
12276                 <fields oils_persist:primary="ptype_key">
12277                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12278                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12279                 </fields>
12280                 <links/>
12281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12282                         <actions>
12283                                 <retrieve/>
12284                         </actions>
12285                 </permacrud>
12286         </class>
12287
12288         <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">
12289                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12290                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12291                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12292                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12293                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12294                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12295                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12296                 </fields>
12297                 <links>
12298                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12299                 </links>
12300                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12301                         <actions>
12302                                 <retrieve/>
12303                         </actions>
12304                 </permacrud>
12305         </class>
12306
12307         <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">
12308                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12309                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12310                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12311                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12312                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12313                 </fields>
12314                 <links>
12315                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12316                 </links>
12317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12318                         <actions>
12319                                 <retrieve/>
12320                         </actions>
12321                 </permacrud>
12322         </class>
12323
12324     <class
12325         id="uvs"
12326         controller="open-ils.cstore open-ils.pcrud"
12327         oils_obj:fieldmapper="url_verify::session"
12328         oils_persist:tablename="url_verify.session"
12329         reporter:label="URL Verification Session"
12330     >
12331         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12332             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12333             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12334                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12335             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12336             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12337             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12338             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12339             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12340             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12341         </fields>
12342
12343         <links>
12344             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12345             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12346             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12347             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12348             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12349         </links>
12350
12351         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12352             <actions>
12353                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12354             </actions>
12355         </permacrud>
12356
12357     </class>
12358
12359     <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">
12360         <oils_persist:source_definition><![CDATA[
12361             SELECT
12362                 cbrebi.id AS id,  -- so we can have a pkey in our view
12363                 uvs.id AS session,
12364                 uvs.owning_lib,
12365                 cbrebi.target_biblio_record_entry
12366             FROM url_verify.session uvs
12367             JOIN container.biblio_record_entry_bucket cbreb
12368                 ON (uvs.container = cbreb.id)
12369             JOIN container.biblio_record_entry_bucket_item cbrebi
12370                 ON (cbrebi.bucket = cbreb.id)
12371         ]]></oils_persist:source_definition>
12372         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12373             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12374             <field reporter:label="Session" name="session" reporter:datatype="link" />
12375             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12376             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12377         </fields>
12378         <links>
12379             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12380             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12381             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12382         </links>
12383         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12384             <actions>
12385                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12386             </actions>
12387         </permacrud>
12388     </class>
12389
12390     <class
12391         id="uvus"
12392         controller="open-ils.cstore open-ils.pcrud"
12393         oils_obj:fieldmapper="url_verify::url_selector"
12394         oils_persist:tablename="url_verify.url_selector"
12395         reporter:label="URL Verification URL Selector"
12396     >
12397         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12398             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12399             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12400                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12401             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12402         </fields>
12403
12404         <links>
12405             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12406             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12407         </links>
12408
12409         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12410             <actions>
12411                 <create permission="URL_VERIFY">
12412                     <context link="session" field="owning_lib"/>
12413                 </create>
12414                 <retrieve permission="URL_VERIFY">
12415                     <context link="session" field="owning_lib"/>
12416                 </retrieve>
12417                 <update permission="URL_VERIFY">
12418                     <context link="session" field="owning_lib"/>
12419                 </update>
12420                 <delete permission="URL_VERIFY">
12421                     <context link="session" field="owning_lib"/>
12422                 </delete>
12423             </actions>
12424         </permacrud>
12425
12426     </class>
12427
12428     <class
12429         id="uvu"
12430         controller="open-ils.cstore open-ils.pcrud"
12431         oils_obj:fieldmapper="url_verify::url"
12432         oils_persist:tablename="url_verify.url"
12433         reporter:label="URL Verification URL"
12434     >
12435         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12436             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12437                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12438                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12439                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12440                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12441             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12442             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12443             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12444             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12445             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12446             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12447             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12448             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12449             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12450             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12451             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12452             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12453             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12454         </fields>
12455
12456         <links>
12457             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12458             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12459             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12460             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12461             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12462         </links>
12463
12464         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12465             <actions>
12466                 <create permission="URL_VERIFY">
12467                     <context link="session" field="owning_lib"/>
12468                 </create>
12469                 <retrieve permission="URL_VERIFY">
12470                     <context link="session" field="owning_lib"/>
12471                 </retrieve>
12472                 <update permission="URL_VERIFY">
12473                     <context link="session" field="owning_lib"/>
12474                 </update>
12475                 <delete permission="URL_VERIFY">
12476                     <context link="session" field="owning_lib"/>
12477                 </delete>
12478             </actions>
12479         </permacrud>
12480
12481     </class>
12482
12483     <class
12484         id="uvva"
12485         controller="open-ils.cstore open-ils.pcrud"
12486         oils_obj:fieldmapper="url_verify::verification_attempt"
12487         oils_persist:tablename="url_verify.verification_attempt"
12488         reporter:label="URL Verification Attempt"
12489     >
12490         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12491             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12492                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12493                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12494             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12495             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12496         </fields>
12497
12498         <links>
12499             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12500             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12501         </links>
12502
12503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12504             <actions>
12505                 <create permission="URL_VERIFY">
12506                     <context link="session" field="owning_lib"/>
12507                 </create>
12508                 <retrieve permission="URL_VERIFY">
12509                     <context link="session" field="owning_lib"/>
12510                 </retrieve>
12511                 <update permission="URL_VERIFY">
12512                     <context link="session" field="owning_lib"/>
12513                 </update>
12514                 <delete permission="URL_VERIFY">
12515                     <context link="session" field="owning_lib"/>
12516                 </delete>
12517             </actions>
12518         </permacrud>
12519
12520     </class>
12521
12522     <class
12523         id="uvuv"
12524         controller="open-ils.cstore open-ils.pcrud"
12525         oils_obj:fieldmapper="url_verify::url_verification"
12526         oils_persist:tablename="url_verify.url_verification"
12527         reporter:label="URL Verification"
12528     >
12529         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12530             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12531                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12532                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12533             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12534             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12535             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12536             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12537                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12538         </fields>
12539
12540         <links>
12541             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12542             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12543             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12544         </links>
12545
12546         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12547             <actions>
12548                 <create permission="URL_VERIFY">
12549                     <context link="attempt" jump="session" field="owning_lib"/>
12550                 </create>
12551                 <retrieve permission="URL_VERIFY">
12552                     <context link="attempt" jump="session" field="owning_lib"/>
12553                 </retrieve>
12554                 <update permission="URL_VERIFY">
12555                     <context link="attempt" jump="session" field="owning_lib"/>
12556                 </update>
12557                 <delete permission="URL_VERIFY">
12558                     <context link="attempt" jump="session" field="owning_lib"/>
12559                 </delete>
12560             </actions>
12561         </permacrud>
12562
12563     </class>
12564
12565         <class
12566                 id="cfdi"
12567                 controller="open-ils.cstore open-ils.pcrud"
12568                 oils_obj:fieldmapper="config::filter_dialog_interface"
12569                 oils_persist:tablename="config.filter_dialog_interface"
12570                 reporter:label="FilterDialog Interface">
12571                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12572                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12573                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12574                 </fields>
12575                 <links>
12576                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12577                 </links>
12578                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12579                         <actions>
12580                                 <retrieve />
12581                         </actions>
12582                 </permacrud>
12583         </class>
12584
12585         <class
12586                 id="cfdfs"
12587                 controller="open-ils.cstore open-ils.pcrud"
12588                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12589                 oils_persist:tablename="config.filter_dialog_filter_set"
12590                 reporter:label="FilterDialog Filter Set">
12591                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12592                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12593                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12594                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12595                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12596                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12597                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12598                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12599                 </fields>
12600                 <links>
12601                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12602                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12603                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12604                 </links>
12605                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12606                         <actions>
12607                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12608                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12609                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12610                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12611                         </actions>
12612                 </permacrud>
12613
12614         </class>
12615
12616         <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">
12617                 <fields oils_persist:primary="code">
12618                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12619                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12620                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12621                 </fields>
12622                 <links/>
12623                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12624                         <actions>
12625                                 <retrieve/>
12626                         </actions>
12627                 </permacrud>
12628         </class>
12629
12630         <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">
12631                 <oils_persist:source_definition><![CDATA[
12632
12633             SELECT  b.id,
12634                     MAX(dcp.edit_date) AS last_delete_date
12635              FROM   biblio.record_entry b
12636                     JOIN asset.call_number cn ON (cn.record = b.id)
12637                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12638              WHERE  NOT b.deleted
12639              GROUP BY b.id
12640              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12641
12642                 ]]></oils_persist:source_definition>
12643                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12644                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12645                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12646                 </fields>
12647                 <links>
12648                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12649                 </links>
12650                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12651                         <actions>
12652                                 <retrieve/>
12653                         </actions>
12654                 </permacrud>
12655         </class>
12656
12657         <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">
12658                 <fields oils_persist:primary="id">
12659                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12660                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12661                 </fields>
12662                 <links/>
12663                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12664                         <actions>
12665                                 <retrieve/>
12666                         </actions>
12667                 </permacrud>
12668         </class>
12669
12670         <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">
12671                 <fields oils_persist:primary="id">
12672                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12673                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12674                 </fields>
12675                 <links/>
12676                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12677                         <actions>
12678                                 <retrieve/>
12679                         </actions>
12680                 </permacrud>
12681         </class>
12682
12683
12684         <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">
12685                 <oils_persist:source_definition><![CDATA[
12686                 SELECT
12687                     x.id,
12688                     COALESCE( y.copy_count, 0 ) AS copy_count,
12689                     x.hold_count AS hold_count,
12690                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12691                 FROM
12692                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12693                         FROM
12694                             action.hold_request ahr
12695                             JOIN reporter.hold_request_record rhrr USING (id)
12696                         WHERE
12697                             ahr.cancel_time IS NULL
12698                             AND ahr.fulfillment_time IS NULL
12699                         GROUP BY bib_record
12700                     )x
12701                     JOIN
12702                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12703                         FROM
12704                             action.hold_request ahr
12705                             JOIN reporter.hold_request_record rhrr USING (id)
12706                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12707                         WHERE
12708                             ahr.cancel_time IS NULL
12709                             AND ahr.fulfillment_time IS NULL
12710                             AND ahr.capture_time IS NULL
12711                             AND ahr.frozen IS FALSE
12712                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12713                             AND ahr.hold_type != 'M'
12714                            GROUP BY bib_record
12715                     )y
12716                     USING (id)
12717                 ]]></oils_persist:source_definition>
12718                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12719                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12720                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12721                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12722                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12723                 </fields>
12724                 <links>
12725                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12726                 </links>
12727                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12728                         <actions>
12729                                 <retrieve/>
12730                         </actions>
12731                 </permacrud>
12732         </class>
12733
12734         <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">
12735                 <oils_persist:source_definition><![CDATA[
12736             SELECT *,
12737                 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,
12738                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12739             FROM
12740                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12741                     FROM
12742                         action.hold_request ahr
12743                         JOIN reporter.hold_request_record rhrr USING (id)
12744                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12745                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12746                     WHERE
12747                         ahr.cancel_time IS NULL
12748                         AND ahr.fulfillment_time IS NULL
12749                     GROUP BY bib_record, pickup_lib
12750                 )x
12751                 JOIN
12752                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12753                     FROM
12754                         action.hold_request ahr
12755                         JOIN reporter.hold_request_record rhrr USING (id)
12756                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12757                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12758                     WHERE
12759                         ahr.cancel_time IS NULL
12760                         AND ahr.fulfillment_time IS NULL
12761                         AND ahr.capture_time IS NULL
12762                         AND ahr.frozen IS FALSE
12763                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12764                         AND ahr.hold_type != 'M'
12765                     GROUP BY bib_record, pickup_lib
12766                 )y
12767                 USING(id,pickup_lib)
12768                 JOIN
12769                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12770                     FROM
12771                         action.hold_request ahr
12772                         JOIN reporter.hold_request_record rhrr USING (id)
12773                     WHERE
12774                         ahr.cancel_time IS NULL
12775                         AND ahr.fulfillment_time IS NULL
12776                     GROUP BY bib_record
12777                 )z
12778                 USING (id)
12779                 JOIN
12780                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12781                     FROM
12782                         action.hold_request ahr
12783                         JOIN reporter.hold_request_record rhrr USING (id)
12784                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12785                     WHERE
12786                         ahr.cancel_time IS NULL
12787                         AND ahr.fulfillment_time IS NULL
12788                         AND ahr.capture_time IS NULL
12789                         AND ahr.frozen IS FALSE
12790                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12791                         AND ahr.hold_type != 'M'
12792                         GROUP BY bib_record
12793                 )u
12794                 USING (id)
12795                 ]]></oils_persist:source_definition>
12796                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12797                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12798                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12799                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12800                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12801                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12802                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12803                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12804                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12805                 </fields>
12806                 <links>
12807                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12808                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12809                 </links>
12810                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12811                         <actions>
12812                                 <retrieve/>
12813                         </actions>
12814                 </permacrud>
12815         </class>
12816
12817         <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">
12818                 <oils_persist:source_definition><![CDATA[
12819             SELECT *,
12820                 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,
12821                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12822             FROM
12823                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12824                     FROM
12825                         action.hold_request ahr
12826                         JOIN actor.usr au ON (ahr.usr = au.id)
12827                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12828                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12829                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12830                     WHERE
12831                         ahr.cancel_time IS NULL
12832                         AND ahr.fulfillment_time IS NULL
12833                     GROUP BY bib_record, home_ou
12834                 )x
12835                 JOIN
12836                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12837                     FROM
12838                         action.hold_request ahr
12839                         JOIN actor.usr au ON (ahr.usr = au.id)
12840                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12841                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12842                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12843                     WHERE
12844                         ahr.cancel_time IS NULL
12845                         AND ahr.fulfillment_time IS NULL
12846                         AND ahr.capture_time IS NULL
12847                         AND ahr.frozen IS FALSE
12848                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12849                         AND ahr.hold_type != 'M'
12850                     GROUP BY bib_record, home_ou
12851                 )y
12852                 USING (id,home_ou)
12853                 JOIN
12854                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12855                     FROM
12856                         action.hold_request ahr
12857                         JOIN reporter.hold_request_record rhrr USING (id)
12858                     WHERE
12859                         ahr.cancel_time IS NULL
12860                         AND ahr.fulfillment_time IS NULL
12861                     GROUP BY bib_record
12862                 )z
12863                 USING (id)
12864                 JOIN
12865                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12866                     FROM
12867                         action.hold_request ahr
12868                         JOIN reporter.hold_request_record rhrr USING (id)
12869                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12870                     WHERE
12871                         ahr.cancel_time IS NULL
12872                         AND ahr.fulfillment_time IS NULL
12873                         AND ahr.capture_time IS NULL
12874                         AND ahr.frozen IS FALSE
12875                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12876                         AND ahr.hold_type != 'M'
12877                     GROUP BY bib_record
12878                 )u
12879                 USING (id)
12880         ]]></oils_persist:source_definition>
12881         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12882                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12883                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12884                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12885                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12886                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12887                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12888                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12889                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12890         </fields>
12891         <links>
12892                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12893                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12894         </links>
12895         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12896                 <actions>
12897                         <retrieve/>
12898                 </actions>
12899         </permacrud>
12900 </class>
12901
12902         <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) ">
12903                 <oils_persist:source_definition><![CDATA[
12904                 WITH counts_at_ou AS (
12905                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12906                 FROM
12907                     (SELECT rhrr.bib_record AS id,
12908                             aou.id AS pickup_lib_or_desc,
12909                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12910                        FROM actor.org_unit aou
12911                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12912                             action.hold_request ahr
12913                             JOIN reporter.hold_request_record rhrr USING (id)
12914                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12915                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12916                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12917                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12918                             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
12919                       GROUP BY 1, 2
12920                 ) a
12921                 JOIN
12922                     (SELECT rhrr.bib_record AS id,
12923                             aou.id AS pickup_lib_or_desc,
12924                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12925                        FROM actor.org_unit aou
12926                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12927                             action.hold_request ahr
12928                             JOIN reporter.hold_request_record rhrr USING (id)
12929                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12930                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12931                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12932                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12933                             AND ahr.hold_type != 'M'
12934                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12935                             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
12936                       GROUP BY 1, 2
12937                 ) b
12938                 USING (id,pickup_lib_or_desc)
12939             )
12940             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
12941                    y.holds_everywhere, z.copy_count_everywhere,
12942                 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,
12943                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
12944             FROM counts_at_ou x
12945                 JOIN
12946                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12947                     FROM
12948                         action.hold_request ahr
12949                         JOIN reporter.hold_request_record rhrr USING (id)
12950                     WHERE
12951                         ahr.cancel_time IS NULL
12952                         AND ahr.fulfillment_time IS NULL
12953                     GROUP BY bib_record
12954                 )y
12955                 USING (id)
12956                 JOIN
12957                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12958                     FROM
12959                         action.hold_request ahr
12960                         JOIN reporter.hold_request_record rhrr USING (id)
12961                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12962                     WHERE
12963                         ahr.cancel_time IS NULL
12964                         AND ahr.fulfillment_time IS NULL
12965                         AND ahr.capture_time IS NULL
12966                         AND ahr.frozen IS FALSE
12967                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12968                         AND ahr.hold_type != 'M'
12969                         GROUP BY bib_record
12970                 )z
12971                 USING (id)
12972                 ]]></oils_persist:source_definition>
12973                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12974                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12975                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12976                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12977                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12978                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12979                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12980                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12981                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12982                 </fields>
12983                 <links>
12984                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12985                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12986                 </links>
12987                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12988                         <actions>
12989                                 <retrieve/>
12990                         </actions>
12991                 </permacrud>
12992         </class>
12993
12994         <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">
12995                 <oils_persist:source_definition><![CDATA[
12996             SELECT
12997                 ac.id,
12998                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
12999                 MAX(actac.xact_start) AS last_circ
13000             FROM asset.copy ac
13001                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13002             GROUP BY ac.id
13003
13004             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13005             --SELECT
13006             --    ac.id,
13007             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13008             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13009             --FROM asset.copy ac
13010             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13011             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13012             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13013                 ]]></oils_persist:source_definition>
13014                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13015                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13016                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13017                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13018                 </fields>
13019                 <links>
13020                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13021                 </links>
13022                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13023                         <actions>
13024                                 <retrieve/>
13025                         </actions>
13026                 </permacrud>
13027         </class>
13028
13029         <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">
13030                 <fields oils_persist:primary="id">
13031                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13032                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13033                 </fields>
13034                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13035                         <actions>
13036                                 <retrieve/>
13037                         </actions>
13038                 </permacrud>
13039         </class>
13040
13041         <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">
13042                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13043                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13044                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13045                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13046                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13047                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13048                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13049                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13050                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13051                 </fields>
13052                 <links>
13053                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13054                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13055                 </links>
13056                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13057                         <actions>
13058                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13059                                 <retrieve/>
13060                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13061                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13062                         </actions>
13063                 </permacrud>
13064         </class>
13065
13066         <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">
13067                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13068                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13069                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13070                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13071                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13072                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13073                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13074                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13075                 </fields>
13076                 <links>
13077                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13078                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13079                 </links>
13080                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13081                         <actions>
13082                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13083                                 <retrieve/>
13084                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13085                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13086                         </actions>
13087                 </permacrud>
13088         </class>
13089
13090
13091         <!-- ********************************************************************************************************************* -->
13092         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13093         <!-- ********************************************************************************************************************* -->
13094         <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">
13095                 <fields oils_persist:primary="id">
13096                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13097                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13098                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13099                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13100                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13101                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13102                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13103                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13104                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13105                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13106                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13107                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13108                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13109                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13110                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13111                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13112                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13113                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13114                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13115                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13116                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13117                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13118                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13119                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13120                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13121                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13122                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13123                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13124                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13125                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13126                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13127                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13128                 </fields>
13129                 <links>
13130                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13131                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13132                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13133                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13134                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13135                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13136                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13137                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13138                 </links>
13139         </class>
13140
13141         <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">
13142                 <fields oils_persist:primary="id">
13143                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13144                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13145                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13146                 </fields>
13147                 <links>
13148                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13149                 </links>
13150         </class>
13151
13152         <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">
13153                 <fields oils_persist:primary="id">
13154                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13155                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13156                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13157                 </fields>
13158                 <links>
13159                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13160                 </links>
13161         </class>
13162
13163         <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">
13164                 <fields oils_persist:primary="id">
13165                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13166
13167                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13168                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13169                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13170
13171                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13172                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13173                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13174
13175                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13176                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13177
13178                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13179                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13180                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13181
13182                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13183                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13184
13185                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13186                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13187                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13188
13189                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13190                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13191                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13192
13193                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13194                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13195                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13196                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13197
13198                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13199                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13200
13201                 </fields>
13202                 <links>
13203                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13204                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13205                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13206                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13207                 </links>
13208         </class>
13209
13210         <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">
13211                 <oils_persist:source_definition><![CDATA[
13212
13213             SELECT
13214                 po.ordering_agency AS ordering_agency,
13215                 po.id AS purchase_order,
13216                 li.id AS lineitem,
13217                 lid.id AS lineitem_detail,
13218                 cpa.id AS claim_policy_action
13219             FROM
13220                 acq.lineitem_detail lid
13221                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13222                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13223                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13224                 JOIN acq.claim_policy_action cpa ON (
13225                     cpa.claim_policy = cp.id
13226
13227                     -- we only care about claim policy actions whose claim
13228                     -- interval we'd reached or exceeded
13229                     AND (NOW() - cpa.action_interval) > po.order_date
13230
13231                     -- filter out all claim policy actions where claim events
13232                     -- have occurred on or after the action's action_interval
13233                     AND NOT EXISTS (
13234                         SELECT 1
13235                         FROM
13236                             acq.claim_event evt
13237                             JOIN acq.claim claim ON (
13238                                 claim.id = evt.claim
13239                                 AND claim.lineitem_detail = lid.id
13240                             )
13241                         WHERE
13242                             evt.event_date >= (po.order_date + cpa.action_interval)
13243                     )
13244                 )
13245             WHERE
13246                 lid.cancel_reason IS NULL
13247                 AND li.cancel_reason IS NULL -- belt/suspenders
13248                 AND po.cancel_reason IS NULL -- belt/suspenders
13249                 AND lid.recv_time IS NULL
13250                 AND po.state = 'on-order'
13251             ORDER BY 1, 2, 3, 4, 5
13252
13253                 ]]></oils_persist:source_definition>
13254                 <fields>
13255                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13256                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13257                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13258                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13259                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13260                 </fields>
13261                 <links>
13262                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13263                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13264                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13265                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13266                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13267                 </links>
13268         </class>
13269         <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">
13270                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13271                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13272                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13273                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13274                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13275                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13276                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13277                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13278                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13279                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13280                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13281                 </fields>
13282                 <links>
13283                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13284                 </links>
13285     </class>
13286         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13287                 <oils_persist:source_definition><![CDATA[
13288             SELECT * FROM acq.lineitem_summary 
13289                                 WHERE item_count > (invoice_count + cancel_count)
13290         ]]></oils_persist:source_definition>
13291                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13292                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13293                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13294                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13295                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13296                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13297                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13298                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13299                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13300                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13301                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13302                 </fields>
13303                 <links>
13304                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13305                 </links>
13306     </class>
13307         <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">
13308                 <oils_persist:source_definition><![CDATA[
13309
13310                         SELECT  t.*
13311                           FROM  action.transit_copy t
13312                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13313                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13314                           WHERE s.parent_ou <> d.parent_ou
13315
13316                 ]]></oils_persist:source_definition>
13317                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13318                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13319                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13320                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13321                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13322                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13323                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13324                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13325                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13326                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13327                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13328                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13329                 </fields>
13330                 <links>
13331                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13332                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13333                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13334                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13335                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13336                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13337                 </links>
13338         </class>
13339
13340     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13341                 <oils_persist:source_definition><![CDATA[
13342
13343         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13344                 SELECT
13345                         cp.id as copy,
13346                         COUNT(circ.id),
13347                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13348                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13349                 FROM
13350                         asset.copy cp
13351                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13352                 GROUP BY 1, 3, 4
13353                 UNION ALL
13354                 SELECT
13355                         cp.id as copy,
13356                         COUNT(circ.id),
13357                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13358                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13359                 FROM
13360                         asset.copy cp
13361                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13362                 GROUP BY 1, 3, 4
13363                 UNION ALL
13364                 SELECT
13365                         id as copy,
13366                         circ_count,
13367                         -1 AS year,
13368                         false as is_renewal
13369                 FROM
13370                         extend_reporter.legacy_circ_count
13371         )x GROUP BY 1, 3, 4
13372
13373                 ]]></oils_persist:source_definition>
13374         <fields>
13375             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13376             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13377             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13378             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13379         </fields>
13380                 <links>
13381                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13382                 </links>
13383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13384                         <actions>
13385                                 <retrieve/>
13386                         </actions>
13387                 </permacrud>
13388     </class>
13389
13390         <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">
13391                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13392                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13393                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13394                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13395                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13396                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13397                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13398                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13399                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13400                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13401                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13402                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13403                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13404                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13405                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13406                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13407                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13408                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13409                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13410                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13411                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13412                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13413                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13414                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13415                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13416                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13417                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13418                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13419                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13420                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13421                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13422                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13423                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13424                 </fields>
13425                 <links>
13426                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13427                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13428                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13429                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13430                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13431                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13432                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13433                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13434                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13435                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13436                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13437                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13438                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13439                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13440                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13441                 </links>
13442         </class>
13443
13444     <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">
13445         <fields oils_persist:primary="id">
13446             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13447             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13448             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13449             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13450             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13451             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13452             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13453             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13454             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13455             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13456             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13457             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13458             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13459             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13460             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13461             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13462             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13463             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13464             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13465             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13466             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13467             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13468             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13469             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13470             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13471             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13472             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13473             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13474             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13475             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13476             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13477             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13478             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13479             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13480         </fields>
13481         <links>
13482             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13483             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13484             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13485             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13486             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13487             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13488             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13489             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13490         </links>
13491     </class>
13492
13493     <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">
13494         <fields oils_persist:primary="id">
13495             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13496             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13497             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13498             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13499         </fields>
13500         <links>
13501             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13502             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13503         </links>
13504     </class>
13505
13506     <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">
13507         <fields oils_persist:primary="owning_lib">
13508             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13509             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13510             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13511         </fields>
13512         <links>
13513             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13514         </links>
13515     </class>
13516
13517     <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">
13518         <fields oils_persist:primary="id">
13519             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13520             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13521             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13522             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13523             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13524         </fields>
13525         <links>
13526             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13527             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13528             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13529         </links>
13530     </class>
13531
13532     <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">
13533         <fields oils_persist:primary="circ_lib">
13534             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13535             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13536             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13537             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13538         </fields>
13539         <links>
13540             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13541             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13542         </links>
13543     </class>
13544
13545     <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">
13546         <fields oils_persist:primary="id">
13547             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13548             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13549             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13550             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13551             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13552         </fields>
13553         <links>
13554             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13555             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13556             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13557         </links>
13558     </class>
13559
13560     <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">
13561         <fields oils_persist:primary="home_ou">
13562             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13563             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13564             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13565             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13566         </fields>
13567         <links>
13568             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13569             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13570         </links>
13571     </class>
13572         <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">
13573                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13574                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13575                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13576                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13577                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13578                 </fields>
13579                 <links>
13580                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13581                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13582                 </links>
13583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13584                         <actions>
13585                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13586                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13587                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13588                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13589                         </actions>
13590                 </permacrud>
13591         </class>
13592         <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">
13593                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13594                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13595                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13596                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13597                 </fields>
13598                 <links>
13599                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13600                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13601                         </links>
13602                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13603                 <actions>
13604                                 <create permission="ADMIN_ACQ_FUND_TAG">
13605                                         <context link="tag" field="owner"/>
13606                                 </create>
13607                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13608                                         <context link="tag" field="owner"/>
13609                                 </retrieve>
13610                                 <update permission="ADMIN_ACQ_FUND_TAG">
13611                                         <context link="tag" field="owner"/>
13612                                 </update>
13613                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13614                                         <context link="tag" field="owner"/>
13615                                 </delete>
13616                         </actions>
13617                 </permacrud>
13618         </class>
13619         <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">
13620                 <oils_persist:source_definition><![CDATA[
13621                 SELECT
13622                         poi.purchase_order AS purchase_order,
13623                         ii.invoice AS invoice,
13624                         NULL AS lineitem,
13625                         poi.id AS po_item,
13626                         NULL AS picklist
13627                 FROM
13628                         acq.po_item poi
13629                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13630                 UNION SELECT
13631                         jub.purchase_order AS purchase_order,
13632                         ie.invoice AS invoice,
13633                         jub.id AS lineitem,
13634                         NULL AS po_item,
13635                         jub.picklist AS picklist
13636                 FROM
13637                         acq.lineitem jub
13638                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13639                 UNION SELECT
13640                         ii.purchase_order AS purchase_order,
13641                         ii.invoice AS invoice,
13642                         NULL AS lineitem,
13643                         NULL AS po_item,
13644                         NULL AS picklist
13645                 FROM
13646                         acq.invoice_item ii
13647                 WHERE ii.po_item IS NULL
13648                 UNION SELECT
13649                         ie.purchase_order AS purchase_order,
13650                         ie.invoice AS invoice,
13651                         NULL AS lineitem,
13652                         NULL AS po_item,
13653                         NULL AS picklist
13654                 FROM
13655                         acq.invoice_entry ie
13656                 WHERE ie.lineitem IS NULL
13657                 UNION SELECT
13658                         NULL AS purchase_order,
13659                         NULL AS invoice,
13660                         jub.id AS lineitem,
13661                         NULL AS po_item,
13662                         jub.picklist AS picklist
13663                 FROM
13664                         acq.lineitem jub
13665                 WHERE jub.purchase_order IS NULL
13666                 ]]></oils_persist:source_definition>
13667                 <fields>
13668                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13669                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13670                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13671                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13672                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13673                 </fields>
13674                 <links>
13675                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13676                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13677                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13678                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13679                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13680                 </links>
13681         </class>
13682         <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">
13683                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13685                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13686                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13687                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13688                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13689                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13690                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13691                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13692                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13693                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13694                 </fields>
13695                 <links>
13696                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13697                 </links>
13698                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13699                         <actions>
13700                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13701                                 <retrieve/>
13702                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13703                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13704                         </actions>
13705                 </permacrud>
13706         </class>
13707
13708         <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">
13709                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13710                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13711                         <field name="date_applied" reporter:datatype="timestamp"/>
13712                         <field name="org" reporter:datatype="org_unit"/>
13713                         <field name="original_value" reporter:datatype="text"/>
13714                         <field name="new_value" reporter:datatype="text"/>
13715                         <field name="field_name" reporter:datatype="link"/>
13716                 </fields>
13717                 <links>
13718                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13719                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13720                 </links>
13721         </class>
13722         <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">
13723                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13724                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13725                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13726                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13727                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13728                 </fields>
13729                 <links>
13730                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13731                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13732                 </links>
13733         </class>
13734         <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">
13735                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13736                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13737                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13738                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13739                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13740                 </fields>
13741                 <links>
13742                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13743                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13744                 </links>
13745         </class>
13746         <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">
13747                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13748                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13749                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13750                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13751                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13752                 </fields>
13753                 <links>
13754                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13755                 </links>
13756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13757                         <actions>
13758                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13759                                 <retrieve/>
13760                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13761                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13762                         </actions>
13763                 </permacrud>
13764         </class>
13765         <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">
13766                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13767                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13768                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13769                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13770                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13771                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13772                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13773                 </fields>
13774                 <links>
13775                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13776                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13777                 </links>
13778                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13779                         <actions>
13780                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13781                                 <retrieve/>
13782                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13783                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13784                         </actions>
13785                 </permacrud>
13786         </class>
13787         <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">
13788                 <fields oils_persist:primary="code">
13789                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13790                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13791                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13792                 </fields>
13793                 <links>
13794                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13795                 </links>
13796                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13797                         <actions>
13798                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13799                                 <retrieve/>
13800                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13801                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13802                         </actions>
13803                 </permacrud>
13804         </class>
13805         <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">
13806                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13807                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13808                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13809                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13810                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13811                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13812                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13813                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13814                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13815                 </fields>
13816                 <links>
13817                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13818                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13819                 </links>
13820                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13821                         <actions>
13822                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13823                                 <retrieve/>
13824                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13825                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13826                         </actions>
13827                 </permacrud>
13828         </class>
13829         <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">
13830                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13831                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13832                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13833                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13834                 </fields>
13835                 <links>
13836                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13837                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13838                 </links>
13839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13840                         <actions>
13841                                 <create permission="UPDATE_COPY">
13842                     <context link="copy" field="circ_lib"/>
13843                 </create>
13844                                 <retrieve/>
13845                                 <update permission="UPDATE_COPY">
13846                     <context link="copy" field="circ_lib"/>
13847                 </update>
13848                                 <delete permission="UPDATE_COPY">
13849                     <context link="copy" field="circ_lib"/>
13850                 </delete>
13851                         </actions>
13852                 </permacrud>
13853         </class>
13854         <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">
13855         <oils_persist:source_definition><![CDATA[
13856         SELECT ahcm.target_copy AS id,count(*) AS count
13857          FROM
13858          action.hold_request ahr,
13859          action.hold_copy_map ahcm
13860          WHERE
13861          ahr.cancel_time IS NULL AND
13862          ahr.fulfillment_time IS NULL AND
13863          ahr.capture_time IS NULL AND
13864          ahr.id = ahcm.hold
13865          GROUP BY ahcm.target_copy
13866         ]]></oils_persist:source_definition>
13867         <fields oils_persist:primary="id">
13868             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13869             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13870         </fields>
13871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13872             <actions>
13873                <retrieve/>
13874             </actions>
13875         </permacrud>
13876         </class>
13877
13878         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13879                 oils_obj:fieldmapper="config::workstation_setting_type" 
13880                 oils_persist:tablename="config.workstation_setting_type" 
13881                 reporter:label="Workstation Setting Type">
13882                 <fields oils_persist:primary="name">
13883                         <field name="name" reporter:datatype="text"/>
13884                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13885                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13886                         <field name="datatype" reporter:datatype="text"/>
13887                         <field name="fm_class" reporter:datatype="text"/>
13888                         <field name="grp" reporter:datatype="link"/>
13889                 </fields>
13890                 <links>
13891                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13892                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13893                 </links>
13894                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13895                         <actions>
13896                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13897                                 <retrieve/>
13898                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13899                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13900                         </actions>
13901                 </permacrud>
13902         </class>
13903
13904         <!-- no pcrud access is granted for now, because it's assumed these
13905                          setting values will be applied and retrived via the API. -->
13906         <class id="awss" 
13907                 controller="open-ils.cstore"
13908                 oils_obj:fieldmapper="actor::workstation_setting" 
13909                 oils_persist:tablename="actor.workstation_setting" 
13910                 reporter:label="Workstation Setting">
13911                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13912                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13913                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13914                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13915                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13916                 </fields>
13917                 <links>
13918                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13919                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13920                 </links>
13921         </class>
13922
13923         <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">
13924         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13925                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13926                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
13927                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
13928         </fields>
13929         </class>
13930
13931         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
13932                 oils_obj:fieldmapper="config::print_template" 
13933                 oils_persist:tablename="config.print_template" 
13934                 reporter:label="Print Templates">
13935                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13936                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
13937                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13938                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13939                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13940                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13941                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13942                         <field name="content_type" reporter:datatype="text"/>
13943                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13944                 </fields>
13945                 <links>
13946                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13947                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13948                 </links>
13949                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13950                         <actions>
13951                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13952                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
13953                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13954                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13955                         </actions>
13956                 </permacrud>
13957         </class>
13958
13959         <class id="cct" 
13960                 controller="open-ils.cstore open-ils.pcrud"
13961                 oils_obj:fieldmapper="config::carousel_type" 
13962                 oils_persist:tablename="config.carousel_type" 
13963                 reporter:label="Carousel Types">
13964                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13965                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13966                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13967                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13968                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13969                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13970                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13971                 </fields>
13972                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13973                         <actions>
13974                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13975                                 <retrieve/>
13976                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13977                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13978                         </actions>
13979                 </permacrud>
13980         </class>
13981
13982         <class id="cc" 
13983                 controller="open-ils.cstore open-ils.pcrud"
13984                 oils_obj:fieldmapper="container::carousel" 
13985                 oils_persist:tablename="container.carousel" 
13986                 reporter:label="Carousels">
13987                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13988                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13989                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13990                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
13991                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13992                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
13993                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
13994                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
13995                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
13996                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
13997                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
13998                         <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 -->
13999                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14000                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14001                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14002                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14003                 </fields>
14004                 <links>
14005                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14006                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14007                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14008                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14009                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14010                 </links>
14011                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14012                         <actions>
14013                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14014                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14015                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14016                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14017                         </actions>
14018                 </permacrud>
14019         </class>
14020
14021         <class id="ccou" 
14022                 controller="open-ils.cstore open-ils.pcrud"
14023                 oils_obj:fieldmapper="container::carousel_org_unit" 
14024                 oils_persist:tablename="container.carousel_org_unit" 
14025                 reporter:label="Carousels Visible at Library">
14026                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14027                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14028                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14029                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14030                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14031                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14032                 </fields>
14033                 <links>
14034                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14035                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14036                 </links>
14037                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14038                         <actions>
14039                                 <create permission="ADMIN_CAROUSEL">
14040                                     <context link="carousel" field="owner" />
14041                                 </create>
14042                                 <retrieve permission="ADMIN_CAROUSEL">
14043                                     <context link="carousel" field="owner" />
14044                                 </retrieve>
14045                                 <update permission="ADMIN_CAROUSEL">
14046                                     <context link="carousel" field="owner" />
14047                                 </update>
14048                                 <delete permission="ADMIN_CAROUSEL">
14049                                     <context link="carousel" field="owner" />
14050                                 </delete>
14051                         </actions>
14052                 </permacrud>
14053         </class>
14054
14055         <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">
14056                 <fields oils_persist:primary="name">
14057                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14058                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14059                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14060                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14061                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14062                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14063                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14064                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14065                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14066                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14067                 </fields>
14068                 <links>
14069                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14070                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14071                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14072                 </links>
14073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14074                         <actions>
14075                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14076                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14077                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14078                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14079                         </actions>
14080                 </permacrud>
14081         </class>
14082         <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">
14083                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14084                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14085                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14086                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14087                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14088                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14089                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14090                 </fields>
14091                 <links>
14092                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14093                 </links>
14094                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14095                         <actions>
14096                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14097                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14098                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14099                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14100                         </actions>
14101                 </permacrud>
14102         </class>
14103
14104     <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">
14105         <fields oils_persist:primary="code">
14106             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14107             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14108         </fields>
14109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14110                         <actions>
14111                                 <retrieve/>
14112                         </actions>
14113                 </permacrud>
14114         </class>
14115
14116     <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">
14117         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14118             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14119             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14120             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14121             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14122             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14123             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14124             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14125             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14126                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14127         </fields>
14128                 <links>
14129                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14130                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14131                 </links>
14132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14133             <actions>
14134                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14135                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14136                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14137                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14138             </actions>
14139         </permacrud>
14140     </class>
14141
14142         <!-- Simple Reporter classes are currently used only by the SR UI -->
14143     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14144         <oils_persist:source_definition><![CDATA[
14145             SELECT
14146               -- Circ id; just for counting
14147               combcirc.id AS circ_id,
14148
14149               -- User info, currently limiting to what's available from action.all_circulation
14150               combcirc.usr_post_code AS usr_post_code,
14151               combcirc.usr_birth_year AS usr_bith_year,
14152               combcirc.usr_profile AS usr_profile_id,
14153               pgtu.name AS usr_profile,
14154               combcirc.usr_home_ou AS usr_home_ou_id,
14155               aouuh.shortname AS usr_home_ou_shortname,
14156               aouuh.name AS usr_home_ou_name,
14157               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14158               aouus.shortname AS usr_sys_shortname,
14159               aouus.name AS usr_sys_name,
14160
14161               -- Circ info
14162               -- Checkout
14163               combcirc.xact_start AS xact_start,
14164               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14165               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14166               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14167               combcirc.circ_lib AS circ_lib_id,
14168               aouco.shortname AS circ_lib_shortname,
14169               aouco.name AS circ_lib_name,
14170               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14171               aoucos.shortname AS circ_sys_shortname,
14172               aoucos.name AS circ_sys_name,
14173               auco.usrname AS circ_staff,
14174               awso.name AS checkout_workstation,
14175
14176               combcirc.due_date AS due_date,
14177               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14178               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14179               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14180
14181               -- Checkin
14182               combcirc.xact_finish AS xact_finish,
14183               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14184               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14185               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14186               aouci.shortname AS checkin_lib_shortname,
14187               aouci.name AS checkin_lib_name,
14188               auci.usrname AS checkin_staff,
14189               awsi.name AS checkin_workstation,
14190               aoucis.shortname AS checkin_sys_shortname,
14191               aoucis.name AS checkin_sys_name,
14192
14193               combcirc.checkin_time AS checkin_time,
14194
14195               -- Misc circ info
14196               combcirc.renewal_remaining AS renewal_remaining,
14197               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14198               combcirc.grace_period AS grace_period,
14199
14200               combcirc.stop_fines AS stop_fines,
14201               combcirc.stop_fines_time AS stop_fines_time,
14202
14203               combcirc.duration AS duration,
14204               combcirc.fine_interval AS fine_interval,
14205               combcirc.recurring_fine AS recurring_fine,
14206               combcirc.max_fine AS max_fine,
14207               combcirc.duration_rule AS duration_rule,
14208               combcirc.recurring_fine_rule AS recurring_fine_rule,
14209               combcirc.max_fine_rule AS max_fine_rule,
14210               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14211               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,
14212               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14213
14214               -- Copy info
14215               acp.barcode AS copy_barcode,
14216               acp.circ_modifier AS copy_circ_modifier_code,
14217               ccm.name AS copy_circ_modifier_name,
14218               acp.circ_lib AS copy_circ_lib_id,
14219               acp.location AS location_id,
14220               acpl.name AS location_name,
14221               aoucp.shortname AS copy_circ_lib_shortname,
14222               aoucp.name AS copy_circ_lib_name,
14223               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14224               aoucps.shortname AS copy_sys_shortname,
14225               aoucps.name AS copy_sys_name,
14226               combcirc.copy_owning_lib AS copy_owning_lib_id,
14227               aoucpo.shortname AS copy_owning_lib_shortname,
14228               aoucpo.name AS copy_owning_lib_name,
14229               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14230               acnp.label AS copy_call_number_prefix,
14231               acn.label AS copy_call_number_label,
14232               acns.label AS copy_call_number_suffix,
14233               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14234               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14235               acn.label_sortkey AS copy_call_number_label_sortkey,
14236               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14237               COALESCE(rmsr.title, acp.dummy_title) AS title,
14238               COALESCE(rmsr.author, acp.dummy_author) AS author,
14239               rmsr.publisher AS publisher,
14240               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14241               array_to_string(rmsr.isbn, ', ') AS isbn,
14242               array_to_string(rmsr.issn, ', ') AS issn,
14243               part.label AS part_label,
14244               part.label_sortkey AS part_label_sortkey,
14245               acn.record AS bib_id,
14246               rmsr.tcn_value AS tcn_value
14247
14248             FROM
14249               action.all_circulation combcirc
14250
14251               -- User
14252               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14253               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14254               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14255
14256               -- Circ
14257               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14258               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14259               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14260               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14261               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14262               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14263               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14264               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14265
14266               -- Copy / call / title
14267               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14268                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14269               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14270               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14271               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14272               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14273               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14274               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14275               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14276               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14277               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14278               LEFT JOIN (
14279                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14280                 FROM biblio.monograph_part bmp
14281                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14282                 WHERE NOT bmp.deleted
14283               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14284         ]]></oils_persist:source_definition>
14285         <field_groups>
14286             <group name="common" reporter:label="Common Fields"/>
14287             <group name="item" reporter:label="Item Fields"/>
14288             <group name="user" reporter:label="Patron Fields"/>
14289             <group name="title" reporter:label="Call Number and Title Fields"/>
14290             <group name="org" reporter:label="Libraries"/>
14291         </field_groups>
14292         <fields oils_persist:primary="circ_id">
14293             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14294             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14295             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14296             <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"/>
14297             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14298             <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"/>
14299             <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"/>
14300             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14301             <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"/>
14302             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14303             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14304             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14305             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14306             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14307             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14308             <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"/>
14309             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14310             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14311             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14312             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14313             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14314             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14315             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14316             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14317             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14318             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14319             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14320             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14321             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14322             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14323             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14324             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14325             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14326             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14327             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14328             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14329             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14330             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14331             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14332             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14333             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14334             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14335             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14336             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14337             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14338             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14339             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14340             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14341             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14342             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14343             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14344             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14345             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14346             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14347             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14348             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14349             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14350             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14351             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14352             <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"/>
14353             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14354             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14355             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14356             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14357             <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"/>
14358             <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"/>
14359             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14360             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14361             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14362             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14363             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14364             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14365             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14366             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14367             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14368             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14369             <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"/>
14370             <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"/>
14371             <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"/>
14372             <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"/>
14373             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14374             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14375             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14376             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14377             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14378             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14379             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14380             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14381             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14382             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14383         </fields>
14384         <links>
14385             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14386             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14387             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14388         </links>
14389     </class>
14390
14391     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14392         <oils_persist:source_definition><![CDATA[
14393             SELECT
14394               au.home_ou AS home_ou_filter,
14395               au.id AS user_id,
14396               cardp.barcode AS barcode_primary,
14397               au.usrname AS usrname,
14398               au.email AS email,
14399               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14400               au.prefix AS prefix,
14401               au.first_given_name AS first_given_name,
14402               au.second_given_name AS second_given_name,
14403               au.family_name AS family_name,
14404               au.suffix AS suffix,
14405               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14406               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14407               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14408               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14409               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14410               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14411               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14412               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14413               au.profile AS profile_id,
14414               pgt.name AS profile,
14415               au.alias AS alias,
14416               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14417               au.day_phone AS day_phone,
14418               au.evening_phone AS evening_phone,
14419               au.other_phone AS other_phone,
14420               au.dob AS dob,
14421               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14422               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14423               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14424               au.active AS active,
14425               au.barred AS barred,
14426               au.deleted AS deleted,
14427               au.juvenile AS juvenile,
14428               au.claims_returned_count AS claims_returned_count,
14429               au.credit_forward_balance AS credit_forward_balance,
14430               au.create_date AS create_date,
14431               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14432               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14433               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14434               au.expire_date AS expire_date,
14435               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14436               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14437               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14438               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14439               au.last_update_time AS last_update_time,
14440               au.home_ou AS home_ou_id,
14441               aouh.shortname AS home_ou_shortname,
14442               aouh.name AS home_ou_name,
14443               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14444               aous.shortname AS home_sys_shortname,
14445               aous.name AS home_sys_name,
14446               auam.valid AS mailing_valid,
14447               auam.address_type AS mailing_address_type,
14448               auam.street1 AS mailing_street1,
14449               auam.street2 AS mailing_street2,
14450               auam.city AS mailing_city,
14451               auam.state AS mailing_state,
14452               auam.country AS mailing_country,
14453               auam.post_code AS mailing_post_code,
14454               auam.county AS mailing_county,
14455               auam.within_city_limits AS mailing_within_city_limits,
14456               auam.pending AS mailing_pending,
14457               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14458               auap.valid AS physical_valid,
14459               auap.address_type AS physical_address_type,
14460               auap.street1 AS physical_street1,
14461               auap.street2 AS physical_street2,
14462               auap.city AS physical_city,
14463               auap.state AS physical_state,
14464               auap.country AS physical_country,
14465               auap.post_code AS physical_post_code,
14466               auap.county AS physical_county,
14467               auap.within_city_limits AS physical_within_city_limits,
14468               auap.pending AS physical_pending,
14469               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14470               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14471               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14472               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14473               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14474               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14475               asceum1.stat_cat_entry AS legacy_stat_cat1,
14476               asceum2.stat_cat_entry AS legacy_stat_cat2,
14477
14478               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14479               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14480               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14481               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14482               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,
14483               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14484
14485             FROM
14486               actor.usr au
14487               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14488               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14489               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14490               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14491               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14492               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14493               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14494               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14495               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14496               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14497               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14498               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14499               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14500               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14501               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14502               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14503
14504             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14505               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14506               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14507               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14508               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14509               76,77,78,79,80,81
14510         ]]></oils_persist:source_definition>
14511         <field_groups>
14512             <group name="common" reporter:label="Common Fields"/>
14513             <group name="name" reporter:label="Name Fields"/>
14514             <group name="contact" reporter:label="Contact Fields"/>
14515             <group name="address" reporter:label="Address Related Fields"/>
14516             <group name="org" reporter:label="Libraries"/>
14517         </field_groups>
14518         <fields oils_persist:primary="user_id">
14519             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14520                 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"/>
14521             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14522             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14523             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14524             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14525             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14526             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14527             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14528             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14529             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14530             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14531             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14532             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14533             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14534             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14535             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14536             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14537             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14538             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14539             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14540             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14541             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14542             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14543             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14544             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14545             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14546             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14547             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14548             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14549             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14550             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14551             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14552             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14553             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14554             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14555             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14556             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14557             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14558             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14559             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14560             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14561             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14562             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14563             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14564             <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"/>
14565             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14566             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14567             <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"/>
14568             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14569             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14570             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14571             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14572             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14573             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14574             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14575             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14576             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14577             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14578             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14579             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14580             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14581             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14582             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14583             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14584             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14585             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14586             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14587             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14588             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14589             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14590             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14591             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14592             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14593             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14594             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14595             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14596             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14597             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14598             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14599             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14600             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14601             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14602             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14603             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14604             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14605             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14606         </fields>
14607         <links>
14608             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14609         </links>
14610     </class>
14611
14612     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14613         <oils_persist:source_definition><![CDATA[
14614             SELECT
14615               -- ids
14616               acp.id AS copy_id,
14617               acp.floating AS floating_id,
14618               acn.id AS acn_id,
14619               acp.circ_lib AS circ_lib_id,
14620               acp.status AS status_id,
14621               acp.location AS location_id,
14622               acp.age_protect AS age_protect_id,
14623               aous.id AS circ_sys_id,
14624               acn.owning_lib AS owning_lib_id,
14625               aouos.id AS owning_sys_id,
14626               awsi.id AS inv_workstation_id,
14627
14628               -- OUs
14629               aou.shortname AS circ_lib_shortname,
14630               aou.name AS circ_lib_name,
14631               aous.shortname AS circ_sys_shortname,
14632               aous.name AS circ_sys_name,
14633               aouo.shortname AS owning_lib_shortname,
14634               aouo.name AS owning_lib_name,
14635               aouos.shortname AS owning_sys_shortname,
14636               aouos.name AS owning_sys_name,
14637
14638               -- dates
14639               acp.create_date AS create_date_time,
14640               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14641               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14642               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14643               acp.active_date AS active_date_time,
14644               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14645               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14646               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14647               acp.edit_date AS edit_date_time,
14648               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14649               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14650               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14651               acp.status_changed_time AS status_changed_time_time,
14652               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14653               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14654               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14655               ali.inventory_date AS latest_inv_date,
14656               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14657               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14658               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14659
14660               -- acp
14661               acp.barcode AS barcode,
14662               ccs.name AS status,
14663               acpl.name AS location_name,
14664                                                         acp.circ_modifier AS copy_circ_modifier_code,
14665                                                         ccm.name AS copy_circ_modifier_name,
14666               acp.price AS price,
14667               acp.cost AS acq_price,
14668               acp.deleted AS copy_deleted,
14669               acp.ref AS reference,
14670               acp.circulate AS copy_circulate,
14671               (acp.circulate AND acpl.circulate) AS circulate,
14672               acp.holdable AS copy_holdable,
14673               acp.deposit AS deposit,
14674               acp.deposit_amount AS deposit_amount,
14675               acp.alert_message AS alert_message,
14676               acp.opac_visible AS copy_opac_visible,
14677               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14678               crahp.name AS age_protect,
14679               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14680               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14681               acp.copy_number AS copy_number,
14682               acp.circ_as_type AS circ_as_type,
14683               acp.loan_duration AS loan_duration_int,
14684               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14685               acp.fine_level AS fine_level_int,
14686               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14687
14688               -- Call Number
14689               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14690               acnp.label AS copy_call_number_prefix,
14691               acn.label AS copy_call_number_label,
14692               acns.label AS copy_call_number_suffix,
14693               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14694               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14695               acn.label_sortkey AS copy_call_number_label_sortkey,
14696               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14697               racnd.dewey AS call_number_dewey,
14698               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14699               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14700               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14701               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14702
14703               -- Misc
14704               COALESCE(rmsr.title, acp.dummy_title) AS title,
14705               COALESCE(rmsr.author, acp.dummy_author) AS author,
14706               rmsr.publisher AS publisher,
14707               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14708               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14709               array_to_string(rmsr.issn, ', ') AS issn,
14710               part.label AS part_label,
14711               part.label_sortkey AS part_label_sortkey,
14712               acn.record AS bib_id,
14713               rmsr.tcn_value AS tcn_value,
14714               acn.deleted AS call_deleted,
14715               bre.deleted AS bib_deleted,
14716               ccs.holdable AS status_holdable,
14717               acpl.holdable AS location_holdable,
14718               acp.circulate AS location_circulate,
14719               awsi.name AS inventory_workstation,
14720               aucr.usrname AS creating_user,
14721               aued.usrname AS editing_user,
14722
14723               -- Aggregates
14724               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14725               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,
14726               COUNT(DISTINCT combcirc.id) AS circ_total,
14727               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14728
14729             FROM
14730               asset.copy acp
14731               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14732               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14733               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14734               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14735               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14736               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14737               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14738               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14739               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14740               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14741               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14742               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14743               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14744               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14745               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14746               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14747               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14748               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14749               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14750               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14751               LEFT JOIN (
14752                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14753                 FROM biblio.monograph_part bmp
14754                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14755                 WHERE NOT bmp.deleted
14756               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14757
14758             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14759               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14760               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14761               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14762               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14763               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14764               91,92,93,94,95,96
14765
14766         ]]></oils_persist:source_definition>
14767         <field_groups>
14768             <group name="common" reporter:label="Common Fields"/>
14769             <group name="dates" reporter:label="Date Fields"/>
14770             <group name="title" reporter:label="Call Number and Title Fields"/>
14771             <group name="org" reporter:label="Libraries"/>
14772         </field_groups>
14773         <fields oils_persist:primary="copy_id">
14774             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14775             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14776             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14777             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14778             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14779             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14780             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14781             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14782             <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"/>
14783             <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"/>
14784             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14785             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14786             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14787             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14788             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14789             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14790             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14791             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14792             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14793             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14794             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14795             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14796             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14797             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14798             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14799             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14800             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14801             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14802             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14803             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14804             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14805             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14806             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14807             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14808             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14809             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14810             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14811             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14812             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14813             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14814             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14815             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14816             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14817             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14818             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14819             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14820             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14821             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14822             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14823             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14824             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14825             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14826             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14827             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14828             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14829             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14830             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14831             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14832             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14833             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14834             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14835             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14836             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14837             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14838             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14839             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14840             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14841             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14842             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14843             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14844             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14845             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14846             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14847             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14848             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14849             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14850             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14851             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14852             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14853             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14854             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14855             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14856             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14857             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14858             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14859             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14860             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14861             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14862             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14863             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14864             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14865             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14866             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14867             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14868         </fields>
14869         <links>
14870             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14871             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14872             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14873             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14874             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14875             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14876         </links>
14877     </class>
14878
14879     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14880         <oils_persist:source_definition><![CDATA[
14881
14882             SELECT
14883               -- ids
14884               acp.id AS copy_id,
14885               acn.id AS acn_id,
14886               acp.circ_lib AS circ_lib_id,
14887               acp.status AS status_id,
14888               acp.location AS location_id,
14889               acp.age_protect AS age_protect_id,
14890               aous.id AS circ_sys_id,
14891               acn.owning_lib AS owning_lib_id,
14892               aouos.id AS owning_sys_id,
14893               awsi.id AS inv_workstation_id,
14894
14895               -- OUs
14896               aou.shortname AS circ_lib_shortname,
14897               aou.name AS circ_lib_name,
14898               aous.shortname AS circ_sys_shortname,
14899               aous.name AS circ_sys_name,
14900               aouo.shortname AS owning_lib_shortname,
14901               aouo.name AS owning_lib_name,
14902               aouos.shortname AS owning_sys_shortname,
14903               aouos.name AS owning_sys_name,
14904
14905               -- dates
14906               acp.create_date AS create_date_time,
14907               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14908               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14909               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14910               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14911               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14912               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14913               acp.active_date AS active_date_time,
14914               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14915               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14916               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14917               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14918               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14919               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14920               acp.edit_date AS edit_date_time,
14921               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14922               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14923               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14924               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14925               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14926               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14927               acp.status_changed_time AS status_changed_time_time,
14928               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14929               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14930               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14931               ali.inventory_date AS latest_inv_date,
14932               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14933               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14934               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14935               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14936               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14937               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14938
14939               -- acp
14940               acp.barcode AS barcode,
14941               ccs.name AS status,
14942               acpl.name AS location_name,
14943               acp.circ_modifier AS circ_modifier_code,
14944               ccm.name AS circ_modifier_name,
14945               acp.price AS price,
14946               acp.cost AS acq_price,
14947               acp.deleted AS copy_deleted,
14948               acp.ref AS reference,
14949               acp.circulate AS copy_circulate,
14950               (acp.circulate AND acpl.circulate) AS circulate,
14951               acp.holdable AS copy_holdable,
14952               acp.deposit AS deposit,
14953               acp.deposit_amount AS deposit_amount,
14954               acp.alert_message AS alert_message,
14955               acp.opac_visible AS copy_opac_visible,
14956               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14957               crahp.name AS age_protect,
14958               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14959               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14960               acp.copy_number AS copy_number,
14961               acp.circ_as_type AS circ_as_type,
14962               acp.loan_duration AS loan_duration_int,
14963               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14964               acp.fine_level AS fine_level_int,
14965               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14966
14967               -- Call Number
14968               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14969               acnp.label AS copy_call_number_prefix,
14970               acn.label AS copy_call_number_label,
14971               acns.label AS copy_call_number_suffix,
14972               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14973               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14974               acn.label_sortkey AS copy_call_number_label_sortkey,
14975               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14976               racnd.dewey AS call_number_dewey,
14977               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14978               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14979               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14980               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14981
14982               -- Misc
14983               COALESCE(rmsr.title, acp.dummy_title) AS title,
14984               COALESCE(rmsr.author, acp.dummy_author) AS author,
14985               rmsr.publisher AS publisher,
14986               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14987               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14988               array_to_string(rmsr.issn, ', ') AS issn,
14989               part.label AS part_label,
14990               part.label_sortkey AS part_label_sortkey,
14991               acn.record AS bib_id,
14992               rmsr.tcn_value AS tcn_value,
14993               acn.deleted AS call_deleted,
14994               bre.deleted AS bib_deleted,
14995               ccs.holdable AS status_holdable,
14996               acpl.holdable AS location_holdable,
14997               acp.circulate AS location_circulate,
14998               awsi.name AS inventory_workstation,
14999
15000               -- Aggregates
15001               -- may decide these price games aren't worth it, but estimated collection value is useful
15002               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,
15003               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15004               MAX(combcirc.xact_start) AS last_circ_datetime,
15005               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15006               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15007               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15008               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15009               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15010               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15011               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15012               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15013               (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,
15014               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15015               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15016               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15017               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15018               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15019               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15020               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,
15021               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,
15022               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,
15023               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
15024
15025             FROM
15026               asset.copy acp
15027               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15028               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15029               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15030               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15031               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15032               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15033               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15034               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15035               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15036               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15037               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15038               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15039               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15040               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15041               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15042               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15043               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15044               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15045               LEFT JOIN (
15046                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15047                 FROM biblio.monograph_part bmp
15048                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15049                 WHERE NOT bmp.deleted
15050               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15051
15052             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15053               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15054               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15055               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15056               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15057               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15058               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15059
15060         ]]></oils_persist:source_definition>
15061         <field_groups>
15062             <group name="common" reporter:label="Common Fields"/>
15063             <group name="dates" reporter:label="Date Fields"/>
15064             <group name="inv" reporter:label="Inventory Fields"/>
15065             <group name="title" reporter:label="Call Number and Title Fields"/>
15066             <group name="org" reporter:label="Libraries"/>
15067         </field_groups>
15068         <fields oils_persist:primary="copy_id">
15069              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15070              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15071              <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"/>
15072              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15073              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15074              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15075              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15076              <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"/>
15077              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15078              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15079              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15080              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15081              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15082              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15083              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15084              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15085              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15086              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15087              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15088              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15089              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15090              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15091              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15092              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15093              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15094              <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"/>
15095              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15096              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15097              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15098              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15099              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15100              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15101              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15102              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15103              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15104              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15105              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15106              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15107              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15108              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15109              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15110              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15111              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15112              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15113              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15114              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15115              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15116              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15117              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15118              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15119              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15120              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15121              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15122              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15123              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15124              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15125              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15126              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15127              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15128              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15129              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15130              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15131              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15132              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15133              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15134              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15135              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15136              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15137              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15138              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15139              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15140              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15141              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15142              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15143              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15144              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15145              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15146              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15147              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15148              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15149              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15150              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15151              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15152              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15153              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15154              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15155              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15156              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15157              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15158              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15159              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15160              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15161              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15162              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15163              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15164              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15165              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15166              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15167              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15168              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15169              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15170              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15171              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15172              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15173              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15174              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15175              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15176              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15177              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15178              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15179              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15180              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15181              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15182              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15183              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15184              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15185              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15186              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15187              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15188              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15189              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15190              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15191              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15192              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15193              <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"/>
15194              <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"/>
15195              <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"/>
15196         </fields>
15197         <links>
15198             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15199             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15200             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15201             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15202             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15203         </links>
15204     </class>
15205
15206     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15207         <oils_persist:source_definition><![CDATA[
15208
15209             SELECT
15210               -- ids
15211               xact.id AS xact_id,
15212               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15213               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15214
15215               -- OUs
15216               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15217               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15218               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15219               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15220
15221               -- billings
15222               billings.total_amount AS billing_grand_total,
15223               billings.total_unvoided_amount AS billing_total,
15224
15225               billings.voided_billing_count AS billing_voided_count,
15226               billings.all_billing_types AS all_billing_types,
15227               billings.billing_types AS billing_types,
15228
15229               billings.total_voided_amount AS billing_total_voided,
15230               billings.total_overdue_amount AS billing_overdue_amount,
15231               billings.total_lost_amount AS billing_lost_amount,
15232               billings.total_long_od_amount AS billing_long_od_amount,
15233               billings.total_damaged_amount AS billing_damaged_amount,
15234               billings.total_deposit_amount AS billing_deposit_amount,
15235               billings.total_rental_amount AS billing_rental_amount,
15236
15237               -- payments
15238               payments.total_amount AS payment_grand_total,
15239               payments.total_unvoided_amount AS payment_total,
15240
15241               payments.voided_payment_count AS payment_voided_count,
15242               payments.all_payment_types AS all_payment_types,
15243               payments.payment_types AS payment_types,
15244
15245               payments.total_voided_amount AS payment_total_voided,
15246               payments.total_account_adjustment AS payment_account_adjustment_amount,
15247               payments.total_cash_payment AS payment_cash_amount,
15248               payments.total_check_payment AS payment_check_amount,
15249               payments.total_credit_card_payment AS payment_credit_card_amount,
15250               payments.total_debit_card_payment AS payment_debit_card_amount,
15251               payments.total_credit_payment AS payment_credit_amount,
15252               payments.total_forgive_payment AS payment_forgive_amount,
15253               payments.total_work_payment AS payment_work_amount,
15254               payments.total_goods_payment AS payment_goods_amount,
15255               payments.total_currency_payment AS payment_currency_amount,
15256               payments.total_non_currency_payment AS payment_non_currency_amount,
15257
15258               -- dates
15259               xact.xact_start AS xact_start,
15260               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15261               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15262               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15263               xact.xact_finish AS xact_finish,
15264               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15265               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15266               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15267               billings.earliest_billing_ts AS earliest_billing_ts,
15268               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15269               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15270               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15271               billings.latest_billing_ts AS latest_billing_ts,
15272               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15273               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15274               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15275               payments.earliest_payment_ts AS earliest_payment_ts,
15276               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15277               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15278               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15279               payments.latest_payment_ts AS latest_payment_ts,
15280               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15281               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15282               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15283
15284               -- Misc
15285               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15286               (xact.xact_finish IS NOT NULL) AS xact_closed
15287
15288             FROM
15289               money.billable_xact xact
15290               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15291               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15292               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15293               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15294               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15295               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15296
15297               -- oohh nooo.... If not done this way you encounter situations
15298               -- like multiplying billing totals x number of payments and
15299               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15300               LEFT JOIN (
15301                 SELECT
15302                   xact,
15303                   MIN(billing_ts) AS earliest_billing_ts,
15304                   MAX(billing_ts) AS latest_billing_ts,
15305
15306                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15307                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15308                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15309
15310                   SUM(amount) AS total_amount,
15311                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15312                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15313                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15314                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15315                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15316                   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.
15317                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15318                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15319
15320                 FROM
15321                   money.all_billings
15322                 GROUP BY 1
15323               ) billings ON (xact.id = billings.xact)
15324               -- Can't include accepting user or cash_drawer because that will "duplicate"
15325               -- rows if multiple staff accept payments on a single xact...
15326               LEFT JOIN (
15327                 SELECT
15328                   xact,
15329                   MIN(payment_ts) AS earliest_payment_ts,
15330                   MAX(payment_ts) AS latest_payment_ts,
15331
15332                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15333                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15334                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15335
15336                   SUM(amount) AS total_amount,
15337                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15338                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15339                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15340                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15341                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15342                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15343                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15344                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15345                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15346                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15347                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15348                   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,
15349                   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
15350
15351                 FROM
15352                   money.all_payments
15353                 GROUP BY 1
15354               ) payments ON (xact.id = payments.xact)
15355
15356         ]]></oils_persist:source_definition>
15357         <field_groups>
15358             <group name="common" reporter:label="Common Fields"/>
15359             <group name="bill" reporter:label="Billing Fields"/>
15360             <group name="pay" reporter:label="Payment Fields"/>
15361             <group name="dates" reporter:label="Date Fields"/>
15362             <group name="org" reporter:label="Libraries"/>
15363         </field_groups>
15364         <fields oils_persist:primary="xact_id">
15365              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15366              <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"/>
15367              <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"/>
15368              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15369              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15370              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15371              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15372              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15373              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15374              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15375              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15376              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15377              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15378              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15379              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15380              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15381              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15382              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15383              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15384              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15385              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15386              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15387              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15388              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15389              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15390              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15391              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15392              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15393              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15394              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15395              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15396              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15397              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15398              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15399              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15400              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15401              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15402              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15403              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15404              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15405              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15406              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15407              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15408              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15409              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15410              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15411              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15412              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15413              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15414              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15415              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15416              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15417              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15418              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15419              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15420              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15421              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15422              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15423              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15424              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15425              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15426              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15427         </fields>
15428     </class>
15429
15430         <!-- ********************************************************************************************************************* -->
15431 </IDL>
15432
15433 <!--
15434     vim:noet:ts=4:sw=4:
15435 -->