]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP1615805 No inputs after submit in patron search (AngularJS)
[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                         <field name="renew_extends_due_date" reporter:datatype="bool" reporter:label="Early Renewal Extends Due Date"/>
2199                         <field name="renew_extend_min_interval" reporter:datatype="interval" reporter:label="Early Renewal Minimum Duration Interval"/>
2200                 </fields>
2201                 <links>
2202                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2205                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2206                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2207                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2208                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2209                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2210                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2211                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2212                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2213                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2214                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2215                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2216             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2217                 </links>
2218         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2219             <actions>
2220                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2223                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2224             </actions>
2225         </permacrud>
2226         </class>
2227
2228     <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">
2229         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2230             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2231             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2232             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2233         </fields>
2234         <links/>
2235         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2236             <actions>
2237                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <retrieve/>
2239                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2240                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2241             </actions>
2242         </permacrud>
2243     </class>
2244
2245     <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">
2246         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2247             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2248             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2249             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2250             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2251             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2252             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2253             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2254         </fields>
2255         <links>
2256             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2257         </links>
2258         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2259             <actions>
2260                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <retrieve/>
2262                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2263                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2264             </actions>
2265         </permacrud>
2266     </class>
2267
2268     <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">
2269         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2270             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2271             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2272             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2273             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2274             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2275         </fields>
2276         <links>
2277             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2278             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2279         </links>
2280         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2281             <actions>
2282                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2283                     <context link="matchpoint" field="org_unit"/>
2284                 </create>
2285                 <retrieve/>
2286                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2287                     <context link="matchpoint" field="org_unit"/>
2288                 </update>
2289                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2290                     <context link="matchpoint" field="org_unit"/>
2291                 </delete>
2292             </actions>
2293         </permacrud>
2294     </class>
2295
2296     <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">
2297         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2298             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2299             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2300             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2301         </fields>
2302         <links>
2303             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2304             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2305         </links>
2306         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2307             <actions>
2308                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2309                     <context link="limit_set" field="owning_lib"/>
2310                 </create>
2311                 <retrieve/>
2312                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2313                     <context link="limit_set" field="owning_lib"/>
2314                 </update>
2315                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2316                     <context link="limit_set" field="owning_lib"/>
2317                 </delete>
2318             </actions>
2319         </permacrud>
2320     </class>
2321     <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">
2322         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2323             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2324             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2325             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2326         </fields>
2327         <links>
2328             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2329             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2330         </links>
2331         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2332             <actions>
2333                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2334                     <context link="limit_set" field="owning_lib"/>
2335                 </create>
2336                 <retrieve/>
2337                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2338                     <context link="limit_set" field="owning_lib"/>
2339                 </update>
2340                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2341                     <context link="limit_set" field="owning_lib"/>
2342                 </delete>
2343             </actions>
2344         </permacrud>
2345     </class>
2346
2347     <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">
2348         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2349             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2350             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2351             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2352             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2353         </fields>
2354         <links>
2355             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2356             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2357         </links>
2358         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2359             <actions>
2360                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2361                     <context link="limit_set" field="owning_lib"/>
2362                 </create>
2363                 <retrieve/>
2364                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2365                     <context link="limit_set" field="owning_lib"/>
2366                 </update>
2367                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2368                     <context link="limit_set" field="owning_lib"/>
2369                 </delete>
2370             </actions>
2371         </permacrud>
2372     </class>
2373
2374         <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">
2375                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2376                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2377                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2378                 </fields>
2379                 <links/>
2380         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2381             <actions>
2382                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <retrieve/>
2384                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2385                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2386             </actions>
2387         </permacrud>
2388         </class>
2389
2390         <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">
2391                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2392                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2393                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2394                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2395                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2396                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2397                 </fields>
2398                 <links>
2399                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2400                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2401                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2402                 </links>
2403         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2404             <actions>
2405                 <create permission="ADMIN_SURVEY">
2406                     <context link="survey" field="owner"/>
2407                 </create>
2408                 <retrieve/>
2409                 <update permission="ADMIN_SURVEY">
2410                     <context link="survey" field="owner"/>
2411                 </update>
2412                 <delete permission="ADMIN_SURVEY">
2413                     <context link="survey" field="owner"/>
2414                 </delete>
2415             </actions>
2416         </permacrud>
2417         </class>
2418         <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">
2419                 <fields oils_persist:primary="id" oils_persist:sequence="">
2420                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2421                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2422                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2423                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2424                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2425                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2426                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2427                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2428                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2429                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2430                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2431                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2432                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2433                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2434                 </fields>
2435                 <links>
2436                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2437                 </links>
2438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2439                         <actions>
2440                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2441                                         <context link="usr" field="home_ou" />
2442                                 </retrieve>
2443                         </actions>
2444                 </permacrud>
2445         </class>
2446         <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">
2447                 <fields oils_persist:primary="id" oils_persist:sequence="">
2448                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2449                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2450                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2451                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2452                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2453                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2454                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2455                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2456                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2457                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2458                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2459                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2460                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2461                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2462                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2463                 </fields>
2464                 <links>
2465                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2466                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2467                 </links>
2468         </class>
2469         <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">
2470                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2471                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2472                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2474                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2475                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2476                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2477                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2478                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2479                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2480                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2481                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2482                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2483                 </fields>
2484                 <links>
2485                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2486                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2487                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2488                 </links>
2489                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2490                         <actions> <!-- created magically, so no create action -->
2491                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2492                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2493                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2494                         </actions>
2495                 </permacrud>
2496         </class>
2497         <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)">
2498                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2499                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2500                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2501                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2502                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2503                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2504                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2505                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2506                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2507                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2508                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2509                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2510                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2511                 </fields>
2512                 <links>
2513                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2514                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2515                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2516                 </links>
2517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2518                         <actions> <!-- created magically, so no create action -->
2519                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2520                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2521                         </actions>
2522                 </permacrud>
2523         </class>
2524         <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">
2525         <fields oils_persist:primary="id">
2526                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2527                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2530                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2531                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2533                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2534                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2535                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2536                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2537                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2538                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2539                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2540                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2541                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2542                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2543                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2545                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2546                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2547                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2548                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2549                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2550                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2551                 </fields>
2552                 <links>
2553                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2554                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2555                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2559                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2560                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2562                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2563                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2564                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2565                 </links>
2566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2567                         <actions> <!-- created magically, so no create action -->
2568                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2569                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2570                         </actions>
2571                 </permacrud>
2572         </class>
2573
2574         <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">
2575                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2576                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2577                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2578                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2579                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2580                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2581                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2582                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2583                 </fields>
2584                 <links>
2585                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2586                 </links>
2587                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2588                         <actions>
2589                                 <create permission="UPDATE_USER">
2590                                         <context link="usr" field="home_ou"/>
2591                                 </create>
2592                                 <retrieve permission="VIEW_USER">
2593                                         <context link="usr" field="home_ou"/>
2594                                 </retrieve>
2595                                 <update permission="UPDATE_USER">
2596                                         <context link="usr" field="home_ou"/>
2597                                 </update>
2598                                 <delete permission="UPDATE_USER">
2599                                         <context link="usr" field="home_ou"/>
2600                                 </delete>
2601                         </actions>
2602                 </permacrud>
2603         </class>
2604         <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">
2605                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2606                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2607                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2608                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2609                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2610                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2611                 </fields>
2612                 <links>
2613                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2614                 </links>
2615         </class>
2616         <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">
2617                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2618                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2619                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2620                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2621                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2622                 </fields>
2623                 <links>
2624                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2625                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2626                 </links>
2627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2628                         <actions>
2629                                 <retrieve permission="VIEW_USER">
2630                                         <context link="usr" field="home_ou" />
2631                                 </retrieve>
2632                         </actions>
2633                 </permacrud>
2634         </class>
2635         <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">
2636                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2637                         <field name="field" reporter:datatype="link"/>
2638                         <field name="id" reporter:datatype="id" />
2639                         <field name="source" reporter:datatype="link"/>
2640                         <field name="value" reporter:datatype="text"/>
2641                 </fields>
2642                 <links>
2643                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2644                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2645                 </links>
2646         </class>
2647         <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">
2648                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2649                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2650                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2651                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2652                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2653                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2654                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2655                 </fields>
2656                 <links>
2657                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2658                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2659                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2660                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2661                 </links>
2662                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2663                         <actions>
2664                                 <retrieve/>
2665                         </actions>
2666                 </permacrud>
2667         </class>
2668         <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">
2669                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2670                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2671                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2672                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2673                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2674                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2675                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2676                 </fields>
2677                 <links>
2678                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2679                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2680                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2681                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2682                 </links>
2683                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2684                         <actions>
2685                                 <retrieve/>
2686                         </actions>
2687                 </permacrud>
2688         </class>
2689         <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">
2690                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2691                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2692                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2693                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2694                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2695                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2696                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2697                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2698                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2699                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2701                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2702                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2703                 </fields>
2704                 <links>
2705                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2706                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2707                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2709                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2710                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2711                 </links>
2712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2713             <actions>
2714                 <create permission="TRANSIT_COPY" context_field="owner">
2715                     <context link="target_copy" field="circ_lib"/>
2716                 </create>
2717                 <retrieve/>
2718                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2719                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2720             </actions>
2721         </permacrud>
2722         </class>
2723         <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">
2724                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2725                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2726                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2727                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2728                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2729                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2730                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2731                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2732                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2733                 </fields>
2734                 <links>
2735                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2736                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2737                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2738                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2739                 </links>
2740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2741             <actions>
2742                 <create permission="ADMIN_SURVEY">
2743                     <context link="survey" field="owner"/>
2744                 </create>
2745                 <retrieve permission="VIEW_USER">
2746                     <context link="usr" field="home_ou"/>
2747                 </retrieve>
2748                 <update permission="ADMIN_SURVEY">
2749                     <context link="survey" field="owner"/>
2750                 </update>
2751                 <delete permission="ADMIN_SURVEY">
2752                     <context link="survey" field="owner"/>
2753                 </delete>
2754             </actions>
2755         </permacrud>
2756         </class>
2757         <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">
2758                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2759                         <field name="bucket" reporter:datatype="link"/>
2760                         <field name="id" reporter:datatype="id" />
2761                         <field name="target_copy" reporter:datatype="link"/>
2762                         <field name="create_time" reporter:datatype="timestamp" />
2763                         <field name="pos" reporter:datatype="int" />
2764                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2765                 </fields>
2766                 <links>
2767                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2768                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2769             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2770                 </links>
2771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2772                         <actions>
2773                                 <retrieve permission="ADMIN_COPY_BUCKET">
2774                     <context link="bucket" field="owning_lib"/>
2775                 </retrieve>
2776             </actions>
2777         </permacrud>
2778         </class>
2779         <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">
2780                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2781                         <field name="id" reporter:datatype="id" />
2782                         <field name="item" reporter:datatype="link"/>
2783                         <field name="note" reporter:datatype="text" />
2784                 </fields>
2785                 <links>
2786                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2787                 </links>
2788         </class>
2789
2790         <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">
2791                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2792                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2793                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2794                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2795                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2796                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2797                 </fields>
2798                 <links>
2799                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2800                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2801                 </links>
2802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2803                         <actions>
2804                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <retrieve/>
2806                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2807                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2808                         </actions>
2809                 </permacrud>
2810         </class>
2811
2812         <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">
2813                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2814                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2815                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2816                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2817                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2818                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2819                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2820                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2821                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2822                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2823                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2824                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2827                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2828                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2829                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2830                 </fields>
2831                 <links>
2832                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2833                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2834                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2835                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2836                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2837                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2838                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2839                 </links>
2840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2841                         <actions>
2842                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <retrieve/>
2844                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2845                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2846                         </actions>
2847                 </permacrud>
2848         </class>
2849
2850         <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">
2851                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2852                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2853                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2854                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2855                 </fields>
2856                 <links>
2857                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2858                 </links>
2859                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2860                         <actions>
2861                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <retrieve/>
2863                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2864                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2865                         </actions>
2866                 </permacrud>
2867         </class>
2868
2869         <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">
2870                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2871                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2872                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2873                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2874                 </fields>
2875                 <links>
2876                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2877                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2878                 </links>
2879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2880                         <actions>
2881                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <retrieve/>
2883                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2884                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2885                         </actions>
2886                 </permacrud>
2887         </class>
2888
2889         <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">
2890                 <fields oils_persist:primary="code">
2891                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2892                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2893                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2894                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2895                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2896                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2897                 </fields>
2898                 <links>
2899                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2900                 </links>
2901                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2902                         <actions>
2903                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <retrieve/>
2905                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2906                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2907                         </actions>
2908                 </permacrud>
2909         </class>
2910
2911         <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">
2912                 <fields oils_persist:primary="code">
2913                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2914                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2915                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2916                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2917                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2918                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2919                 </fields>
2920                 <links>
2921                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2922                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2923                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2924                 </links>
2925                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2926                         <actions>
2927                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <retrieve/>
2929                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2930                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2931                         </actions>
2932                 </permacrud>
2933         </class>
2934
2935     <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">
2936         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2937             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2938             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2939             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2940         </fields>
2941         <links>
2942             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2943             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2944         </links>
2945         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2946             <actions>
2947                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <retrieve/>
2949                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2950                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2951             </actions>
2952         </permacrud>
2953     </class>
2954
2955         <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">
2956                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2957                         <field name="active" reporter:datatype="bool"/>
2958                         <field name="create_date" reporter:datatype="timestamp"/>
2959                         <field name="creator" />
2960                         <field name="deleted" reporter:datatype="bool"/>
2961                         <field name="edit_date" reporter:datatype="timestamp"/>
2962                         <field name="editor" />
2963                         <field name="id" reporter:datatype="id" />
2964                         <field name="last_xact_id" />
2965                         <field name="marc" />
2966                         <field name="source" />
2967                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2968                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2969                         <field name="heading" />
2970                         <field name="simple_heading" />
2971                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2972                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2973                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2974                 </fields>
2975                 <links>
2976                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2977                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2978                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2979                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2980                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2981                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2982                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2983                 </links>
2984                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2985                         <actions>
2986                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2987                                 <retrieve/>
2988                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2989                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2990                         </actions>
2991                 </permacrud>
2992         </class>
2993         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2994                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2995                         <field name="char_encoding" />
2996                         <field name="id" />
2997                         <field name="record" />
2998                         <field name="record_status" />
2999                         <field name="thesaurus" />
3000                 </fields>
3001                 <links>
3002                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3003                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3004                 </links>
3005         </class>
3006         <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">
3007                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3008                         <field name="id" reporter:datatype="id" />
3009                         <field name="bib" reporter:datatype="link" />
3010                         <field name="authority" reporter:datatype="link" />
3011                 </fields>
3012                 <links>
3013                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3014                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3015                 </links>
3016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3017                         <actions>
3018                                 <retrieve/>
3019                         </actions>
3020                 </permacrud>
3021         </class>
3022         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3023                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3024                         <field name="id" reporter:datatype="id" />
3025                         <field name="record" reporter:datatype="link" />
3026                         <field name="atag" reporter:datatype="link" />
3027                         <field name="value" reporter:datatype="text" />
3028                         <field name="thesaurus" reporter:datatype="text" />
3029                 </fields>
3030                 <links>
3031                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3032                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3033                 </links>
3034         </class>
3035
3036         <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">
3037                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3038                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3039                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3040                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3041                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3042                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3043                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3044                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3045                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3046                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3047                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3048                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3049                 </fields>
3050                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3051                         <actions>
3052                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <retrieve/>
3054                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3055                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3056                         </actions>
3057                 </permacrud>
3058         </class>
3059
3060         <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">
3061                 <fields oils_persist:primary="code" oils_persist:sequence="">
3062                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3063                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3064                 </fields>
3065                 <links/>
3066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3067             <actions>
3068                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3069                 <retrieve/>
3070                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3071                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3072             </actions>
3073         </permacrud>
3074         </class>
3075         <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">
3076                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3077                         <field name="accepting_usr" />
3078                         <field name="amount" reporter:datatype="money" />
3079                         <field name="amount_collected" reporter:datatype="money" />
3080                         <field name="approval_code" reporter:datatype="text"/>
3081                         <field name="cash_drawer" reporter:datatype="link"/>
3082                         <field name="cc_number" reporter:datatype="text"/>
3083                         <field name="cc_order_number" reporter:datatype="text"/>
3084                         <field name="cc_processor" reporter:datatype="text"/>
3085                         <field name="id" reporter:datatype="id" />
3086                         <field name="note" reporter:datatype="text"/>
3087                         <field name="payment_ts" reporter:datatype="timestamp"/>
3088                         <field name="xact" reporter:datatype="link"/>
3089                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3090                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3091                 </fields>
3092                 <links>
3093                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3094                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3095                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3096                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3097                 </links>
3098         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3099             <actions>
3100                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3101                     <context link="xact" jump="usr" field="home_ou"/>
3102                 </retrieve>
3103                         </actions>
3104                 </permacrud>
3105         </class>
3106         <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">
3107                 <fields oils_persist:primary="name">
3108                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3109                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3110                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3111                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3112                 </fields>
3113                 <links/>
3114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3115             <actions>
3116                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3117                 <retrieve/>
3118                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3119                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3120             </actions>
3121         </permacrud>
3122         </class>
3123
3124         <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">
3125                 <fields oils_persist:primary="alias">
3126                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3127                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3128                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3129                 </fields>
3130                 <links>
3131                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3132                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3133                 </links>
3134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3135             <actions>
3136                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <retrieve/>
3138                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3139                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3140             </actions>
3141         </permacrud>
3142         </class>
3143
3144         <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">
3145                 <fields oils_persist:primary="name">
3146                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3147                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3148                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3149                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3150                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3151                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3152                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3153                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3154                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3155                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3156                 </fields>
3157                 <links>
3158                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3159                 </links>
3160         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3161             <actions>
3162                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3163                 <retrieve/>
3164                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3165                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3166             </actions>
3167         </permacrud>
3168         </class>
3169
3170         <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">
3171                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3172                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3173                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3174                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3175                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3176                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3177                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3178                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3179                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3180                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3181                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3182                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3183                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3184                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3185                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3186                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3187                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3188                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3189                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3190                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3191                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3192                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3193                 </fields>
3194                 <links>
3195                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3196                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3197                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3198                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3199                 </links>
3200         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3201             <actions>
3202                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3203                 <retrieve/>
3204                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3205                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3206             </actions>
3207         </permacrud>
3208         </class>
3209
3210         <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">
3211                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3212                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3213                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3214                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3215                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3216                 </fields>
3217                 <links>
3218                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3219                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3220                 </links>
3221         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3222             <actions>
3223                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3224                 <retrieve/>
3225                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3226                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3227             </actions>
3228         </permacrud>
3229         </class>
3230
3231         <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">
3232                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3233                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3234                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3235                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3236                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3237                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3238                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3239                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3240                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3241                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3242                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3243                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3244                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3245                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3246                 </fields>
3247                 <links>
3248                 </links>
3249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3250                         <actions>
3251                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3252                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3253                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3254                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3255                         </actions>
3256                 </permacrud>
3257         </class>
3258         <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">
3259                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3260                         <field name="id" reporter:datatype="id" />
3261                         <field name="name" reporter:datatype="text"/>
3262                         <field name="xpath" reporter:datatype="text"/>
3263                         <field name="format" reporter:datatype="link"/>
3264                         <field name="first_word" reporter:datatype="bool" />
3265                 </fields>
3266                 <links/>
3267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3268             <actions>
3269                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3270                 <retrieve/>
3271                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3272                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3273             </actions>
3274         </permacrud>
3275         </class>
3276         <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">
3277                 <fields oils_persist:primary="code" oils_persist:sequence="">
3278                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3279                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3280                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3281                 </fields>
3282                 <links/>
3283         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3284             <actions>
3285                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3286                 <retrieve/>
3287                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3288                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3289             </actions>
3290         </permacrud>
3291         </class>
3292         <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">
3293                 <fields oils_persist:primary="code" oils_persist:sequence="">
3294                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3295                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3296                 </fields>
3297                 <links/>
3298         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3299             <actions>
3300                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3301                 <retrieve/>
3302                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3303                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3304             </actions>
3305         </permacrud>
3306         </class>
3307     <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">
3308         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3309             <field reporter:label="ID" name="id" reporter:datatype="id" />
3310             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3311             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3312             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3313             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3314             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3315             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3316             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3317                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3318         </fields>
3319         <links>
3320             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3321             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3322             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3323                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3324         </links>
3325         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3326             <actions>
3327                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3328                 <retrieve/>
3329                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3330                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3331             </actions>
3332         </permacrud>
3333     </class>
3334     <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">
3335         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3336             <field reporter:label="ID" name="id" reporter:datatype="id" />
3337             <field reporter:label="Course" name="course" reporter:datatype="link" />
3338             <field reporter:label="User" name="usr" reporter:datatype="link" />
3339             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3340         </fields>
3341         <links>
3342             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3343             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3344             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3345         </links>
3346         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3347             <actions>
3348                 <create permission="MANAGE_RESERVES">
3349                                         <context link="course" field="owning_lib" />
3350                 </create>
3351                 <retrieve/>
3352                 <update permission="MANAGE_RESERVES">
3353                                         <context link="course" field="owning_lib" />
3354                 </update>
3355                 <delete permission="MANAGE_RESERVES">
3356                                         <context link="course" field="owning_lib" />
3357                 </delete>
3358             </actions>
3359         </permacrud>
3360     </class>
3361     <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">
3362         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3363             <field reporter:label="ID" name="id" reporter:datatype="id" />
3364             <field reporter:label="Course" name="course" reporter:datatype="link" />
3365             <field reporter:label="Item" name="item" reporter:datatype="link" />
3366             <field reporter:label="Record" name="record" reporter:datatype="link" />
3367             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3368             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3369             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3370             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3371             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3372             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3373             <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link" />
3374         </fields>
3375         <links>
3376             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3377             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3378             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3379             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3380             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3381             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3382             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3383             <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou" />
3384         </links>
3385         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3386             <actions>
3387                 <create permission="MANAGE_RESERVES">
3388                                         <context link="course" field="owning_lib" />
3389                 </create>
3390                 <retrieve/>
3391                 <update permission="MANAGE_RESERVES">
3392                                         <context link="course" field="owning_lib" />
3393                 </update>
3394                 <delete permission="MANAGE_RESERVES">
3395                                         <context link="course" field="owning_lib" />
3396                 </delete>
3397             </actions>
3398         </permacrud>
3399     </class>
3400         <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">
3401                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3402                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3403                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3404             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3405                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3406                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3407                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3408                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3409                 </fields>
3410                 <links>
3411             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3412                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3413                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3414                 </links>
3415                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3416                         <actions>
3417                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3418                                 <retrieve/>
3419                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3420                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3421                         </actions>
3422                 </permacrud>
3423         </class>
3424     <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">
3425         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3426             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3427             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3428             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3429         </fields>
3430         <links>
3431             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3432             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3433         </links>
3434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3435             <actions>
3436                 <create permission="MANAGE_RESERVES">
3437                                         <context link="course" field="owning_lib" />
3438                 </create>
3439                 <retrieve/>
3440                 <update permission="MANAGE_RESERVES">
3441                                         <context link="course" field="owning_lib" />
3442                 </update>
3443                 <delete permission="MANAGE_RESERVES">
3444                                         <context link="course" field="owning_lib" />
3445                 </delete>
3446             </actions>
3447         </permacrud>
3448     </class>
3449         <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">
3450                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3451                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3452                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3453             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3454                 </fields>
3455                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3456                         <actions>
3457                                 <create permission="MANAGE_RESERVES" global_required="true" />
3458                                 <retrieve/>
3459                                 <update permission="MANAGE_RESERVES" global_required="true" />
3460                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3461                         </actions>
3462                 </permacrud>
3463         </class>
3464         
3465     <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">
3466         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3467             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3468             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3469             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3470             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3471         </fields>
3472         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3473             <actions>
3474                 <retrieve/>
3475             </actions>
3476         </permacrud>
3477     </class>
3478         <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">
3479                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3480                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3481                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3482                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3483                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3484                 </fields>
3485                 <links>
3486                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3487                 </links>
3488         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3489             <actions>
3490                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3491                 <retrieve/>
3492                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3493                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3494             </actions>
3495         </permacrud>
3496         </class>
3497         <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">
3498                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3499                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3500                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3501                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3502                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3503                 </fields>
3504                 <links>
3505                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3506                 </links>
3507         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3508             <actions>
3509                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3510                 <retrieve/>
3511                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3512                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3513             </actions>
3514         </permacrud>
3515         </class>
3516         <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">
3517                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3518                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3519                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3520                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3521                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3522                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3523                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3524                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3525                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3526                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3527                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3528                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3529                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3530                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3531                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3532                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3533                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3534                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3535                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3536                 </fields>
3537                 <links>
3538                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3539                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3540                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3541                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3542                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3543                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3544                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3545                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3546                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3547                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3548                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3549                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3550                 </links>
3551         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3552             <actions>
3553                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3554                 <retrieve/>
3555                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3556                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3557             </actions>
3558         </permacrud>
3559         </class>
3560         <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">
3561                 <fields oils_persist:primary="call_number">
3562                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3563                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3564                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3565                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3566                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3567                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3568                 </fields>
3569                 <links>
3570                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3571                 </links>
3572         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3573             <actions>
3574                 <retrieve/>
3575             </actions>
3576         </permacrud>
3577         </class>
3578         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3579                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3580                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3581                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3582                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3583                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3584                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3585                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3586                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3587                 </fields>
3588                 <links>
3589                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3590                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3591         </links>
3592         </class>
3593         <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">
3594                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3595                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3596                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3597                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3598                 </fields>
3599                 <links>
3600                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3601                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3602                 </links>
3603         </class>
3604         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3605                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3606                         <field name="id" reporter:datatype="id" />
3607                         <field name="value" oils_persist:i18n="true" />
3608                 </fields>
3609                 <links/>
3610         </class>
3611         <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">
3612                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3613                         <field name="balance_owed" reporter:datatype="money" />
3614                         <field name="total_owed" reporter:datatype="money" />
3615                         <field name="total_paid" reporter:datatype="money" />
3616                         <field name="usr" reporter:datatype="link"/>
3617                 </fields>
3618                 <links>
3619                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3620         </links>
3621         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3622             <actions>
3623                 <retrieve permission="VIEW_USER">
3624                     <context link="usr" field="home_ou"/>
3625                 </retrieve>
3626             </actions>
3627         </permacrud>
3628         </class>
3629         <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">
3630                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3631                         <field name="balance_owed" reporter:datatype="money" />
3632                         <field name="total_owed" reporter:datatype="money" />
3633                         <field name="total_paid" reporter:datatype="money" />
3634                         <field name="usr" reporter:datatype="link"/>
3635                 </fields>
3636                 <links>
3637                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3638         </links>
3639         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3640             <actions>
3641                 <retrieve permission="VIEW_USER">
3642                     <context link="usr" field="home_ou"/>
3643                 </retrieve>
3644             </actions>
3645         </permacrud>
3646         </class>
3647         <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">
3648                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3649                         <field name="collector" />
3650                         <field name="enter_time" reporter:datatype="timestamp"/>
3651                         <field name="id" reporter:datatype="id" />
3652                         <field name="location" reporter:datatype="link"/>
3653                         <field name="usr" reporter:datatype="link"/>
3654                 </fields>
3655                 <links>
3656                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3657                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3658                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3659                 </links>
3660         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3661             <actions>
3662                 <create permission="money.collections_tracker.create" context_field="location"/>
3663                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3664                 <delete permission="money.collections_tracker.create" context_field="location"/>
3665             </actions>
3666         </permacrud>
3667         </class>
3668         <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">
3669                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3670                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3671                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3672                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3673                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3674                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3675                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3676                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3677                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3678                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3679                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3680                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3681                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3682                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3683                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3684                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3685                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3686                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3687                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3688                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3704                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3705                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3706                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3707                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3708                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3709                 </fields>
3710                 <links>
3711                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3712                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3713                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3714                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3715                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3716                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3717                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3718                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3719                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3720                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3721                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3722                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3723                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3724                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3725                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3726                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3727                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3728                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3729                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3730                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3731                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3732                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3733                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3734                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3735                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3736                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3737                 </links>
3738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3739             <actions>
3740                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3741                 <retrieve/>
3742                 <update permission="UPDATE_MARC" global_required="true"/>
3743                 <!-- 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. -->
3744                 <delete permission="DELETE_RECORD" global_required="true"/>
3745             </actions>
3746         </permacrud>
3747         </class>
3748         <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">
3749                 <fields oils_persist:primary="id">
3750                         <field name="dow_0_close" />
3751                         <field name="dow_0_open" />
3752                         <field name="dow_0_note"  reporter:datatype="text" />
3753                         <field name="dow_1_close" />
3754                         <field name="dow_1_open" />
3755                         <field name="dow_1_note"  reporter:datatype="text" />
3756                         <field name="dow_2_close" />
3757                         <field name="dow_2_open" />
3758                         <field name="dow_2_note"  reporter:datatype="text" />
3759                         <field name="dow_3_close" />
3760                         <field name="dow_3_open" />
3761                         <field name="dow_3_note"  reporter:datatype="text" />
3762                         <field name="dow_4_close" />
3763                         <field name="dow_4_open" />
3764                         <field name="dow_4_note"  reporter:datatype="text" />
3765                         <field name="dow_5_close" />
3766                         <field name="dow_5_open" />
3767                         <field name="dow_5_note"  reporter:datatype="text" />
3768                         <field name="dow_6_close" />
3769                         <field name="dow_6_open" />
3770                         <field name="dow_6_note"  reporter:datatype="text" />
3771                         <field name="id" reporter:datatype="id" />
3772                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3773                 </fields>
3774                 <links>
3775                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3776                 </links>
3777         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3778             <actions>
3779                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3780                 <retrieve/>
3781                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3782                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3783             </actions>
3784         </permacrud>
3785         </class>
3786         <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">
3787                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3788                         <field name="id" reporter:datatype="id" />
3789                         <field name="record" reporter:datatype="link"/>
3790                         <field name="label" reporter:datatype="text"/>
3791                         <field name="label_sortkey" reporter:datatype="text"/>
3792                         <field name="deleted" reporter:datatype="bool"/>
3793                 </fields>
3794                 <links>
3795                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3796                 </links>
3797         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3798             <actions>
3799                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3800                 <retrieve/>
3801                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3802                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3803             </actions>
3804         </permacrud>
3805         </class>
3806         <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">
3807                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3808                         <field name="id" reporter:datatype="id" />
3809                         <field name="target_copy" reporter:datatype="link" />
3810                         <field name="part" reporter:datatype="link"/>
3811                 </fields>
3812                 <links>
3813                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3814                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3815                 </links>
3816         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3817             <actions>
3818                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3819                 <retrieve/>
3820                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3821                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3822             </actions>
3823         </permacrud>
3824         </class>
3825     <class  id="aecc"
3826             controller="open-ils.cstore open-ils.pcrud"
3827             oils_obj:fieldmapper="action::emergency_closing_circulation"
3828             oils_persist:tablename="action.emergency_closing_circulation"
3829             reporter:label="Emergency Closing Circulation Entry"
3830             oils_persist:readonly="true"
3831     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3832         <fields oils_persist:primary="id">
3833             <field name="id" reporter:datatype="id" />
3834             <field name="circulation" reporter:datatype="link" />
3835                         <field name="emergency_closing" reporter:datatype="link"/>
3836             <field name="original_due_date" reporter:datatype="timestamp" />
3837             <field name="process_time" reporter:datatype="timestamp" />
3838         </fields>
3839         <links>
3840             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3841             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3842         </links>
3843         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3844             <actions>
3845                 <retrieve/>
3846             </actions>
3847         </permacrud>
3848     </class>
3849     <class  id="aecr"
3850             controller="open-ils.cstore open-ils.pcrud"
3851             oils_obj:fieldmapper="action::emergency_closing_reservation"
3852             oils_persist:tablename="action.emergency_closing_reservation"
3853             reporter:label="Emergency Closing Reservation Entry"
3854             oils_persist:readonly="true"
3855     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3856         <fields oils_persist:primary="id">
3857             <field name="id" reporter:datatype="id" />
3858             <field name="reservation" reporter:datatype="link" />
3859                         <field name="emergency_closing" reporter:datatype="link"/>
3860             <field name="original_end_time" reporter:datatype="timestamp" />
3861             <field name="process_time" reporter:datatype="timestamp" />
3862         </fields>
3863         <links>
3864             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3865             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3866         </links>
3867         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3868             <actions>
3869                 <retrieve/>
3870             </actions>
3871         </permacrud>
3872     </class>
3873     <class  id="aech"
3874             controller="open-ils.cstore open-ils.pcrud"
3875             oils_obj:fieldmapper="action::emergency_closing_hold"
3876             oils_persist:tablename="action.emergency_closing_hold"
3877             reporter:label="Emergency Closing Hold Entry"
3878             oils_persist:readonly="true"
3879     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3880         <fields oils_persist:primary="id">
3881             <field name="id" reporter:datatype="id" />
3882             <field name="hold" reporter:datatype="link" />
3883                         <field name="emergency_closing" reporter:datatype="link"/>
3884             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3885             <field name="process_time" reporter:datatype="timestamp" />
3886         </fields>
3887         <links>
3888             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3889             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3890         </links>
3891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3892             <actions>
3893                 <retrieve/>
3894             </actions>
3895         </permacrud>
3896     </class>
3897     <class  id="aecs"
3898             controller="open-ils.cstore open-ils.pcrud"
3899             oils_obj:fieldmapper="action::emergency_closing_status"
3900             oils_persist:tablename="action.emergency_closing_status"
3901             reporter:label="Emergency Closing Status"
3902             oils_persist:readonly="true"
3903     >
3904         <fields oils_persist:primary="id">
3905             <field name="id" reporter:datatype="id" />
3906             <field name="creator" reporter:datatype="link" />
3907             <field name="create_time" reporter:datatype="timestamp" />
3908             <field name="process_start_time" reporter:datatype="timestamp" />
3909             <field name="process_end_time" reporter:datatype="timestamp" />
3910             <field name="last_update_time" reporter:datatype="timestamp" />
3911             <field name="circulations" reporter:datatype="int" />
3912             <field name="circulations_complete" reporter:datatype="int" />
3913             <field name="reservations" reporter:datatype="int" />
3914             <field name="reservations_complete" reporter:datatype="int" />
3915             <field name="holds" reporter:datatype="int" />
3916             <field name="holds_complete" reporter:datatype="int" />
3917         </fields>
3918         <links>
3919             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3920         </links>
3921         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3922             <actions>
3923                 <retrieve/>
3924             </actions>
3925         </permacrud>
3926     </class>
3927     <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">
3928         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3929             <field name="id" reporter:datatype="id" />
3930             <field name="creator" reporter:datatype="link" />
3931             <field name="create_time" reporter:datatype="timestamp" />
3932             <field name="process_start_time" reporter:datatype="timestamp" />
3933             <field name="process_end_time" reporter:datatype="timestamp" />
3934             <field name="last_update_time" reporter:datatype="timestamp" />
3935             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3936             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3937             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3938             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3939             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3940         </fields>
3941         <links>
3942             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3943             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3944             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3945             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3946             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3947             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3948         </links>
3949         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3950             <actions>
3951                 <create permission="EMERGENCY_CLOSING">
3952                     <context link="closing" field="org_unit" />
3953                 </create>
3954                 <retrieve/>
3955                 <update permission="EMERGENCY_CLOSING">
3956                     <context link="closing" field="org_unit" />
3957                 </update>
3958                 <delete permission="EMERGENCY_CLOSING">
3959                     <context link="closing" field="org_unit" />
3960                 </delete>
3961             </actions>
3962         </permacrud>
3963     </class>
3964         <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">
3965                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3966                         <field name="close_end" reporter:datatype="timestamp" />
3967                         <field name="close_start" reporter:datatype="timestamp" />
3968                         <field name="id" reporter:datatype="id" />
3969                         <field name="org_unit" reporter:datatype="org_unit"/>
3970                         <field name="reason" reporter:datatype="text"/>
3971                         <field name="full_day" reporter:datatype="bool"/>
3972                         <field name="multi_day" reporter:datatype="bool"/>
3973                         <field name="emergency_closing" reporter:datatype="link"/>
3974                 </fields>
3975                 <links>
3976                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3977                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3978                 </links>
3979         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3980             <actions>
3981                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3982                 <retrieve/>
3983                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3984                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3985             </actions>
3986         </permacrud>
3987         </class>
3988         <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">
3989                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3990                         <field name="extended" reporter:datatype="interval"/>
3991                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3992                         <field name="max_renewals" reporter:datatype="int" />
3993                         <field name="name" reporter:datatype="text"/>
3994                         <field name="normal" reporter:datatype="interval"/>
3995                         <field name="shrt" reporter:datatype="interval"/>
3996                         <field name="max_auto_renewals" reporter:datatype="int" />
3997                 </fields>
3998                 <links>
3999                 </links>
4000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4001             <actions>
4002                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4003                 <retrieve/>
4004                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4005                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4006             </actions>
4007         </permacrud>
4008         </class>
4009
4010         <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">
4011                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4012                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4013                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4014             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4015                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4016             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4017                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4018                                 reporter:datatype="link" config_field="true"/>
4019                 </fields>
4020                 <links>
4021             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4022                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4023                 </links>
4024                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4025             <actions>
4026                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4027                 <retrieve/>
4028                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4029                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4030             </actions>
4031                 </permacrud>
4032         </class>
4033
4034         <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">
4035                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4036                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4037                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4038                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4039             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4040                 </fields>
4041                 <links>
4042                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4043                 </links>
4044                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4045             <actions>
4046                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4047                 <retrieve/>
4048                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4049                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4050             </actions>
4051                 </permacrud>
4052         </class>
4053
4054         <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">
4055                 <fields oils_persist:primary="id" oils_persist:sequence="">
4056                         <field name="balance_owed" reporter:datatype="money"/>
4057                         <field name="id" reporter:datatype="id" />
4058                         <field name="last_billing_note" reporter:datatype="text"/>
4059                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4060                         <field name="last_billing_type" reporter:datatype="text"/>
4061                         <field name="last_payment_note" reporter:datatype="text"/>
4062                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4063                         <field name="last_payment_type" reporter:datatype="text"/>
4064                         <field name="total_owed" reporter:datatype="money"/>
4065                         <field name="total_paid" reporter:datatype="money"/>
4066                         <field name="usr" reporter:datatype="link"/>
4067                         <field name="xact_finish" reporter:datatype="timestamp" />
4068                         <field name="xact_start" reporter:datatype="timestamp" />
4069                         <field name="xact_type" reporter:datatype="text"/>
4070                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4071                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4072                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4073                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4074                         <field name="billing_location" reporter:datatype="link"/>
4075                 </fields>
4076                 <links>
4077                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4078                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4079                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4080                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4081                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4082                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4083                 </links>
4084                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4085                         <actions>
4086                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4087                                         <context link="usr" field="home_ou" />
4088                                 </retrieve>
4089                         </actions>
4090                 </permacrud>
4091         </class>
4092         <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">
4093                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4094                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4096                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4097                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4098                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4099                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4100                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4101                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4102                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4103                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4104                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4105                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4106                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4107                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4108                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4109                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4110                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4111                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4112                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4113                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4114                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4115                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4116                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4117                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4118                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4119                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4120                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4121                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4122                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4123                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4124                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4125                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4126                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4127                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4128                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4129                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4130                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4131                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4132                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4133                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4134                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4135                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4136                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4137                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4138                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4139                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4140                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4141                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4142                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4143                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4144                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4145                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4146                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4147                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4148                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4149                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4150                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4151                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4152                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4153                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4154                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4155                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4156                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4157                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4158                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4159                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4160                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4161                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4162                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4163                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4164                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4165                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4166             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4167                 </fields>
4168                 <links>
4169                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4170                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4171                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4172                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4173                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4174                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4175                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4176                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4177                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4178                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4179                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4180                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4181                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4182                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4183                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4184                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4185                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4186                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4187                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4188                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4189                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4190                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4191                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4192                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4193                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4194                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4195                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4196                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4197                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4198                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4199                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4200                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4201             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4202                 </links>
4203                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4204                         <actions>
4205                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4206                         </actions>
4207                 </permacrud>
4208         </class>
4209         <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">
4210                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4211                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4212                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4213                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4214                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4215                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4216                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4217                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4218                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4219         </fields>
4220                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4221                         <actions>
4222                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4223                                 <retrieve/>
4224                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4225                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4226                         </actions>
4227                 </permacrud>
4228         </class>
4229         <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">
4230                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4231                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4232                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4233                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4234                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4235         </fields>
4236         <links>
4237                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4238                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4239                 </links>
4240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4241                         <actions>
4242                                 <retrieve permission="RUN_REPORTS">
4243                                         <context link="usr" field="home_ou" />
4244                                 </retrieve>
4245                         </actions>
4246                 </permacrud>
4247         </class>
4248         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4249                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4250                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4251                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4252                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4253                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4254                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4255                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4256         </fields>
4257         <links>
4258                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4259                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4260                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4261                 </links>
4262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4263                         <actions>
4264                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4265                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4266                                         <context link="usr" field="home_ou" />
4267                                         <context link="ws" field="owning_lib" />
4268                                 </retrieve>
4269                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4270                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4271                         </actions>
4272                 </permacrud>
4273         </class>
4274         <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">
4275                 <fields oils_persist:primary="name">
4276                         <field name="name" reporter:datatype="text"/>
4277                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4278                 </fields>
4279                 <links/>
4280                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4281                         <actions>
4282                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4283                                 <retrieve/>
4284                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4285                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4286                         </actions>
4287                 </permacrud>
4288         </class>
4289         <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">
4290                 <fields oils_persist:primary="name">
4291                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4292                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4293                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4294                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4295                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4296                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4297                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4298                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4299                 </fields>
4300                 <links>
4301                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4302                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4303                 </links>
4304                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4305                         <actions>
4306                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4307                                 <retrieve/>
4308                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4309                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4310                         </actions>
4311                 </permacrud>
4312         </class>
4313         <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">
4314                 <fields oils_persist:primary="name">
4315                         <field name="name" reporter:datatype="text"/>
4316                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4317                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4318                         <field name="datatype" reporter:datatype="text"/>
4319                         <field name="view_perm" reporter:datatype="link"/>
4320                         <field name="update_perm" reporter:datatype="link"/>
4321                         <field name="fm_class" reporter:datatype="text"/>
4322                         <field name="grp" reporter:datatype="link"/>
4323                 </fields>
4324                 <links>
4325                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4326                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4327                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4328                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4329                 </links>
4330                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4331                         <actions>
4332                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4333                                 <retrieve/>
4334                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4335                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4336                         </actions>
4337                 </permacrud>
4338         </class>
4339         <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">
4340                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4341                         <field name="id" />
4342                         <field name="name"  reporter:datatype="text"/>
4343                         <field name="org_unit" reporter:datatype="org_unit"/>
4344                         <field name="value"  reporter:datatype="text"/>
4345                 </fields>
4346                 <links>
4347                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4348                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4349                 </links>
4350         </class>
4351         <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">
4352                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4353                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4354                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4355                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4356                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4357                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4358                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4359                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4360                 </fields>
4361                 <links>
4362                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4363                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4364                 </links>
4365         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4366             <actions>
4367                 <create permission="CREATE_COPY_NOTE">
4368                     <context link="owning_copy" field="circ_lib"/>
4369                 </create>
4370                 <retrieve permission="VIEW_COPY_NOTES">
4371                     <context link="owning_copy" field="circ_lib"/>
4372                 </retrieve>
4373                 <update permission="UPDATE_COPY_NOTE">
4374                     <context link="owning_copy" field="circ_lib"/>
4375                 </update>
4376                 <delete permission="DELETE_COPY_NOTE">
4377                     <context link="owning_copy" field="circ_lib"/>
4378                 </delete>
4379             </actions>
4380         </permacrud>
4381         </class>
4382         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4383                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4384                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4385                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4386                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4387                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4388                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4389                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4390                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4391                 </fields>
4392                 <links>
4393                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4394                 </links>
4395         </class>
4396         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4397                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4398                         <field name="fingerprint"  reporter:datatype="text"/>
4399                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4400                         <field name="master_record" reporter:datatype="link"/>
4401                         <field name="mods"  reporter:datatype="text"/>
4402                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4403                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4404                 </fields>
4405                 <links>
4406                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4407                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4408                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4409                 </links>
4410                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4411                         <actions>
4412                                 <retrieve/>
4413                         </actions>
4414                 </permacrud>
4415         </class>
4416         <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">
4417                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4418                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4419                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4420                 </fields>
4421                 <links/>
4422         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4423             <actions>
4424                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4425                 <retrieve/>
4426                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4427                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4428             </actions>
4429         </permacrud>
4430         </class>
4431         <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">
4432                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4433                         <field name="code"  reporter:datatype="text"/>
4434                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4435                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4436                 </fields>
4437                 <links/>
4438         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4439             <actions>
4440                 <create permission="CREATE_PERM" global_required="true"/>
4441                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4442                 <update permission="UPDATE_PERM" global_required="true"/>
4443                 <delete permission="DELETE_PERM" global_required="true"/>
4444             </actions>
4445         </permacrud>
4446         </class>
4447         <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">
4448                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4449                         <field name="id" reporter:datatype="id" />
4450                         <field name="metarecord" reporter:datatype="link"/>
4451                         <field name="source" reporter:datatype="link"/>
4452                 </fields>
4453                 <links>
4454                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4455                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4456                 </links>
4457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4458                         <actions>
4459                                 <retrieve/>
4460                         </actions>
4461                 </permacrud>
4462         </class>
4463         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4464                         oils_obj:fieldmapper="metabib::display_entry" 
4465                         oils_persist:tablename="metabib.display_entry" 
4466                         oils_persist:field_safe="true"
4467                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4468                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4469                         <field name="id" reporter:datatype="id" />
4470                         <field name="field" reporter:datatype="link"/>
4471                         <field name="source" reporter:datatype="link"/>
4472                         <field name="value"  reporter:datatype="text"/>
4473                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4474                 </fields>
4475                 <links>
4476                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4477                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4478                 </links>
4479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4480                         <actions>
4481                                 <retrieve/>
4482                         </actions>
4483                 </permacrud>
4484         </class>
4485         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4486                 oils_persist:tablename="metabib.flat_display_entry"
4487                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4488                 oils_persist:field_safe="true"
4489                 reporter:label="Flat Display Entry" 
4490                 oils_persist:readonly="true">
4491                 <fields>
4492                         <field name="source" reporter:datatype="id" />
4493                         <field name="name" reporter:datatype="text"/>
4494                         <field name="multi" reporter:datatype="bool"/>
4495                         <field name="label" reporter:datatype="text"/>
4496                         <field name="field" reporter:datatype="link"/>
4497                         <field name="value" reporter:datatype="text"/>
4498                 </fields>
4499                 <links>
4500                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4501                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4502                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4503                 </links>
4504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4505                         <actions>
4506                                 <retrieve/>
4507                         </actions>
4508                 </permacrud>
4509         </class>
4510         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4511                 oils_persist:tablename="metabib.compressed_display_entry"
4512                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4513                 oils_persist:field_safe="true"
4514                 reporter:label="Compressed Display Entry" 
4515                 oils_persist:readonly="true">
4516                 <fields>
4517                         <field name="source" reporter:datatype="id" />
4518                         <field name="name" reporter:datatype="text"/>
4519                         <field name="multi" reporter:datatype="bool"/>
4520                         <field name="label" reporter:datatype="text"/>
4521                         <field name="field" reporter:datatype="link"/>
4522                         <field name="value" reporter:datatype="text"/>
4523                 </fields>
4524                 <links>
4525                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4526                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4527                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4528                 </links>
4529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4530                         <actions>
4531                                 <retrieve/>
4532                         </actions>
4533                 </permacrud>
4534         </class>
4535         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4536                 oils_persist:tablename="metabib.wide_display_entry"
4537                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4538                 oils_persist:field_safe="true"
4539                 reporter:label="Wide Display Entry" 
4540                 oils_persist:readonly="true">
4541                 <fields oils_persist:primary="source">
4542                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4543                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4544                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4545                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4546                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4547                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4548                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4549                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4550                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4551                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4552                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4553                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4554                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4555                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4556                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4557                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4558                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4559                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4560                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4561                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4562                 </fields>
4563                 <links>
4564                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4565                 </links>
4566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4567                         <actions>
4568                                 <retrieve/>
4569                         </actions>
4570                 </permacrud>
4571         </class>
4572
4573         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4574                 oils_persist:tablename="config.display_field_map"
4575                 oils_obj:fieldmapper="config::display_field_map"
4576                 oils_persist:field_safe="true"
4577                 reporter:label="Display Field Map">
4578                 <fields oils_persist:primary="name">
4579                         <field name="name" reporter:datatype="text"/>
4580                         <field name="field" reporter:datatype="link"/>
4581                         <field name="multi" reporter:datatype="bool"/>
4582                 </fields>
4583                 <links>
4584                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4585                 </links>
4586                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4587                         <actions>
4588                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4589                                 <retrieve/>
4590                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4591                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4592                         </actions>
4593                 </permacrud>
4594         </class>
4595
4596         <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">
4597                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4598                         <field name="id" reporter:datatype="id" />
4599                         <field name="field" reporter:datatype="link"/>
4600                         <field name="source" reporter:datatype="link"/>
4601                         <field name="value"  reporter:datatype="text"/>
4602                 </fields>
4603                 <links>
4604                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4605                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4606                 </links>
4607         </class>
4608         <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">
4609                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4610                         <field name="id" reporter:datatype="id" />
4611                         <field name="value" reporter:datatype="text"/>
4612                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4613                 </fields>
4614                 <links>
4615                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4616                 </links>
4617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4618                         <actions>
4619                                 <retrieve/>
4620                         </actions>
4621                 </permacrud>
4622         </class>
4623         <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">
4624                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4625                         <field name="id" reporter:datatype="id" />
4626                         <field name="entry" reporter:datatype="link"/>
4627                         <field name="def" reporter:datatype="link"/>
4628                         <field name="source" reporter:datatype="link"/>
4629                 </fields>
4630                 <links>
4631                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4632                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4633                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4634                 </links>
4635         </class>
4636         <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">
4637                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4638                         <field name="id" reporter:datatype="id" />
4639                         <field name="entry" reporter:datatype="link"/>
4640                         <field name="simple_heading" reporter:datatype="link"/>
4641                 </fields>
4642                 <links>
4643                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4644                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4645                 </links>
4646         </class>
4647         <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">
4648                 <oils_persist:source_definition><![CDATA[
4649                         SELECT * FROM metabib.author_field_entry
4650                                                 UNION ALL
4651                         SELECT * FROM metabib.keyword_field_entry
4652                                                 UNION ALL
4653                         SELECT * FROM metabib.identifier_field_entry
4654                                                 UNION ALL
4655                         SELECT * FROM metabib.title_field_entry
4656                                                 UNION ALL
4657                         SELECT * FROM metabib.subject_field_entry
4658                                                 UNION ALL
4659                         SELECT * FROM metabib.series_field_entry
4660                 ]]></oils_persist:source_definition>
4661                 <fields>
4662                         <field name="field" reporter:datatype="link"/>
4663                         <field name="id" reporter:datatype="id" />
4664                         <field name="source" reporter:datatype="link"/>
4665                         <field name="value"  reporter:datatype="text"/>
4666                 </fields>
4667                 <links>
4668                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4669                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4670                 </links>
4671         </class>
4672         <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">
4673                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4674                         <field name="field" reporter:datatype="link"/>
4675                         <field name="id" reporter:datatype="id" />
4676                         <field name="source" reporter:datatype="link"/>
4677                         <field name="value"  reporter:datatype="text"/>
4678                 </fields>
4679                 <links>
4680                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4681                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4682                 </links>
4683         </class>
4684         <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">
4685                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4686                         <field name="accepting_usr" reporter:datatype="link"/>
4687                         <field name="amount" reporter:datatype="money" />
4688                         <field name="amount_collected" reporter:datatype="money" />
4689                         <field name="cash_drawer" reporter:datatype="link"/>
4690                         <field name="id" reporter:datatype="id" />
4691                         <field name="note"  reporter:datatype="text"/>
4692                         <field name="payment_ts" reporter:datatype="timestamp"/>
4693                         <field name="xact" reporter:datatype="link"/>
4694                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4695                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4696                 </fields>
4697                 <links>
4698                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4699                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4700                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4701                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4702                 </links>
4703         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4704             <actions>
4705                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4706                     <context link="xact" jump="usr" field="home_ou"/>
4707                 </retrieve>
4708                         </actions>
4709                 </permacrud>
4710         </class>
4711         <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">
4712                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4713                         <field name="accepting_usr" reporter:datatype="link"/>
4714                         <field name="amount" reporter:datatype="money" />
4715                         <field name="amount_collected" reporter:datatype="money" />
4716                         <field name="id" reporter:datatype="id" />
4717                         <field name="note"  reporter:datatype="text"/>
4718                         <field name="payment_ts" reporter:datatype="timestamp"/>
4719                         <field name="xact" reporter:datatype="link"/>
4720                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4721                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4722                 </fields>
4723                 <links>
4724                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4725                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4726                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4727                 </links>
4728         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4729             <actions>
4730                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4731                     <context link="xact" jump="usr" field="home_ou"/>
4732                 </retrieve>
4733                         </actions>
4734                 </permacrud>
4735         </class>
4736         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4737                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4738                         <field name="accepting_usr" reporter:datatype="link"/>
4739                         <field name="amount" reporter:datatype="money" />
4740                         <field name="amount_collected" reporter:datatype="money" />
4741                         <field name="id" reporter:datatype="id" />
4742                         <field name="note"  reporter:datatype="text"/>
4743                         <field name="payment_ts" reporter:datatype="timestamp"/>
4744                         <field name="xact" reporter:datatype="link"/>
4745                         <field name="billing" reporter:datatype="link"/>
4746                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4747                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4748                 </fields>
4749                 <links>
4750                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4751                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4752                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4753                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4754                 </links>
4755         </class>
4756         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4757                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4758                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4759                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4760                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4761                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4762                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4763                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4764                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4765                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4766                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4767                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4768                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4769                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4770                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4771                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4772                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4773                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4774                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4775                 </fields>
4776                 <links>
4777                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4778                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4779                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4780                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4781                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4782                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4783                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4784                 </links>
4785         </class>
4786
4787         <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">
4788                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4789                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4790                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4791                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4792                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4793                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4794                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4795                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4796                 </fields>
4797                 <links/>
4798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4799             <actions>
4800                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4801                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4802                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4803                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4804             </actions>
4805         </permacrud>
4806         </class>
4807         <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">
4808                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4809                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4810                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4811                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4812                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4813                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4814                 </fields>
4815                 <links>
4816                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4817                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4818                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4819         </links>
4820         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4821             <actions>
4822                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4823                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4824                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4825                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4826             </actions>
4827         </permacrud>
4828         </class>
4829         <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">
4830                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4831                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4832                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4833                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4834                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4835             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4836             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4837             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4838             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4839                 </fields>
4840                 <links/>
4841         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4842             <actions>
4843                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4844                 <retrieve/>
4845                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4846                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4847             </actions>
4848         </permacrud>
4849         </class>
4850         <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">
4851                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4852                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4853                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4854                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4855                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4856                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4857                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4858                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4859                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4860                 </fields>
4861                 <links>
4862                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4863                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4864                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4865                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4866                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4867                 </links>
4868                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4869                         <actions>
4870                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4871                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4872                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4873                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4874                         </actions>
4875                 </permacrud>
4876         </class>
4877         <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">
4878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4879                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4880                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4881                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4882                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4883                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4884                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4885                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4886                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4887                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4888                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4889                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4890                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4891                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4892                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4893                 </fields>
4894                 <links>
4895                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4896                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4897                 </links>
4898                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4899                         <actions>
4900                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4901                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4902                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4903                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4904                         </actions>
4905                 </permacrud>
4906         </class>
4907         <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">
4908                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4909                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4910                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4911                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4912                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4913                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4914                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4915                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4916                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4917                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4918                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4919                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4920                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4921                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4922                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4923                 </fields>
4924                 <links>
4925                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4926                 </links>
4927                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4928                         <actions>
4929                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4930                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4931                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4932                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4933                         </actions>
4934                 </permacrud>
4935         </class>
4936
4937
4938         <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">
4939                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4940                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4941                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4942                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4943                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4944                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4945                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4946                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4947                 </fields>
4948                 <links>
4949                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4950                 </links>
4951         </class>
4952
4953         <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">
4954                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4955                         <field name="call_number" />
4956                         <field name="create_date" reporter:datatype="timestamp"/>
4957                         <field name="creator" reporter:datatype="link"/>
4958                         <field name="id" reporter:datatype="id" />
4959                         <field name="pub" reporter:datatype="bool"/>
4960                         <field name="title"  reporter:datatype="text"/>
4961                         <field name="value"  reporter:datatype="text"/>
4962                 </fields>
4963                 <links>
4964                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4965                 </links>
4966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4967             <actions>
4968                 <create permission="CREATE_VOLUME_NOTE">
4969                     <context link="call_number" field="owning_lib"/>
4970                 </create>
4971                 <retrieve permission="VIEW_VOLUME_NOTES">
4972                     <context link="call_number" field="owning_lib"/>
4973                 </retrieve>
4974                 <update permission="UPDATE_VOLUME_NOTE">
4975                     <context link="call_number" field="owning_lib"/>
4976                 </update>
4977                 <delete permission="DELETE_VOLUME_NOTE">
4978                     <context link="call_number" field="owning_lib"/>
4979                 </delete>
4980             </actions>
4981         </permacrud>
4982         </class>
4983         <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">
4984                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4985                         <field name="create_date" reporter:datatype="timestamp"/>
4986                         <field name="creator" reporter:datatype="link"/>
4987                         <field name="edit_date" reporter:datatype="timestamp"/>
4988                         <field name="editor" reporter:datatype="link"/>
4989                         <field name="id" reporter:datatype="id" />
4990                         <field name="record" reporter:datatype="link"/>
4991                         <field name="value" reporter:datatype="text"/>
4992                 </fields>
4993                 <links>
4994                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4995                 </links>
4996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4997             <actions>
4998                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4999                 <retrieve/>
5000                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5001                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5002             </actions>
5003         </permacrud>
5004         </class>
5005         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
5006         <oils_persist:source_definition><![CDATA[
5007 SELECT  usr,
5008         SUM(
5009             CASE
5010                 WHEN (
5011                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5012                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5013                 ) THEN 1
5014                 ELSE 0
5015             END
5016         ) AS out,
5017
5018         SUM(
5019             CASE
5020                 WHEN (
5021                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5022                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5023                 ) THEN 1
5024                 ELSE 0
5025             END
5026         ) AS overdue,
5027
5028         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5029         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5030         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5031   FROM  action.circulation
5032   WHERE checkin_time IS NULL
5033   GROUP BY 1
5034         ]]></oils_persist:source_definition>
5035         <fields oils_persist:primary="usr">
5036             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5037             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5038             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5039             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5040             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5041             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5042         </fields>
5043         <links>
5044             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5045         </links>
5046         </class>
5047         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5048         <oils_persist:source_definition><![CDATA[
5049 SELECT  usr,
5050         STRING_AGG(
5051             CASE
5052                 WHEN (
5053                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5054                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5055                 ) THEN id::TEXT
5056                 ELSE '0'
5057             END
5058         ,',') AS out,
5059
5060         STRING_AGG(
5061             CASE
5062                 WHEN (
5063                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5064                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5065                 ) THEN id::TEXT
5066                 ELSE '0'
5067             END
5068         ,',') AS overdue,
5069
5070         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5071         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5072         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5073   FROM  action.circulation
5074   WHERE checkin_time IS NULL
5075   GROUP BY 1
5076         ]]></oils_persist:source_definition>
5077         <fields oils_persist:primary="usr">
5078             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5079             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5080             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5081             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5082             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5083             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5084         </fields>
5085         <links>
5086             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5087         </links>
5088         </class>
5089         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5090                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5091                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5092                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5093                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5094                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5095                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5096                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5097                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5098                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5099                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5100                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5101                 </fields>
5102                 <links>
5103                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5104                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5105                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5106                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5107                 </links>
5108         </class>
5109         <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">
5110                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5111                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5112                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5113                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5114                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5115                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5116                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5117                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5118                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5119                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5120                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5121                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5122                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5123                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5124                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5125                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5126                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5127                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5128                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5129                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5130                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5131                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5132                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5133                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5134                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5135                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5136                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5137                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5138                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5139                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5140                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5141                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5142                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5143                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5144                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5145                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5146                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5147                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5148                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5149                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5150                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5151                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5152                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5153                 </fields>
5154                 <links>
5155                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5156                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5157                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5158                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5159                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5160                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5161                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5162                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5163                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5164                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5165                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5166                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5167                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5168                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5169                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5170                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5171                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5172                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5173                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5174                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5175                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5176                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5177                 </links>
5178                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5179                         <actions>
5180                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5181                         </actions>
5182                 </permacrud>
5183         </class>
5184         <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">
5185                 <fields>
5186                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5187                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5188                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5189                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5190                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5191                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5192                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5193                 </fields>
5194                 <links>
5195                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5196                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5197                 </links>
5198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5199                         <actions>
5200                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5201                         </actions>
5202                 </permacrud>
5203         </class>
5204         <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">
5205                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5206                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5207                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5208                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5209                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5210                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5211                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5212                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5213                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5214                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5215                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5216                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5217                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5218                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5219                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5220                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5221                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5222                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5223                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5224                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5225                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5226                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5227                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5228                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5229                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5230                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5231                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5232                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5233                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5234                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5235                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5236                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5237                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5238                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5239                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5240                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5241                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5242                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5243                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5244                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5245                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5246                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5247                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5248                 </fields>
5249                 <links>
5250                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5251                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5252                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5253                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5254                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5255                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5256                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5257                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5258                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5259                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5260                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5261                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5262                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5263                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5264                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5265                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5266                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5267                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5268                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5269                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5270                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5271                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5272                 </links>
5273                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5274                         <actions>
5275                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5276                         </actions>
5277                 </permacrud>
5278         </class>
5279
5280         <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">
5281                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5282                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5283                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5284                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5285                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5286                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5287                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5288                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5289                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5290                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5291                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5292                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5293                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5294                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5295                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5296                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5297                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5298                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5299                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5300                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5301                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5302                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5303                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5304                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5305                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5306                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5307                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5308                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5309                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5310                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5311                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5312                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5313                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5314                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5315                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5316                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5317                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5318                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5319                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5320                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5321                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5322                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5323                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5324                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5325                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5326                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5327                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5328                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5329                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5330                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5331                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5332                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5333                 </fields>
5334                 <links>
5335                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5336                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5337                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5338                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5339                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5340                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5341                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5342                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5343                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5344                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5345                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5346                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5347                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5348                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5349                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5350                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5351                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5352                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5353                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5354                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5355                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5356                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5357                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5358                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5359                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5360                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5361                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5362                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5363                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5364                 </links>
5365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5366                         <actions>
5367                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5368                         </actions>
5369                 </permacrud>
5370         </class>
5371         <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">
5372                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5373                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5374                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5375                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5376                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5377                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5378                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5379                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5380                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5381                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5382                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5383                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5384                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5385                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5386                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5387                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5388                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5389                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5390                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5391                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5392                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5393                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5394                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5395                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5396                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5397                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5398                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5399                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5400                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5401                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5402                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5403                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5404                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5405                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5406                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5407                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5408                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5409                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5410                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5411                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5412                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5413                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5414                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5415                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5416                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5417                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5418                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5419                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5420                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5421                 </fields>
5422                 <links>
5423                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5424                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5425                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5426                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5427                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5428                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5429                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5430                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5431                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5432                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5433                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5434                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5435                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5436                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5437                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5438                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5439                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5440                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5441                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5442                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5443                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5444                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5445                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5446                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5447                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5448                 </links>
5449         </class>
5450         <class id="auch" 
5451                 controller="open-ils.cstore" 
5452                 oils_obj:fieldmapper="action::user_circ_history" 
5453                 oils_persist:tablename="action.usr_circ_history" 
5454                 reporter:label="User Checkout History">
5455                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5456                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5457                         <!-- prevent reporting on the user that owns the checkout history -->
5458                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5459                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5460                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5461                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5462                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5463                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5464                 </fields>
5465                 <links>
5466                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5467                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5468                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5469                 </links>
5470         </class>
5471         <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">
5472                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5473                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5474                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5475                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5476                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5477                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5478                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5479                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5480                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5481                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5482                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5483                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5484                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5485                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5486                 </fields>
5487                 <links>
5488                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5489                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5490                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5491                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5492                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5493                 </links>
5494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5495                         <actions>
5496                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5497                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5498                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5499                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5500                         </actions>
5501                 </permacrud>
5502         </class>
5503
5504         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5505                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5506                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5507                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5508                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5509                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5510                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5511                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5512                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5513                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5514                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5515                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5516                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5517                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5518                 </fields>
5519                 <links>
5520                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5521                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5522                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5523                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5524                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5525                 </links>
5526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5527                         <actions>
5528                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5529                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5530                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5531                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5532                         </actions>
5533                 </permacrud>
5534         </class>
5535         
5536         <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">
5537                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5538                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5539                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5540                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5541                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5542                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5543                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5544                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5545                 </fields>
5546                 <links>
5547                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5548                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5549                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5550                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5551                 </links>
5552                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5553                         <actions>
5554                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5555                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5556                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5557                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5558                         </actions>
5559                 </permacrud>
5560         </class>
5561         
5562         <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">
5563                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5564                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5565                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5566                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5567                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5568                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5569                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5570                 </fields>
5571                 <links>
5572                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5573                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5574                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5575                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5576                 </links>
5577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5578                         <actions>
5579                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5580                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5581                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5582                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5583                         </actions>
5584                 </permacrud>
5585         </class>
5586         
5587         <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">
5588                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5589                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5590                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5591                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5592                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5593                 </fields>
5594                 <links>
5595                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5596                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5597                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5598                 </links>
5599                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5600                         <actions>
5601                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5602                     <context link="resource" field="owner" />
5603                 </create>
5604                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5605                     <context link="resource" field="owner" />
5606                 </retrieve>
5607                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5608                     <context link="resource" field="owner" />
5609                 </update>
5610                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5611                     <context link="resource" field="owner" />
5612                 </delete>
5613                         </actions>
5614                 </permacrud>
5615         </class>
5616         
5617         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5618                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5619                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5620                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5621                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5622                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5623                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5624                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5625                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5626                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5627                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5628                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5629                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5630                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5631                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5632                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5633                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5634                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5635                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5636                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5637                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5638                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5639                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5640                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5641                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5642                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5643                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5644                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5645                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5646                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5647                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5648                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5649                 </fields>
5650                 <links>
5651                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5652                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5653                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5654                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5655                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5656                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5657                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5658                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5659                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5660                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5661                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5662                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5663                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5664                 </links>
5665                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5666                         <actions>
5667                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5668                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5669                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5670                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5671                         </actions>
5672                 </permacrud>
5673         </class>
5674         
5675         <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">
5676                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5677                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5678                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5679                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5680                 </fields>
5681                 <links>
5682                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5683                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5684                 </links>
5685                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5686                         <actions>
5687                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5688                                         <context link="reservation" field="pickup_lib"/>
5689                                 </create>
5690                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5691                                         <context link="reservation" field="pickup_lib"/>
5692                                 </retrieve>
5693                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5694                                         <context link="reservation" field="pickup_lib"/>
5695                                 </update>
5696                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5697                                         <context link="reservation" field="pickup_lib"/>
5698                                 </delete>
5699                         </actions>
5700                 </permacrud>
5701         </class>
5702
5703         <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">
5704                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5705                         <field name="bucket" reporter:datatype="link"/>
5706                         <field name="id" reporter:datatype="id" />
5707                         <field name="target_call_number" reporter:datatype="link" />
5708                         <field name="create_time" reporter:datatype="timestamp" />
5709                         <field name="pos" reporter:datatype="int" />
5710                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5711                 </fields>
5712                 <links>
5713                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5714                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5715             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5716                 </links>
5717                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5718                         <actions>
5719                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5720                     <context link="bucket" field="owning_lib"/>
5721                 </retrieve>
5722             </actions>
5723         </permacrud>
5724         </class>
5725         <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">
5726                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5727                         <field name="id" reporter:datatype="id" />
5728                         <field name="item" reporter:datatype="link"/>
5729                         <field name="note" reporter:datatype="text" />
5730                 </fields>
5731                 <links>
5732                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5733                 </links>
5734         </class>
5735         <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">
5736                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5737                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5738                         <field name="btype" reporter:datatype="text"/>
5739                         <field name="id" reporter:datatype="id" />
5740                         <field name="name" reporter:datatype="text"/>
5741                         <field name="description" reporter:datatype="text"/>
5742                         <field name="owner" reporter:datatype="link"/>
5743                         <field name="pub" reporter:datatype="bool"/>
5744                         <field name="create_time" reporter:datatype="timestamp" />
5745                         <field name="owning_lib" reporter:datatype="org_unit" />
5746                 </fields>
5747                 <links>
5748                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5749                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5750                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5751                 </links>
5752                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5753                         <actions>
5754                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5755                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5756                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5757                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5758                         </actions>
5759                 </permacrud>
5760         </class>
5761         <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">
5762                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5763                         <field name="id" reporter:datatype="id" />
5764                         <field name="bucket" reporter:datatype="link"/>
5765                         <field name="note" reporter:datatype="text" />
5766                 </fields>
5767                 <links>
5768                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5769                 </links>
5770         </class>
5771         <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">
5772                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5773                         <field name="hold" reporter:datatype="link"/>
5774                         <field name="id" reporter:datatype="id" />
5775                         <field name="target_copy" reporter:datatype="link"/>
5776                         <field name="proximity" reporter:datatype="number"/>
5777                 </fields>
5778                 <links>
5779                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5780                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5781                 </links>
5782         </class>
5783         <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">
5784                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5785                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5786                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5787                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5788                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5789                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5790                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5791                 </fields>
5792                 <links>
5793                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5794                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5795                 </links>
5796         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5797             <actions>
5798                 <create permission="CREATE_HOLD_NOTIFICATION">
5799                                         <context link="hold" jump="usr" field="home_ou" />
5800                                 </create>
5801                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5802                                         <context link="hold" jump="usr" field="home_ou" />
5803                                 </retrieve>
5804                 <update permission="CREATE_HOLD_NOTIFICATION">
5805                                         <context link="hold" jump="usr" field="home_ou" />
5806                                 </update>
5807                 <delete permission="CREATE_HOLD_NOTIFICATION">
5808                                         <context link="hold" jump="usr" field="home_ou" />
5809                                 </delete>
5810             </actions>
5811         </permacrud>
5812         </class>
5813         <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">
5814                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5815                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5816                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5817                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5818                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5819                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5820                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5821                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5822                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5823                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5824                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5825                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5826                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5827                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5828                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5829                 </fields>
5830                 <links>
5831                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5832                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5833                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5834                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5835                 </links>
5836         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5837             <actions>
5838                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5839                 <retrieve/>
5840                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5841                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5842             </actions>
5843         </permacrud>
5844         </class>
5845         <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">
5846                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5847                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5848                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5849                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5850                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5851             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5852             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5853             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5854                 </fields>
5855                 <links>
5856                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5857                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5858                 </links>
5859         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5860             <actions>
5861                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5862                 <retrieve/>
5863                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5864                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5865             </actions>
5866         </permacrud>
5867         </class>
5868         <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">
5869                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5870                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5871             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5872             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5873                 </fields>
5874                 <links>
5875                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5876                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5877                 </links>
5878         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5879             <actions>
5880                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5881                                         <context link="lgroup" field="owner" />
5882                 </create>
5883                 <retrieve/>
5884                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5885                                         <context link="lgroup" field="owner" />
5886                 </update>
5887                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5888                                         <context link="lgroup" field="owner" />
5889                 </delete>
5890             </actions>
5891         </permacrud>
5892         </class>
5893
5894     <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">
5895         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5896             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5897             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5898             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5899             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5900         </fields>
5901         <links>
5902             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5903             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5904         </links>
5905         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5906             <actions>
5907                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5908                 <retrieve/>
5909                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5910                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5911             </actions>
5912         </permacrud>
5913     </class>
5914
5915         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5916                 <fields>
5917                         <field name="sre_id" oils_persist:virtual="true" />
5918                         <field name="location" oils_persist:virtual="true" />
5919                         <field name="owning_lib" oils_persist:virtual="true" />
5920                         <field name="basic_holdings" oils_persist:virtual="true" />
5921                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5922                         <field name="supplement_holdings" oils_persist:virtual="true" />
5923                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5924                         <field name="index_holdings" oils_persist:virtual="true" />
5925                         <field name="index_holdings_add" oils_persist:virtual="true" />
5926                         <field name="online" oils_persist:virtual="true" />
5927                         <field name="missing" oils_persist:virtual="true" />
5928                         <field name="incomplete" oils_persist:virtual="true" />
5929                 </fields>
5930         </class>
5931
5932         <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">
5933                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5934                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5935                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5936                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5937                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5938                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5939                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5940                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5941                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5942                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5943                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5944                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5945                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5946                 </fields>
5947                 <links>
5948                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5949                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5950                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5951                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5952                 </links>
5953                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5954                         <actions>
5955                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5956                                 <retrieve/>
5957                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5958                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5959                         </actions>
5960                 </permacrud>
5961         </class>
5962
5963         <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">
5964                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5965                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5966                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5967                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5968                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5969                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5970                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5971                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5972                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5973                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5974                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5975                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5976                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5977                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5978                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5979                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5980                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5981                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5982                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5983                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5984                 </fields>
5985                 <links>
5986                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5987                 </links>
5988                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5989                         <actions>
5990                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5991                                         <context link="subscription" field="owning_lib" />
5992                                 </create>
5993                                 <retrieve />
5994                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5995                                         <context link="subscription" field="owning_lib" />
5996                                 </update>
5997                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5998                                         <context link="subscription" field="owning_lib" />
5999                                 </delete>
6000                         </actions>
6001                 </permacrud>
6002         </class>
6003
6004         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
6005                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
6006                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6007                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
6008                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
6009                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
6010                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6011                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6012                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6013                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6014                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6015                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6016                 </fields>
6017                 <links>
6018                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6019                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6020                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6021                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6022                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6023                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6024                 </links>
6025                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6026                         <actions>
6027                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6028                                 <retrieve />
6029                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6030                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6031                         </actions>
6032                 </permacrud>
6033         </class>
6034
6035         <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">
6036                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6037                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6038                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6039                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6040                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6041                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6042                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6043                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6044                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6045                 </fields>
6046                 <links>
6047                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6048                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6049                 </links>
6050                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6051                         <actions>
6052                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6053                     <context link="subscription" field="owning_lib"/>
6054                 </create>
6055                                 <retrieve />
6056                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6057                     <context link="subscription" field="owning_lib"/>
6058                 </update>
6059                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6060                     <context link="subscription" field="owning_lib"/>
6061                 </delete>
6062                         </actions>
6063                 </permacrud>
6064         </class>
6065
6066         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6067                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6068                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6069                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6070                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6071                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6072                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6073                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6074                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6075                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6076                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6077                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6078                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6079                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6080                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6081                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6082                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6083                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6084                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6085                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6086                 </fields>
6087                 <links>
6088                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6089                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6090                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6091                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6092                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6093                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6094                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6095                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6096                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6097                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6098                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6099                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6100                 </links>
6101                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6102                         <actions>
6103                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6104                                 <retrieve />
6105                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6106                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6107                         </actions>
6108                 </permacrud>
6109         </class>
6110
6111         <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">
6112                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6113                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6114                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6115                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6116                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6117                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6118                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6119                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6120                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6121                 </fields>
6122                 <links>
6123                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6124                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6125                 </links>
6126                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6127                         <actions>
6128                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6129                                         <context link="distribution" field="holding_lib" />
6130                                 </create>
6131                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6132                                         <context link="distribution" field="holding_lib" />
6133                                 </retrieve>
6134                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6135                                         <context link="distribution" field="holding_lib" />
6136                                 </update>
6137                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6138                                         <context link="distribution" field="holding_lib" />
6139                                 </delete>
6140                         </actions>
6141                 </permacrud>
6142         </class>
6143
6144         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6145                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6146                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6147                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6148                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6149                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6150                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6151                 </fields>
6152                 <links>
6153                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6154                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6155                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6156                 </links>
6157                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6158                         <actions>
6159                                 <create permission="ADMIN_SERIAL_STREAM">
6160                                         <context link="distribution" field="holding_lib" />
6161                                 </create>
6162                                 <retrieve />
6163                                 <update permission="ADMIN_SERIAL_STREAM">
6164                                         <context link="distribution" field="holding_lib" />
6165                                 </update>
6166                                 <delete permission="ADMIN_SERIAL_STREAM">
6167                                         <context link="distribution" field="holding_lib" />
6168                                 </delete>
6169                         </actions>
6170                 </permacrud>
6171         </class>
6172
6173         <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">
6174                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6175                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6176                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6177                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6178                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6179                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6180                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6181                 </fields>
6182                 <links>
6183                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6184                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6185                 </links>
6186                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6187                         <actions>
6188                                 <create permission="ADMIN_SERIAL_STREAM">
6189                                         <context link="stream" jump="distribution" field="holding_lib" />
6190                                 </create>
6191                                 <retrieve permission="RECEIVE_SERIAL">
6192                                         <context link="stream" jump="distribution" field="holding_lib" />
6193                                 </retrieve>
6194                                 <update permission="ADMIN_SERIAL_STREAM">
6195                                         <context link="stream" jump="distribution" field="holding_lib" />
6196                                 </update>
6197                                 <delete permission="ADMIN_SERIAL_STREAM">
6198                                         <context link="stream" jump="distribution" field="holding_lib" />
6199                                 </delete>
6200                         </actions>
6201                 </permacrud>
6202         </class>
6203
6204         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6205                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6206                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6207                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6208                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6209                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6210                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6211                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6212                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6213                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6214                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6215                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6216                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6217                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6218                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6219                 </fields>
6220                 <links>
6221                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6222                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6223                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6224                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6225                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6226                 </links>
6227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6228                         <actions>
6229                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6230                                         <context link="subscription" field="owning_lib" />
6231                                 </create>
6232                                 <retrieve/>
6233                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6234                                         <context link="subscription" field="owning_lib" />
6235                                 </update>
6236                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6237                                         <context link="subscription" field="owning_lib" />
6238                                 </delete>
6239                         </actions>
6240                 </permacrud>
6241         </class>
6242
6243         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6244                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6245                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6246                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6247                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6248                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6249                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6250                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6251                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6252                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6253                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6254                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6255                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6256                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6257                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6258                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6259                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6260                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6261                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6262                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6263                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6264                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6265                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6266                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6267                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6268                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6269                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6270                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6271                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6272                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6273                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6274                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6275                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6276                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6277                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6278                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6279                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6280                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6281                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6282                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6283                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6284                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6285                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6286                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6287                 </fields>
6288                 <links>
6289                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6290                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6291                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6292                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6293                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6294                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6295                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6296                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6297                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6298                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6299                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6300                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6301                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6302                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6303                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6304                 </links>
6305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6306                         <actions>
6307                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6308                                 <retrieve/>
6309                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6310                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6311                         </actions>
6312                 </permacrud>
6313         </class>
6314
6315         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6316                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6317                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6318                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6319                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6320                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6321                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6322                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6323                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6324                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6325                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6326                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6327                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6328                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6329                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6330                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6331                 </fields>
6332                 <links>
6333                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6334                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6335                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6336                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6337                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6338                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6339                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6340                 </links>
6341                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6342                         <actions>
6343                                 <create permission="ADMIN_SERIAL_ITEM">
6344                                         <context link="stream" jump="distribution" field="holding_lib" />
6345                                 </create>
6346                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6347                                         <context link="stream" jump="distribution" field="holding_lib" />
6348                                 </retrieve>
6349                                 <update permission="ADMIN_SERIAL_ITEM">
6350                                         <context link="stream" jump="distribution" field="holding_lib" />
6351                                 </update>
6352                                 <delete permission="ADMIN_SERIAL_ITEM">
6353                                         <context link="stream" jump="distribution" field="holding_lib" />
6354                                 </delete>
6355                         </actions>
6356                 </permacrud>
6357         </class>
6358
6359         <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">
6360                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6361                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6362                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6363                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6364                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6365                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6366                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6367                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6368                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6369                 </fields>
6370                 <links>
6371                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6372                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6373                 </links>
6374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6375                         <actions>
6376                                 <create permission="ADMIN_SERIAL_ITEM">
6377                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6378                                 </create>
6379                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6380                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6381                                 </retrieve>
6382                                 <update permission="ADMIN_SERIAL_ITEM">
6383                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6384                                 </update>
6385                                 <delete permission="ADMIN_SERIAL_ITEM">
6386                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6387                                 </delete>
6388                         </actions>
6389                 </permacrud>
6390         </class>
6391         <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">
6392                 <fields>
6393                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6394                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6395                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6396                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6397                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6398                 </fields>
6399                 <links>
6400                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6401                 </links>
6402         </class>
6403         <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">
6404                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6405                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6406                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6407                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6408                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6409                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6410                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6411                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6412                 </fields>
6413                 <links>
6414                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6415                 </links>
6416         </class>
6417         <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">
6418                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6419                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6420                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6421                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6422                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6423                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6424                 </fields>
6425                 <links>
6426                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6427                 </links>
6428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6429                         <actions>
6430                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6431                                         <context link="distribution" field="holding_lib" />
6432                                 </create>
6433                                 <retrieve/>
6434                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6435                                         <context link="distribution" field="holding_lib" />
6436                                 </update>
6437                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6438                                         <context link="distribution" field="holding_lib" />
6439                                 </delete>
6440                         </actions>
6441                 </permacrud>
6442         </class>
6443
6444         <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">
6445                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6446                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6447                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6448                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6449                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6450                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6451                 </fields>
6452                 <links>
6453                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6454                 </links>
6455                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6456                         <actions>
6457                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6458                                         <context link="distribution" field="holding_lib" />
6459                                 </create>
6460                                 <retrieve/>
6461                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6462                                         <context link="distribution" field="holding_lib" />
6463                                 </update>
6464                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6465                                         <context link="distribution" field="holding_lib" />
6466                                 </delete>
6467                         </actions>
6468                 </permacrud>
6469         </class>
6470
6471         <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">
6472                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6473                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6474                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6475                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6476                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6477                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6478                 </fields>
6479                 <links>
6480                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6481                 </links>
6482                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6483                         <actions>
6484                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6485                                         <context link="distribution" field="holding_lib" />
6486                                 </create>
6487                                 <retrieve/>
6488                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6489                                         <context link="distribution" field="holding_lib" />
6490                                 </update>
6491                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6492                                         <context link="distribution" field="holding_lib" />
6493                                 </delete>
6494                         </actions>
6495                 </permacrud>
6496         </class>
6497
6498         <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">
6499                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6500                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6501                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6502                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6503                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6504                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6505                 </fields>
6506                 <links>
6507                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6508                 </links>
6509                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6510                         <actions>
6511                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6512                                 <retrieve/>
6513                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6514                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6515                         </actions>
6516                 </permacrud>
6517         </class>
6518
6519         <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">
6520                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6521                         <field name="id" reporter:datatype="id" />
6522                         <field name="owning_copy" reporter:datatype="link"/>
6523                         <field name="stat_cat" reporter:datatype="link"/>
6524                         <field name="stat_cat_entry" reporter:datatype="link"/>
6525                 </fields>
6526                 <links>
6527                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6528                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6529                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6530                 </links>
6531                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6532                         <actions>
6533                                 <retrieve/>
6534                         </actions>
6535                 </permacrud>
6536         </class>
6537         <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">
6538                 <fields oils_persist:primary="code">
6539                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6540                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6541                 </fields>
6542                 <links/>
6543         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6544             <actions>
6545                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6546                 <retrieve/>
6547                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6548                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6549             </actions>
6550         </permacrud>
6551         </class>
6552         <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">
6553                 <fields oils_persist:primary="code">
6554                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6555                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6556                 </fields>
6557                 <links/>
6558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6559             <actions>
6560                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6561                 <retrieve/>
6562                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6563                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6564             </actions>
6565         </permacrud>
6566         </class>
6567         <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">
6568                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6569                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6570                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6571                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6572                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6573                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6574                 </fields>
6575                 <links>
6576             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6577         </links>
6578         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6579             <actions>
6580                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6581                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6582                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6583                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6584             </actions>
6585         </permacrud>
6586         </class>
6587         <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">
6588                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6589                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6590                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6591                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6592                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6593                 </fields>
6594                 <links>
6595                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6596         </links>
6597         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6598             <actions>
6599                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6600                 <retrieve/>
6601                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6602                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6603             </actions>
6604         </permacrud>
6605         </class>
6606         <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">
6607                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6608                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6609                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6610                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6611                 </fields>
6612                 <links>
6613                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6614                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6615                 </links>
6616         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6617             <actions>
6618                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6619                 <retrieve/>
6620                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6621                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6622             </actions>
6623         </permacrud>
6624         </class>
6625         <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">
6626                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6627                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6628                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6629                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6630                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6631                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6632                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6633                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6634                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6635                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6636                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6637                 </fields>
6638                 <links>
6639                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6640                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6641                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6642                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6643                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6644                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6645                 </links>
6646         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6647             <actions>
6648                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6649                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6650                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6651                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6652             </actions>
6653         </permacrud>
6654         </class>
6655         <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">
6656                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6657                         <field name="id" reporter:datatype="id" />
6658                         <field name="from_org" reporter:datatype="org_unit"/>
6659                         <field name="to_org" reporter:datatype="org_unit"/>
6660                         <field name="prox" reporter:datatype="int" />
6661                 </fields>
6662                 <links>
6663                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6664                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6665                 </links>
6666         </class>
6667         <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">
6668                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6669                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6670                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6671                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6672                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6673                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6674                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6675                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6676                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6677                 </fields>
6678                 <links/>
6679         </class>
6680         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6681                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6682                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6683                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6684                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6685                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6686                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6687                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6688                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6689                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6690                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6691                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6692                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6693                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6694                 </fields>
6695                 <links>
6696                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6697                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6698                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6699                 </links>
6700         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6701             <actions>
6702                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6703                 <retrieve/>
6704                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6705                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6706             </actions>
6707         </permacrud>
6708         </class>
6709         <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">
6710                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6711                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6712                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6713                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6714                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6715                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6716                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6717                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6718                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6719                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6720                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6721                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6722                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6723                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6724                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6725                 </fields>
6726                 <links>
6727                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6728                 </links>
6729         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6730             <actions>
6731                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6732                 <retrieve/>
6733                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6734                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6735             </actions>
6736         </permacrud>
6737         </class>
6738         <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">
6739                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6740                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6741                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6742                         <field name="query_text" reporter:datatype="text"/>
6743                 </fields>
6744         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6745             <actions>
6746                 <retrieve/>
6747             </actions>
6748         </permacrud>
6749         </class>
6750
6751         <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">
6752                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6753                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6754                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6755                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6756                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6757                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6758                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6759                 </fields>
6760                 <links>
6761                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6762                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6763                 </links>
6764         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6765             <actions>
6766                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6767                 <retrieve/>
6768                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6769                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6770             </actions>
6771         </permacrud>
6772         </class>
6773         <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">
6774                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6775                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6776                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6777                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6778                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6779                 </fields>
6780                 <links>
6781                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6782                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6783                 </links>
6784         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6785             <actions>
6786                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6787                     <context link="grp" field="owner"/>
6788                 </create>
6789                 <retrieve/>
6790                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6791                     <context link="grp" field="owner"/>
6792                 </update>
6793                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6794                     <context link="grp" field="owner"/>
6795                 </delete>
6796             </actions>
6797         </permacrud>
6798         </class>
6799
6800         <!-- A note: Please update alhr and ahopl when updating ahr -->
6801         <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">
6802                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6803                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6804                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6805                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6806                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6807                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6808                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6809                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6810                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6811                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6812                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6813                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6814                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6815                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6816                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6817                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6818                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6819                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6820                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6821                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6822                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6823                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6824                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6825                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6826                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6827                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6828                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6829                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6830                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6831                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6832                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6833                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6834                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6835                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6836                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6837                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6838                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6839                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6840                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6841                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6842                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6843                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6844                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6845                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6846                 </fields>
6847                 <links>
6848                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6849                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6850                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6851                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6852                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6853                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6854                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6855                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6856                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6857                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6858                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6859                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6860                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6861                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6862                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6863                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6864                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6865                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6866                 </links>
6867                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6868                         <actions>
6869                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6870                         </actions>
6871                 </permacrud>
6872         </class>
6873         <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">
6874                 <oils_persist:source_definition><![CDATA[
6875                 SELECT
6876                         ahr.*,
6877                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6878                                 copy_location_order_position,
6879                         CASE WHEN au.alias IS NOT NULL THEN
6880                                 au.alias
6881                         ELSE
6882                                 au.first_given_name
6883                         END AS usr_alias_or_first_given_name,
6884                         au.first_given_name AS usr_first_given_name,
6885                         au.second_given_name AS usr_second_given_name,
6886                         au.family_name AS usr_family_name,
6887                         au.prefix AS usr_prefix,
6888                         au.suffix AS usr_suffix,
6889                         au.alias AS usr_alias,
6890                         CASE WHEN au.alias IS NOT NULL THEN
6891                                 au.alias
6892                         ELSE
6893                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6894                                         COALESCE(au.family_name, ''),
6895                                         COALESCE(au.suffix, ''),
6896                                         ', ',
6897                                         COALESCE(au.prefix, ''),
6898                                         COALESCE(au.first_given_name, ''),
6899                                         COALESCE(au.second_given_name, '')
6900                                 ], ' '), E'\\s+,', ',')
6901                         END AS usr_alias_or_display_name,
6902                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6903                                 COALESCE(au.family_name, ''),
6904                                 COALESCE(au.suffix, ''),
6905                                 ', ',
6906                                 COALESCE(au.prefix, ''),
6907                                 COALESCE(au.first_given_name, ''),
6908                                 COALESCE(au.second_given_name, '')
6909                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6910                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6911                                 AS call_number_label,
6912                         siss.label AS issuance_label,
6913                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6914                         ahcm_1.copy_count AS potential_copies
6915                 FROM action.hold_request ahr
6916                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6917                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6918                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6919                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6920                 JOIN actor.usr au ON (au.id = ahr.usr)
6921                 JOIN (
6922                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6923                         FROM asset.copy_location
6924                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6925                 LEFT JOIN actor.usr_standing_penalty ausp 
6926                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6927                 LEFT JOIN config.standing_penalty csp
6928                         ON (
6929                                 csp.id = ausp.standing_penalty AND 
6930                                 csp.block_list LIKE '%CAPTURE%' AND (
6931                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6932                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6933                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6934                                         )
6935                                 )
6936                         )
6937                 JOIN (
6938                         SELECT COUNT(target_copy) AS copy_count, hold
6939                         FROM action.hold_copy_map
6940                         GROUP BY 2
6941                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6942                 LEFT JOIN serial.issuance siss
6943                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6944                 LEFT JOIN asset.copy_location_order acplo
6945                         ON (acp.location = acplo.location AND
6946                                 acp.circ_lib = acplo.org)
6947                 WHERE
6948                         ahr.capture_time IS NULL AND
6949                         ahr.cancel_time IS NULL AND
6950                         csp.id IS NULL AND
6951                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6952                         acp.status IN (0,7)
6953                 ]]></oils_persist:source_definition>
6954                 <fields oils_persist:primary="id">
6955                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6956                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6957                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6958                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6959                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6960                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6961                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6962                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6963                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6964                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6965                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6966                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6967                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6968                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6969                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6970                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6971                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6972                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6973                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6974                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6975                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6976                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6977                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6978                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6979                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6980                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6981                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6982                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6983                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6984                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6985                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6986                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6987                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6988                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6989                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6990                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6991                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6992                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6993                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6994                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6995                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6996                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6997                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6998                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6999                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
7000                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
7001                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
7002                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
7003                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
7004                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
7005                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
7006                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
7007                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
7008                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7009                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7010                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7011                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7012                 </fields>
7013                 <links>
7014                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7015                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7016                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7017                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7018                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7019                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7020                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7021                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7022                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7023                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7024                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7025                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7026                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7027                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7028                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7029                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7030                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7031                 </links>
7032                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7033                         <actions>
7034                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7035                         </actions>
7036                 </permacrud>
7037         </class>
7038         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7039                 <oils_persist:source_definition><![CDATA[
7040                         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)
7041                 ]]></oils_persist:source_definition>
7042                 <fields oils_persist:primary="id">
7043                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7044                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7045                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7046                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7047                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7048                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7049                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7050                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7051                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7052                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7053                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7054                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7055                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7056                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7057                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7058                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7059                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7060                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7061                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7062                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7063                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7064                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7065                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7066                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7067                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7068                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7069                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7070                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7071                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7072                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7073                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7074                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7075                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7076                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7077                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7078                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7079                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7080                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7081                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7082                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7083                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7084                 </fields>
7085                 <links>
7086                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7087                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7088                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7089                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7090                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7091                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7092                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7093                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7094                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7095                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7096                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7097                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7098                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7099                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7100                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7101                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7102                 </links>
7103         </class>
7104
7105         <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">
7106                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7107                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7108                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7109                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7110                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7111                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7112                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7113                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7114                 </fields>
7115                 <links>
7116                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7117                 </links>
7118                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7119                         <actions>
7120                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7121                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7122                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7123                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7124                         </actions>
7125                 </permacrud>
7126         </class>
7127         <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">
7128                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7129                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7130                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7131                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7132                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7133                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7134                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7135                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7136                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7137                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7138                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7139                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7140                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7141                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7142                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7143                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7144                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7145                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7147                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7148                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7149                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7150                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7151                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7152                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7153                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7154                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7155                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7156                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7157                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7158                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7159                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7160                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7161                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7162                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7163                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7164                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7165                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7166                 </fields>
7167                 <links>
7168                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7169                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7170                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7171                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7172                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7173                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7174                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7175                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7176                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7177                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7178                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7179                 </links>
7180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7181                         <actions>
7182                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7183                         </actions>
7184                 </permacrud>
7185         </class>
7186         <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">
7187                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7188                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7189                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7190                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7191                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7192                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7193                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7194                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7195                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7196                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7197                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7198                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7199                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7200                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7201                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7202                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7203                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7204                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7205                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7206                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7207                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7208                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7209                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7210                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7211                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7212                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7213                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7214                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7215                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7216                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7217                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7218                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7219                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7220                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7221                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7222                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7223                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7224                 </fields>
7225                 <links>
7226                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7227                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7228                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7229                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7230                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7231                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7232                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7233                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7234                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7235                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7236                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7237                 </links>
7238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7239                         <actions>
7240                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7241                         </actions>
7242                 </permacrud>
7243         </class>
7244
7245         <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">
7246                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7247                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7248                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7249                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7250                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7251                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7252                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7253                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7254                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7255                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7256                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7257                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7258                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7259                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7260                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7261                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7262                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7263                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7264                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7265                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7266                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7267                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7268                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7269                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7270                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7271                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7272                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7273                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7274                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7275                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7276                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7277                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7278                 </fields>
7279                 <links>
7280                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7281                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7282                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7283                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7284                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7285                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7286                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7287                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7288                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7289                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7290                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7291                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7292                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7293                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7294                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7295                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7296                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7297                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7298                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7299                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7300                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7301                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7302                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7303                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7304                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7305                 </links>
7306         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7307             <actions>
7308                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7309                 <retrieve />
7310                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7311                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7312             </actions>
7313         </permacrud>
7314         </class>
7315         <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">
7316                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7317                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7318                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7319                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7320                 </fields>
7321                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7322                         <actions>
7323                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7324                                 <retrieve/>
7325                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7326                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7327                         </actions>
7328                 </permacrud>
7329         </class>
7330         <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">
7331                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7332                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7333                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7334                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7335                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7336                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7337                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7338                 </fields>
7339                 <links>
7340                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7341                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7342                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7343                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7344                 </links>
7345                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7346                         <actions>
7347                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7348                                 <retrieve/>
7349                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7350                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7351                         </actions>
7352                 </permacrud>
7353         </class>
7354         <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">
7355                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7356                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7357                         <field name="btype" reporter:datatype="text"/>
7358                         <field name="id" reporter:datatype="id" />
7359                         <field name="name"  reporter:datatype="text"/>
7360                         <field name="description" reporter:datatype="text"/>
7361                         <field name="owner" reporter:datatype="link"/>
7362                         <field name="pub" reporter:datatype="bool"/>
7363                         <field name="create_time" reporter:datatype="timestamp" />
7364                         <field name="owning_lib" reporter:datatype="org_unit" />
7365                 </fields>
7366                 <links>
7367                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7368                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7369                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7370                 </links>
7371                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7372                         <actions>
7373                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7374                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7375                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7376                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7377                         </actions>
7378                 </permacrud>
7379         </class>
7380         <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">
7381                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7382                         <field name="id" reporter:datatype="id" />
7383                         <field name="bucket" reporter:datatype="link"/>
7384                         <field name="note" reporter:datatype="text" />
7385                 </fields>
7386                 <links>
7387                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7388                 </links>
7389         </class>
7390         <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">
7391                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7392                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7393                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7394                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7395                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7396                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7397                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7398                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7399                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7400                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7401                 </fields>
7402                 <links>
7403                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7404                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7405                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7406                 </links>
7407                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7408                         <actions>
7409                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7410                         </actions>
7411                 </permacrud>
7412         </class>
7413         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7414                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7415                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7416                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7417                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7418                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7419                 </fields>
7420                 <links>
7421                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7422                 </links>
7423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7424                         <actions>
7425                                 <retrieve permission="VIEW_USER user_request.view">
7426                                         <context link="usr" field="home_ou" />
7427                                 </retrieve>
7428                         </actions>
7429                 </permacrud>
7430         </class>
7431     <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">
7432         <fields oils_persist:primary="field">
7433             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7434             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7435             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7436         </fields>
7437         <links/>
7438         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7439             <actions>
7440                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7441                 <retrieve />
7442                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7443                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7444             </actions>
7445         </permacrud>
7446     </class>
7447         <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">
7448                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7449                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7450                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7451                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7452                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7453                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7454                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7455                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7456                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7457                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7458                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7459                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7460                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7461                 </fields>
7462                 <links>
7463                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7464                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7465                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7466                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7467                 </links>
7468         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7469             <actions>
7470                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7471                 <retrieve />
7472                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7473                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7474             </actions>
7475         </permacrud>
7476         </class>
7477         <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">
7478                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7479                         <field name="field" reporter:datatype="link"/>
7480                         <field name="id" reporter:datatype="id" />
7481                         <field name="source" reporter:datatype="link"/>
7482                         <field name="value"  reporter:datatype="text"/>
7483                 </fields>
7484                 <links>
7485                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7486                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7487                 </links>
7488         </class>
7489         <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">
7490                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7491                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7492                         <field name="btype" reporter:datatype="text"/>
7493                         <field name="id" reporter:datatype="id" />
7494                         <field name="name"  reporter:datatype="text"/>
7495                         <field name="description" reporter:datatype="text"/>
7496                         <field name="owner" reporter:datatype="link"/>
7497                         <field name="pub" reporter:datatype="bool"/>
7498                         <field name="create_time" reporter:datatype="timestamp" />
7499                         <field name="owning_lib" reporter:datatype="org_unit" />
7500                 </fields>
7501                 <links>
7502                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7503                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7504                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7505                 </links>
7506                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7507                         <actions>
7508                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7509                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7510                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7511                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7512                         </actions>
7513                 </permacrud>
7514         </class>
7515         <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">
7516                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7517                         <field name="id" reporter:datatype="id" />
7518                         <field name="bucket" reporter:datatype="link"/>
7519                         <field name="note" reporter:datatype="text" />
7520                 </fields>
7521                 <links>
7522                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7523                 </links>
7524         </class>
7525         <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">
7526                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7527                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7528                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7529                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7530                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7531                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7532                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7533                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7534                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7535                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7536                 </fields>
7537                 <links>
7538                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7539                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7540                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7541                 </links>
7542         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7543             <actions>
7544                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7545                     <context link="xact" jump="usr" field="home_ou"/>
7546                 </retrieve>
7547                         </actions>
7548                 </permacrud>
7549         </class>
7550         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7551                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7552                         <field name="id" reporter:datatype="id" />
7553                         <field name="ind1" />
7554                         <field name="ind2" />
7555                         <field name="record" />
7556                         <field name="subfield" />
7557                         <field name="tag" />
7558                         <field name="value" />
7559                 </fields>
7560                 <links>
7561                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7562                 </links>
7563         </class>
7564         <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">
7565                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7566                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7567                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7568                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7569                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7570                 </fields>
7571                 <links>
7572                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7573                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7574                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7575                 </links>
7576         </class>
7577         <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">
7578                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7579                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7580                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7581                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7582                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7583                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7584                 </fields>
7585                 <links>
7586                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7587                 </links>
7588         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7589             <actions>
7590                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7591                 <retrieve/>
7592                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7593                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7594             </actions>
7595         </permacrud>
7596
7597         </class>
7598         <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">
7599                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7600                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7601                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7602                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7603                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7604                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7605                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7606                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7607                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7608                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7609                 </fields>
7610                 <links>
7611                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7612                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7613                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7614                 </links>
7615         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7616             <actions>
7617                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7618                 <retrieve/>
7619                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7620                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7621             </actions>
7622         </permacrud>
7623         </class>
7624         <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">
7625                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7626                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7627                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7628                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7629                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7630                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7631                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7632                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7633                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7634                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7635                 </fields>
7636                 <links>
7637                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7638                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7639                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7640                 </links>
7641                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7642                 <actions>
7643                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7644                     <retrieve/>
7645                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7646                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7647                 </actions>
7648              </permacrud>
7649         </class>
7650         <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">
7651                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7652                         <field name="balance_owed" reporter:datatype="money" />
7653                         <field name="total_owed" reporter:datatype="money" />
7654                         <field name="total_paid" reporter:datatype="money" />
7655                         <field name="usr" reporter:datatype="link"/>
7656                 </fields>
7657                 <links>
7658                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7659                 </links>
7660         </class>
7661     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7662                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7663                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7664                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7665                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7666                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7667                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7668                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7669                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7670                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7671                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7672                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7673                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7674                 </fields>
7675                 <links>
7676                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7677                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7678                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7679                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7680                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7681                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7682                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7683                 </links>
7684         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7685             <actions>
7686                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7687             </actions>
7688         </permacrud>
7689         </class>
7690         <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">
7691                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7692                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7693                         <field name="quality" reporter:datatype="int" />
7694                         <field name="source" reporter:datatype="text"/>
7695                         <field name="transcendant" reporter:datatype="bool"/>
7696                         <field name="can_have_copies" reporter:datatype="bool"/>
7697                 </fields>
7698                 <links/>
7699         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7700             <actions>
7701                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7702                 <retrieve/>
7703                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7704                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7705             </actions>
7706         </permacrud>
7707         </class>
7708         <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">
7709                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7710                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7711                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7712                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7713                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7714                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7715                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7716                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7717                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7718                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7719                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7720                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7721                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7722                 </fields>
7723                 <links>
7724                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7725                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7726                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7727                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7728                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7729                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7730                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7731                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7732                 </links>
7733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7734                         <actions>
7735                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7736                                         <context link="usr" field="home_ou" />
7737                                 </retrieve>
7738                         </actions>
7739                 </permacrud>
7740         </class>
7741         <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">
7742                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7743                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7744                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7745                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7746                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7747                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7748                 </fields>
7749                 <links>
7750                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7751                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7752                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7753                 </links>
7754         </class>
7755         <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">
7756                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7757                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7758                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7759                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7760                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7761                 </fields>
7762                 <links>
7763                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7764                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7765                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7766                 </links>
7767         </class>
7768         <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">
7769                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7770                         <field name="bucket" reporter:datatype="link"/>
7771                         <field name="id" reporter:datatype="id" />
7772                         <field name="target_user" reporter:datatype="link"/>
7773                         <field name="create_time" reporter:datatype="timestamp" />
7774                         <field name="pos" reporter:datatype="int" />
7775                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7776                 </fields>
7777                 <links>
7778                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7779                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7780             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7781                 </links>
7782                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7783                         <actions>
7784                                 <retrieve permission="ADMIN_USER_BUCKET">
7785                     <context link="bucket" field="owning_lib"/>
7786                 </retrieve>
7787             </actions>
7788         </permacrud>
7789         </class>
7790         <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">
7791                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7792                         <field name="id" reporter:datatype="id" />
7793                         <field name="staff" reporter:datatype="link"/>
7794                         <field name="bucket" reporter:datatype="link"/>
7795                         <field name="target" reporter:datatype="int" />
7796                         <field name="hold_type" reporter:datatype="text" />
7797                         <field name="run_date" reporter:datatype="timestamp" />
7798                         <field name="cancelled" reporter:datatype="timestamp" />
7799                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7800                 </fields>
7801                 <links>
7802                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7803                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7804                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7805                 </links>
7806                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7807                         <actions>
7808                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7809                 <retrieve/>
7810                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7811                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7812             </actions>
7813         </permacrud>
7814         </class>
7815         <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">
7816                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7817                         <field name="id" reporter:datatype="id" />
7818                         <field name="batch_hold_event" reporter:datatype="link"/>
7819                         <field name="hold" reporter:datatype="link"/>
7820                 </fields>
7821                 <links>
7822                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7823                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7824                 </links>
7825                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7826                         <actions>
7827                 <retrieve/>
7828             </actions>
7829         </permacrud>
7830         </class>
7831         <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">
7832                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7833                         <field name="id" reporter:datatype="id" />
7834                         <field name="item" reporter:datatype="link"/>
7835                         <field name="note" reporter:datatype="text" />
7836                 </fields>
7837                 <links>
7838                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7839                 </links>
7840         </class>
7841         <class id="mus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7842                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7843                         <field name="balance_owed" reporter:datatype="money" />
7844                         <field name="total_owed" reporter:datatype="money" />
7845                         <field name="total_paid" reporter:datatype="money" />
7846                         <field name="usr" reporter:datatype="link"/>
7847                 </fields>
7848                 <links>
7849                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7850                 </links>
7851                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7852                         <actions>
7853                                 <retrieve permission="VIEW_USER">
7854                                         <context link="usr" field="home_ou"/>
7855                                 </retrieve>
7856                         </actions>
7857                 </permacrud>
7858         </class>
7859         <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">
7860                 <fields oils_persist:primary="code" oils_persist:sequence="">
7861                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7862                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7863                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7864                 </fields>
7865                 <links/>
7866         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7867             <actions>
7868                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7869                 <retrieve/>
7870                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7871                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7872             </actions>
7873         </permacrud>
7874         </class>
7875         <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">
7876                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7877                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7878                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7879                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7880                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7881                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7882                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7883                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7884                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7885                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7886                 </fields>
7887                 <links>
7888                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7889                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7890                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7891                 </links>
7892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7893             <actions>
7894                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7895                     <context link="xact" jump="usr" field="home_ou"/>
7896                 </retrieve>
7897                         </actions>
7898                 </permacrud>
7899         </class>
7900         <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">
7901                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7902                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7903                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7904                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7905                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7906                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7907                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7908                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7909                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7910                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7911                 </fields>
7912                 <links>
7913                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7914                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7915                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7916                 </links>
7917         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7918             <actions>
7919                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7920                     <context link="xact" jump="usr" field="home_ou"/>
7921                 </retrieve>
7922                         </actions>
7923                 </permacrud>
7924         </class>
7925         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7926                 <fields oils_persist:primary="id" oils_persist:sequence="">
7927                         <field name="checkin_lib" reporter:datatype="link"/>
7928                         <field name="checkin_staff" reporter:datatype="link"/>
7929                         <field name="checkin_time" reporter:datatype="timestamp"/>
7930                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7931                         <field name="circ_staff" reporter:datatype="link"/>
7932                         <field name="desk_renewal" reporter:datatype="bool"/>
7933                         <field name="due_date" reporter:datatype="timestamp"/>
7934                         <field name="duration" reporter:datatype="interval"/>
7935                         <field name="duration_rule" reporter:datatype="link"/>
7936                         <field name="fine_interval" reporter:datatype="interval"/>
7937                         <field name="id" reporter:datatype="id" />
7938                         <field name="max_fine" reporter:datatype="money" />
7939                         <field name="max_fine_rule" reporter:datatype="link"/>
7940                         <field name="opac_renewal" reporter:datatype="bool"/>
7941                         <field name="phone_renewal" reporter:datatype="bool"/>
7942                         <field name="recurring_fine" reporter:datatype="money" />
7943                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7944                         <field name="renewal_remaining" reporter:datatype="int" />
7945             <field name="grace_period" reporter:datatype="interval" />
7946                         <field name="stop_fines" reporter:datatype="text"/>
7947                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7948                         <field name="target_copy" reporter:datatype="link"/>
7949                         <field name="usr" reporter:datatype="link"/>
7950                         <field name="xact_finish" reporter:datatype="timestamp" />
7951                         <field name="xact_start" reporter:datatype="timestamp" />
7952                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7953                         <field name="auto_renewal" reporter:datatype="bool"/>
7954                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7955                 </fields>
7956                 <links>
7957                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7958                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7959                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7960                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7961                 </links>
7962         </class>
7963         <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">
7964                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7965                         <field name="field" reporter:datatype="link"/>
7966                         <field name="id" reporter:datatype="id" />
7967                         <field name="source" reporter:datatype="link"/>
7968                         <field name="value" reporter:datatype="text"/>
7969                 </fields>
7970                 <links>
7971                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7972                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7973                 </links>
7974         </class>
7975         <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">
7976                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7977                         <field name="high" reporter:datatype="money" />
7978                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7979                         <field name="low" reporter:datatype="money" />
7980                         <field name="name" reporter:datatype="text"/>
7981                         <field name="normal" reporter:datatype="money" />
7982                         <field name="recurrence_interval" reporter:datatype="interval"/>
7983             <field name="grace_period" reporter:datatype="interval" />
7984                 </fields>
7985                 <links/>
7986         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7987             <actions>
7988                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7989                 <retrieve/>
7990                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7991                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7992             </actions>
7993         </permacrud>
7994         </class>
7995         <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">
7996                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7997                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7998                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7999                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8000                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8001                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
8002                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8003                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8004                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8005                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8006                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8007                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8008                 </fields>
8009                 <links>
8010                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8011                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8012                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8013                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8014                 </links>
8015         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8016             <actions>
8017                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8018                     <context link="xact" jump="usr" field="home_ou"/>
8019                 </retrieve>
8020                         </actions>
8021                 </permacrud>
8022         </class>
8023         <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">
8024                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8025                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8026                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8027                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8028                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8029                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8030                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8031                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8032                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8033                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8034                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8035                 </fields>
8036                 <links>
8037                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8038                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8039                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8040                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8041                 </links>
8042         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8043             <actions>
8044                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8045                     <context link="xact" jump="usr" field="home_ou"/>
8046                 </retrieve>
8047                         </actions>
8048                 </permacrud>
8049         </class>
8050         <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">
8051                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8052                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8053                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8054                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8055                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8056                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8057                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8058                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8059                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8060                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8061                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8062                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8063                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8064                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8065                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8066                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8067                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8068                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8069                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8070                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8071                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8072                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8073                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8074                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8075                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8076                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8077                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8078                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8079                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8080                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8081                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8082                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8083                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8084                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8085                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8086                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8087                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8088                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8089                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8090                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8091                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8092                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8093                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8094                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8095                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8096                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8097                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8098                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8099                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8100                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8101                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8102                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8103                 </fields>
8104                 <links>
8105                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8106                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8107                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8108                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8109                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8110                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8111                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8112                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8113                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8114                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8115                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8116                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8117                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8118                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8119                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8120                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8121                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8122                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8123                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8124                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8125                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8126                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8127                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8128                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8129                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8130                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8131                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8132                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8133                 </links>
8134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8135             <actions>
8136                 <create permission="CREATE_COPY">
8137                     <context link="call_number" field="owning_lib"/>
8138                 </create>
8139                 <retrieve/>
8140                 <update permission="UPDATE_COPY">
8141                     <context link="call_number" field="owning_lib"/>
8142                 </update>
8143                 <delete permission="DELETE_COPY">
8144                     <context link="call_number" field="owning_lib"/>
8145                 </delete>
8146             </actions>
8147         </permacrud>
8148         </class>
8149
8150         <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">
8151                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8152                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8153                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8154                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8155                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8156                 </fields>
8157                 <links>
8158                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8159                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8160                 </links>
8161                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8162                         <actions>
8163                 <create permission="STAFF_LOGIN"/>
8164                 <retrieve/>
8165                 <update permission="STAFF_LOGIN"/>
8166                 <delete permission="STAFF_LOGIN"/>
8167                         </actions>
8168                 </permacrud>
8169         </class>
8170
8171         <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">
8172                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8173             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8174                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8175                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8176                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8177                 </fields>
8178                 <links>
8179                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8180                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8181                 </links>
8182         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8183             <actions>
8184                                 <retrieve/>
8185             </actions>
8186         </permacrud>
8187         </class>
8188
8189         <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">
8190                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8191                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8192                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8193                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8194                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8195                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8196                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8197                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8198                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8199                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8200                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8201                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8202                 </fields>
8203                 <links>
8204                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8205                 </links>
8206         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8207             <actions>
8208                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8209                 <retrieve/>
8210                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8211                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8212             </actions>
8213         </permacrud>
8214         </class>
8215
8216         <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">
8217                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8218                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8219                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8220                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8221                 </fields>
8222                 <links>
8223                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8224                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8225                 </links>
8226         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8227             <actions>
8228                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8229                 <retrieve/>
8230                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8231                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8232             </actions>
8233         </permacrud>
8234         </class>
8235
8236         <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">
8237                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8238                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8239                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8240                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8241                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8242                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8243                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8244                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8245                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8246                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8247                 </fields>
8248                 <links>
8249                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8250                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8251                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8252                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8253                 </links>
8254         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8255             <actions>
8256                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8257                     <context link="copy" field="circ_lib"/>
8258                 </create>
8259                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8260                     <context link="copy" field="circ_lib"/>
8261                                 </retrieve>
8262                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8263                     <context link="copy" field="circ_lib"/>
8264                                 </update>
8265                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8266                     <context link="copy" field="circ_lib"/>
8267                                 </delete>
8268             </actions>
8269         </permacrud>
8270         </class>
8271
8272         <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">
8273                 <fields oils_persist:primary="id">
8274                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8275                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8276                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8277                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8278                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8279                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8280                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8281                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8282                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8283                 </fields>
8284                 <links>
8285                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8286                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8287                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8288                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8289                 </links>
8290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8291             <actions>
8292                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8293                     <context link="copy" field="circ_lib"/>
8294                 </create>
8295                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8296                     <context link="copy" field="circ_lib"/>
8297                                 </retrieve>
8298                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8299                     <context link="copy" field="circ_lib"/>
8300                                 </update>
8301                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8302                     <context link="copy" field="circ_lib"/>
8303                                 </delete>
8304             </actions>
8305         </permacrud>
8306         </class>
8307
8308         <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">
8309                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8310                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8311                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8312                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8313                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8314                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8315                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8316                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8317                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8318                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8319                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8320                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8321                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8322                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8323                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8324                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8325                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8326                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8327                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8328                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8329                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8330                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8331                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8332                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8333                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8334                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8335                 </fields>
8336                 <links>
8337                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8338                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8339                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8340                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8341                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8342                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8343                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8344                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8345                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8346                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8347                 </links>
8348                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8349                         <actions>
8350                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8351                                 <retrieve />
8352                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8353                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8354                         </actions>
8355                 </permacrud>
8356         </class>
8357
8358         <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">
8359                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8360                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8361                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8362                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8363                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8364                 </fields>
8365                 <links/>
8366         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8367             <actions>
8368                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8369                 <retrieve/>
8370                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8371                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8372             </actions>
8373         </permacrud>
8374         </class>
8375         <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">
8376                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8377                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8378                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8379                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8380                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8381                 </fields>
8382                 <links/>
8383         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8384             <actions>
8385                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8386                 <retrieve/>
8387                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8388                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8389             </actions>
8390         </permacrud>
8391         </class>
8392         <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">
8393                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8394                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8395                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8396                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8397                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8398                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8399                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8400                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8401                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8402                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8403                 </fields>
8404                 <links>
8405                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8406                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8407                 </links>
8408         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8409             <actions>
8410                 <create permission="CREATE_PERM" global_required="true"/>
8411                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8412                 <update permission="UPDATE_PERM" global_required="true"/>
8413                 <delete permission="DELETE_PERM" global_required="true"/>
8414             </actions>
8415         </permacrud>
8416         </class>
8417         <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">
8418                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8419                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8420                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8421                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8422                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8423                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8424                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8425                 </fields>
8426                 <links>
8427                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8428                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8429                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8430                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8431                 </links>
8432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8433                         <actions>
8434                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8435                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8436                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8437                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8438                         </actions>
8439                 </permacrud>
8440         </class>
8441         <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">
8442                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8443                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8444                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8445                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8446                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8447                 </fields>
8448                 <links>
8449                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8450                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8451                 </links>
8452         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8453             <actions>
8454                 <create permission="ADMIN_SURVEY">
8455                     <context link="question" jump="survey" field="owner"/>
8456                 </create>
8457                 <retrieve/>
8458                 <update permission="ADMIN_SURVEY">
8459                     <context link="question" jump="survey" field="owner"/>
8460                 </update>
8461                 <delete permission="ADMIN_SURVEY">
8462                     <context link="question" jump="survey" field="owner"/>
8463                 </delete>
8464             </actions>
8465         </permacrud>
8466         </class>
8467         <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">
8468                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8469                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8470                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8471                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8472                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8473                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8474                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8475                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8476                 </fields>
8477                 <links>
8478                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8479                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8480                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8481                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8482                 </links>
8483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8484                         <actions>
8485                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8486                         </actions>
8487                 </permacrud>
8488         </class>
8489         <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">
8490                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8491                         <field name="balance_owed" reporter:datatype="money" />
8492                         <field name="total_owed" reporter:datatype="money" />
8493                         <field name="total_paid" reporter:datatype="money" />
8494                         <field name="usr" reporter:datatype="link"/>
8495                 </fields>
8496                 <links>
8497                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8498                 </links>
8499         </class>
8500         <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">
8501                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8502                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8503                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8504                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8505                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8506                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8507                 </fields>
8508                 <links>
8509                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8510                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8511                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8512                 </links>
8513         </class>
8514         <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">
8515                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8516                         <field name="field" reporter:datatype="link"/>
8517                         <field name="id" reporter:datatype="id" />
8518                         <field name="source" reporter:datatype="link"/>
8519                         <field name="value" reporter:datatype="text"/>
8520                 </fields>
8521                 <links>
8522                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8523                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8524                 </links>
8525         </class>
8526         <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">
8527                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8528                         <field name="field" reporter:datatype="link"/>
8529                         <field name="id" reporter:datatype="id" />
8530                         <field name="source" reporter:datatype="link"/>
8531                         <field name="value" reporter:datatype="text"/>
8532                 </fields>
8533                 <links>
8534                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8535                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8536                 </links>
8537         </class>
8538         <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">
8539                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8540                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8541                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8542                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8543                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8544                 </fields>
8545                 <links>
8546                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8547                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8548                 </links>
8549         </class>
8550         <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">
8551                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8552                         <field name="depth" reporter:datatype="int" />
8553                         <field name="grantable" reporter:datatype="bool"/>
8554                         <field name="grp" reporter:datatype="link"/>
8555                         <field name="id" reporter:datatype="id" />
8556                         <field name="perm" reporter:datatype="link"/>
8557                 </fields>
8558                 <links>
8559                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8560                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8561                 </links>
8562         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8563             <actions>
8564                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8565                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8566                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8567                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8568             </actions>
8569         </permacrud>
8570         </class>
8571         <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">
8572                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8573                         <field name="items" oils_persist:virtual="true" />
8574                         <field name="btype" reporter:datatype="text"/>
8575                         <field name="id" reporter:datatype="id" />
8576                         <field name="name" reporter:datatype="text"/>
8577                         <field name="description" reporter:datatype="text"/>
8578                         <field name="owner" reporter:datatype="link"/>
8579                         <field name="pub" reporter:datatype="bool"/>
8580                         <field name="create_time" reporter:datatype="timestamp" />
8581                         <field name="owning_lib" reporter:datatype="org_unit" />
8582                 </fields>
8583                 <links>
8584                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8585                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8586                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8587                 </links>
8588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8589                         <actions>
8590                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8591                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8592                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8593                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8594                         </actions>
8595                 </permacrud>
8596         </class>
8597         <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">
8598                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8599                         <field name="id" reporter:datatype="id" />
8600                         <field name="bucket" reporter:datatype="link"/>
8601                         <field name="note" reporter:datatype="text" />
8602                 </fields>
8603                 <links>
8604                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8605                 </links>
8606         </class>
8607         <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">
8608                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8609                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8610                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8611                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8612                 </fields>
8613                 <links>
8614                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8615                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8616                 </links>
8617         </class>
8618         <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">
8619                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8620                         <field name="depth" reporter:datatype="int"/>
8621                         <field name="grantable" reporter:datatype="bool"/>
8622                         <field name="id" reporter:datatype="id" />
8623                         <field name="perm" reporter:datatype="link"/>
8624                         <field name="usr" reporter:datatype="link"/>
8625                 </fields>
8626                 <links>
8627                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8628                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8629                 </links>
8630         </class>
8631         <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">
8632                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8633                         <field name="object_id" reporter:datatype="text"/>
8634                         <field name="grantable" reporter:datatype="bool"/>
8635                         <field name="id" reporter:datatype="id" />
8636                         <field name="perm" reporter:datatype="link"/>
8637                         <field name="usr" reporter:datatype="link"/>
8638                         <field name="object_type" reporter:datatype="text"/>
8639                 </fields>
8640                 <links>
8641                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8642                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8643                 </links>
8644         </class>
8645         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8646                 <fields oils_persist:primary="id" oils_persist:sequence="">
8647                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8648                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8649                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8650                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8651                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8652                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8653                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8654                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8655                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8656                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8657                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8658                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8659                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8660                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8661                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8662                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8663                 </fields>
8664                 <links>
8665                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8666                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8667                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8668                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8669                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8670                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8671                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8672                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8673                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8674                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8675                 </links>
8676         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8677             <actions>
8678                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8679                     <context link="xact" jump="usr" field="home_ou"/>
8680                 </retrieve>
8681                         </actions>
8682                 </permacrud>
8683         </class>
8684         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8685                 oils_obj:fieldmapper="money::aged_payment" 
8686                 oils_persist:tablename="money.aged_payment" 
8687                 reporter:label="Payments: Aged">
8688                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8689                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8690                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8691                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8692                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8693                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8694                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8695                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8696                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8697                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8698                         <field name="billing" reporter:datatype="link"/>
8699                 </fields>
8700                 <links>
8701                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8702                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8703                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8704                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8705                 </links>
8706                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8707                         <actions>
8708                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8709                                         <context link="xact" field="usr_home_ou"/>
8710                                 </retrieve>
8711                         </actions>
8712                 </permacrud>
8713         </class>
8714         <class id="mallp" controller="open-ils.cstore" 
8715                 oils_obj:fieldmapper="money::all_payments" 
8716                 oils_persist:tablename="money.all_payments" 
8717                 oils_persist:readonly="true" reporter:core="true"
8718                 reporter:label="Payments: All">
8719                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8720                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8721                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8722                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8723                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8724                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8725                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8726                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8727                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8728                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8729                         <field name="billing" reporter:datatype="link"/>
8730                 </fields>
8731                 <links>
8732                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8733                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8734                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8735                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8736                 </links>
8737         </class>
8738
8739         <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">
8740                 <fields oils_persist:primary="id" oils_persist:sequence="">
8741                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8742                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8743                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8744                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8745                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8746                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8747                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8748                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8749                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8750                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8751                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8752                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8753                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8754                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8755                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8756                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8757                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8758                 </fields>
8759                 <links>
8760                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8761                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8762                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8763                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8764                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8765                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8766                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8767                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8768                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8769                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8770                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8771                 </links>
8772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8773                         <actions>
8774                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8775                                         <context link="xact" jump="usr" field="home_ou"/>
8776                                 </retrieve>
8777                         </actions>
8778                 </permacrud>
8779         </class>
8780         <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">
8781                 <fields oils_persist:primary="id" oils_persist:sequence="">
8782                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8783                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8784                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8785                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8786                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8787                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8788                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8789                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8790                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8791                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8792                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8793                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8794                 </fields>
8795                 <links>
8796                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8797                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8798                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8799                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8800                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8801                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8802                 </links>
8803         </class>
8804         <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">
8805                 <fields oils_persist:primary="id" oils_persist:sequence="">
8806                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8807                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8808                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8809                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8810                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8811                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8812                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8813                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8814                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8815                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8816                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8817                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8818                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8819                 </fields>
8820                 <links>
8821                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8822                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8823                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8824                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8825                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8826                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8827                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8828                 </links>
8829         </class>
8830         <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">
8831                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8832                         <field name="bucket" reporter:datatype="link"/>
8833                         <field name="id" reporter:datatype="id" />
8834                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8835                         <field name="create_time" reporter:datatype="timestamp" />
8836                         <field name="pos" reporter:datatype="int" />
8837                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8838                 </fields>
8839                 <links>
8840                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8841                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8842             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8843                 </links>
8844                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8845                         <actions>
8846                                 <retrieve permission="ADMIN_COPY_BUCKET">
8847                     <context link="bucket" field="owning_lib"/>
8848                 </retrieve>
8849             </actions>
8850         </permacrud>
8851         </class>
8852         <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">
8853                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8854                         <field name="id" reporter:datatype="id" />
8855                         <field name="item" reporter:datatype="link"/>
8856                         <field name="note" reporter:datatype="text" />
8857                 </fields>
8858                 <links>
8859                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8860                 </links>
8861         </class>
8862         <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">
8863                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8864                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8865                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8866                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8867                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8868                 </fields>
8869                 <links>
8870                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8871                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8872                 </links>
8873                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8874                         <actions>
8875                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8876                         </actions>
8877                 </permacrud>
8878         </class>
8879     <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">
8880         <fields oils_persist:primary="field">
8881             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8882             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8883             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8884         </fields>
8885         <links/>
8886         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8887             <actions>
8888                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8889                 <retrieve />
8890                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8891                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8892             </actions>
8893         </permacrud>
8894     </class>
8895         <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">
8896                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8897                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8898                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8899                 </fields>
8900                 <links/>
8901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8902             <actions>
8903                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8904                 <retrieve/>
8905                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8906                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8907             </actions>
8908         </permacrud>
8909         </class>
8910
8911
8912         <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">
8913                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8914                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8915                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8916                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8917                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8918                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8919                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8920                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8921                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8922                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8923                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8924                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8925                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8926                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8927                 </fields>
8928                 <links>
8929                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8930                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8931                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8932                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8933                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8934                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8935                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8936                 </links>
8937         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8938             <actions>
8939                 <create permission="TRANSIT_COPY">
8940                     <context link="target_copy" field="owner"/>
8941                 </create>
8942                 <retrieve/>
8943                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8944                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8945             </actions>
8946         </permacrud>
8947         </class>
8948         <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">
8949                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8950                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8951                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8952                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8953                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8954                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8955                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8956                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8957                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8958                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8959                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8960                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8961                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8962                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8963                 </fields>
8964                 <links>
8965                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8966                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8967                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8968                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8969                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8970                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8971                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8972                 </links>
8973         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8974             <actions>
8975                 <create permission="TRANSIT_COPY" context_field="owner">
8976                     <context link="target_copy" field="circ_lib"/>
8977                 </create>
8978                 <retrieve/>
8979                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8980                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8981             </actions>
8982         </permacrud>
8983         </class>
8984         <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">
8985                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8986                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8987                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8988                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8989                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8990                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8991                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8992                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8993                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8994                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8995                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8996                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8997                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8998                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8999                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
9000                 </fields>
9001                 <links>
9002                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9003                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9004                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9005                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
9006                 </links>
9007         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9008             <actions>
9009                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9010                     <context link="xact" jump="usr" field="home_ou"/>
9011                 </retrieve>
9012                         </actions>
9013                 </permacrud>
9014         </class>
9015         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9016                 oils_obj:fieldmapper="money::aged_billing" 
9017                 oils_persist:tablename="money.aged_billing" 
9018                 reporter:label="Aged Billing Line Item">
9019                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9020                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9021                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9022                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9023                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9024                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9025                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9026                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9027                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9028                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9029                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9030                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9031                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9032                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9033                 </fields>
9034                 <links>
9035                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9036                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9037                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9038                 </links>
9039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9040                         <actions>
9041                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9042                                         <context link="xact" field="usr_home_ou"/>
9043                                 </retrieve>
9044                         </actions>
9045                 </permacrud>
9046         </class>
9047         <class id="mallb" controller="open-ils.cstore" 
9048                 oils_obj:fieldmapper="money::all_billings" 
9049                 oils_persist:tablename="money.all_billings" 
9050                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9051                 <fields oils_persist:primary="id" oils_persist:sequence="">
9052                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9053                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9054                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9055                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9056                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9057                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9058                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9059                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9060                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9061                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9062                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9063                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9064                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9065                 </fields>
9066                 <links>
9067                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9068                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9069                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9070                 </links>
9071         </class>
9072         <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">
9073                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9074                         <field name="grp" />
9075                         <field name="id" reporter:datatype="id" />
9076                         <field name="usr" />
9077                 </fields>
9078                 <links>
9079                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9080                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9081                 </links>
9082         </class>
9083         <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">
9084                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9085                         <field name="id" reporter:datatype="id" />
9086                         <field name="fq_field" reporter:datatype="text"/>
9087                         <field name="identity_value" reporter:datatype="text"/>
9088                         <field name="translation" reporter:datatype="text"/>
9089                         <field name="string" reporter:datatype="text"/>
9090                 </fields>
9091                 <links>
9092                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9093                 </links>
9094         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9095             <actions>
9096                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9097                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9098                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9099                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9100             </actions>
9101         </permacrud>
9102         </class>
9103         <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">
9104                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9105                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9106                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9107                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9108                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9109                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9110                 </fields>
9111                 <links>
9112                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9113                 </links>
9114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9115             <actions>
9116                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9117                 <retrieve/>
9118                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9119                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9120             </actions>
9121         </permacrud>
9122         </class>
9123         <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">
9124                 <fields oils_persist:primary="code">
9125                         <field name="code" reporter:datatype="id" />
9126                         <field name="marc_code" reporter:datatype="text"/>
9127                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9128                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9129                         <field name="rtl" reporter:datatype="bool"/>
9130                 </fields>
9131                 <links/>
9132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9133             <actions>
9134                 <create permission="CREATE_LOCALE" global_required="true"/>
9135                 <retrieve/>
9136                 <update permission="UPDATE_LOCALE" global_required="true"/>
9137                 <delete permission="DELETE_LOCALE" global_required="true"/>
9138             </actions>
9139         </permacrud>
9140         </class>
9141         <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">
9142                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9143                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9144                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9145                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9146                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9147                 </fields>
9148                 <links>
9149                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9150                 </links>
9151         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9152             <actions>
9153                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9154                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9155                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9156                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9157             </actions>
9158         </permacrud>
9159         </class>
9160
9161         <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">
9162                 <fields oils_persist:primary="id">
9163                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9164                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9165                 </fields>
9166                 <links/>
9167         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9168             <actions>
9169                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9170                 <retrieve/>
9171                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9172                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9173             </actions>
9174         </permacrud>
9175         </class>
9176
9177         <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">
9178                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9179                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9180                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9181                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9182                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9183                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9184                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9185                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9186                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9187                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9188                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9189                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9190                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9191                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9192                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9193                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9194                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9195                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9196                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9197                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9198                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9199                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9200                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9201                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9202                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9203                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9204                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9205                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9206                 </fields>
9207                 <links>
9208                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9209                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9210                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9211                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9212                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9213                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9214                 </links>
9215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9216             <actions>
9217                 <create permission="user_request.create">
9218                     <context link="usr" field="home_ou"/>
9219                                 </create>
9220                 <retrieve permission="user_request.view">
9221                     <context link="usr" field="home_ou"/>
9222                                 </retrieve>
9223                 <update permission="user_request.update">
9224                     <context link="usr" field="home_ou"/>
9225                                 </update>
9226                 <delete permission="user_request.delete">
9227                     <context link="usr" field="home_ou"/>
9228                                 </delete>
9229             </actions>
9230         </permacrud>
9231         </class>
9232
9233         <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">
9234         <oils_persist:source_definition><![CDATA[
9235             SELECT r.*, CASE
9236                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9237                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9238                         WHEN l.state = 'received' THEN 5 -- Received
9239                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9240                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9241                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9242                         WHEN l.id IS NULL THEN 1 -- New
9243                         ELSE 0 -- Error
9244                     END AS request_status
9245                     ,u.home_ou
9246             FROM      acq.user_request r
9247             JOIN actor.usr u ON (r.usr = u.id)
9248             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9249             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9250             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9251         ]]></oils_persist:source_definition>
9252                 <fields oils_persist:primary="id">
9253                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9254                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9255                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9256                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9257                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9258                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9259                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9260                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9261                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9262                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9263                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9264                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9265                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9266                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9267                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9268                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9269                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9270                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9271                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9272                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9273                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9274                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9275                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9276                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9277                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9278                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9279                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9280                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9281                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9282                 </fields>
9283                 <links>
9284                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9285                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9286                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9287                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9288                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9289                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9290                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9291                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9292                 </links>
9293         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9294             <actions>
9295                 <retrieve permission="user_request.view">
9296                     <context link="usr" field="home_ou"/>
9297                                 </retrieve>
9298             </actions>
9299         </permacrud>
9300         </class>
9301
9302         <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">
9303                 <fields oils_persist:primary="id">
9304                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9305                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9306                 </fields>
9307                 <links/>
9308         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9309             <actions>
9310                 <retrieve/>
9311             </actions>
9312         </permacrud>
9313         </class>
9314
9315         <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">
9316                 <fields oils_persist:primary="code">
9317                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9318                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9319                 </fields>
9320                 <links/>
9321         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9322             <actions>
9323                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9324                 <retrieve/>
9325                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9326                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9327             </actions>
9328         </permacrud>
9329         </class>
9330
9331         <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">
9332                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9333                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9334                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9335                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9336                         <field reporter:label="Ratio" name="ratio" />
9337                 </fields>
9338                 <links>
9339                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9340                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9341                 </links>
9342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9343                         <actions>
9344                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9345                                 <retrieve/>
9346                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9347                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9348                         </actions>
9349                 </permacrud>
9350         </class>
9351
9352         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9353                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9354                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9355                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9356                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9357                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9358                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9359                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9360                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9361                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9362                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9363                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9364                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9365                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9366                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9367                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9368                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9369                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9370                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9371                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9372                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9373                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9374                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9375                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9376                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9377                 </fields>
9378                 <links>
9379                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9380                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9381                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9382                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9383                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9384                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9385                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9386                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9387                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9388                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9389                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9390                 </links>
9391         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9392             <actions>
9393                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9394                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9395                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9396                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9397             </actions>
9398         </permacrud>
9399         </class>
9400
9401         <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">
9402                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9403                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9404                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9405                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9406                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9407                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9408                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9409                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9410                 </fields>
9411                 <links>
9412                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9413                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9414                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9415                 </links>
9416         </class>
9417
9418         <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">
9419                 <fields oils_persist:primary="code">
9420                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9421                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9422                 </fields>
9423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9424             <actions>
9425                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9426                 <retrieve/>
9427                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9428                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9429             </actions>
9430                 </permacrud>
9431         </class>
9432
9433         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9434                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9435                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9436                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9437                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9438                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9439                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9440                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9441                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9442                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9443                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9444                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9445                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9446                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9447                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9448                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9449                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9450                 </fields>
9451                 <links>
9452                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9453                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9454                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9455                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9456                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9457                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9458                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9459                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9460                 </links>
9461         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9462             <actions>
9463                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9464                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9465                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9466                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9467             </actions>
9468         </permacrud>
9469         </class>
9470
9471         <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">
9472                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9473                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9474                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9475                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9476                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9477                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9478                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9479                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9480                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9481                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9482                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9483                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9484                 </fields>
9485                 <links>
9486                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9487                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9488                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9489                 </links>
9490         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9491             <actions>
9492                 <create   permission="ADMIN_INVOICE">
9493                                         <context link="invoice" field="receiver"/>
9494                                 </create>
9495                 <retrieve permission="ADMIN_INVOICE">
9496                                         <context link="invoice" field="receiver"/>
9497                                 </retrieve>
9498                 <update   permission="ADMIN_INVOICE">
9499                                         <context link="invoice" field="receiver"/>
9500                                 </update>
9501                                 <delete   permission="ADMIN_INVOICE">
9502                                         <context link="invoice" field="receiver"/>
9503                                 </delete>
9504             </actions>
9505         </permacrud>
9506         </class>
9507
9508         <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">
9509                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9510                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9511                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9512                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9513                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9514                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9515                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9516                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9517                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9518                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9519                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9520                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9521                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9522                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9523                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9524                 </fields>
9525                 <links>
9526                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9527                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9528                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9529                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9530                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9531                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9532                 </links>
9533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9534             <actions>
9535                 <create   permission="ADMIN_INVOICE">
9536                                         <context link="invoice" field="receiver"/>
9537                                 </create>
9538                 <retrieve permission="ADMIN_INVOICE">
9539                                         <context link="invoice" field="receiver"/>
9540                                 </retrieve>
9541                 <update   permission="ADMIN_INVOICE">
9542                                         <context link="invoice" field="receiver"/>
9543                                 </update>
9544                                 <delete   permission="ADMIN_INVOICE">
9545                                         <context link="invoice" field="receiver"/>
9546                                 </delete>
9547             </actions>
9548         </permacrud>
9549         </class>
9550
9551         <class id="acqsn" 
9552                 controller="open-ils.cstore open-ils.pcrud" 
9553                 oils_obj:fieldmapper="acq::shipment_notification" 
9554                 oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9555                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9556                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9557                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9558                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9559                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9560                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp" />
9561                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9562                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp" />
9563                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link" />
9564                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" />
9565                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text" />
9566                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9567                         <field reporter:label="Shipment Notification Entries" name="entries" 
9568                                 reporter:datatype="link" oils_persist:virtual="true"/>
9569                 </fields>
9570                 <links>
9571                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9572                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9573                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9574                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9575                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9576                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9577                 </links>
9578                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9579                         <actions>
9580                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9581                                 <update   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9582                                 <delete   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9583                         </actions>
9584                 </permacrud>
9585         </class>
9586
9587         <class id="acqsne" 
9588                 controller="open-ils.cstore open-ils.pcrud" 
9589                 oils_obj:fieldmapper="acq::shipment_notification_entry" 
9590                 oils_persist:tablename="acq.shipment_notification_entry" 
9591                 reporter:label="Shipment Notification Entry">
9592                 <fields oils_persist:primary="id" 
9593                         oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9594                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9595                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" />
9596                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9597                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" />
9598                 </fields>
9599                 <links>
9600                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9601                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9602                 </links>
9603                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9604                                 <actions>
9605                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9606                                                 <context link="shipment_notification" field="receiver"/>
9607                                         </retrieve>
9608                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9609                                                 <context link="shipment_notification" field="receiver"/>
9610                                         </update>
9611                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9612                                                 <context link="shipment_notification" field="receiver"/>
9613                                         </delete>
9614                                 </actions>
9615                         </permacrud>
9616         </class>
9617
9618         <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">
9619                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9620                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9621                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9622                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9623                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9624                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9625                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9626                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9627                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9628                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9629                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9630                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9631                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9632                 </fields>
9633                 <links>
9634                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9635                 </links>
9636         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9637             <actions>
9638                 <create permission="ADMIN_PROVIDER">
9639                     <context link="provider" field="owner"/>
9640                 </create>
9641                 <retrieve permission="ADMIN_PROVIDER">
9642                     <context link="provider" field="owner"/>
9643                 </retrieve>
9644                 <update permission="ADMIN_PROVIDER">
9645                     <context link="provider" field="owner"/>
9646                 </update>
9647                 <delete permission="ADMIN_PROVIDER">
9648                     <context link="provider" field="owner"/>
9649                 </delete>
9650             </actions>
9651         </permacrud>
9652         </class>
9653
9654         <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">
9655                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9656                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9657                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9658                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9659                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9660                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9661                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9662                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9663         </fields>
9664                 <links>
9665                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9666                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9667                 </links>
9668         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9669             <actions>
9670                 <create permission="ADMIN_PROVIDER">
9671                     <context link="provider" field="owner"/>
9672                 </create>
9673                 <retrieve permission="ADMIN_PROVIDER">
9674                     <context link="provider" field="owner"/>
9675                 </retrieve>
9676                 <update permission="ADMIN_PROVIDER">
9677                     <context link="provider" field="owner"/>
9678                 </update>
9679                 <delete permission="ADMIN_PROVIDER">
9680                     <context link="provider" field="owner"/>
9681                 </delete>
9682             </actions>
9683         </permacrud>
9684     </class>
9685         <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">
9686                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9687                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9688                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9689                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9690                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9691                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9692                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9693                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9694                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9695                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9696                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9697                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9698                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9699                 </fields>
9700                 <links>
9701                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9702                 </links>
9703         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9704             <actions>
9705                 <create permission="ADMIN_PROVIDER">
9706                     <context link="contact" jump='provider' field="owner"/>
9707                 </create>
9708                 <retrieve permission="ADMIN_PROVIDER">
9709                     <context link="contact" jump='provider' field="owner"/>
9710                 </retrieve>
9711                 <update permission="ADMIN_PROVIDER">
9712                     <context link="contact" jump='provider' field="owner"/>
9713                 </update>
9714                 <delete permission="ADMIN_PROVIDER">
9715                     <context link="contact" jump='provider' field="owner"/>
9716                 </delete>
9717             </actions>
9718         </permacrud>
9719         </class>
9720
9721         <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">
9722                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9723                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9724                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9725                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9726                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9727                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9728                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9729                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9730                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9731                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9732                 </fields>
9733                 <links>
9734                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9735                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9736                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9737                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9738                 </links>
9739         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9740             <actions>
9741                 <create permission="ADMIN_ACQ_FUND">
9742                     <context link="src_fund" field="org"/>
9743                 </create>
9744                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9745                     <context link="src_fund" field="org"/>
9746                     <context link="dest_fund" field="org"/>
9747                 </retrieve>
9748                 <update permission="ADMIN_ACQ_FUND">
9749                     <context link="src_fund" field="org"/>
9750                 </update>
9751                 <delete permission="ADMIN_ACQ_FUND">
9752                     <context link="src_fund" field="org"/>
9753                 </delete>
9754             </actions>
9755         </permacrud>
9756         </class>
9757
9758         <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">
9759                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9760                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9761                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9762                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9763                 </fields>
9764                 <links>
9765             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9766                 </links>
9767                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9768                         <actions>
9769                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9770                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9771                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9772                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9773                         </actions>
9774                 </permacrud>
9775         </class>
9776
9777         <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">
9778                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9779                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9780                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9781                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9782                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9783                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9784                 </fields>
9785                 <links>
9786                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9787                 </links>
9788                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9789                         <actions>
9790                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9791                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9792                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9793                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9794                         </actions>
9795                 </permacrud>
9796         </class>
9797
9798         <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">
9799                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9800                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9801                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9802                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9803                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9804                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9805                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9806                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9807                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9808                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9809                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9810                 </fields>
9811                 <links>
9812                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9813                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9814             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9815             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9816                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9817                 </links>
9818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9819             <actions>
9820                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9821                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9822                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9823                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9824             </actions>
9825         </permacrud>
9826         </class>
9827
9828         <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">
9829                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9830                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9831                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9832                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9833                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9834                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9835                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9836                 </fields>
9837                 <links>
9838                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9839                 </links>
9840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9841                         <actions>
9842                                 <create permission="ADMIN_FUNDING_SOURCE">
9843                     <context link="funding_source" field="owner"/>
9844                 </create>
9845                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9846                     <context link="funding_source" field="owner"/>
9847                 </retrieve>
9848                                 <update permission="ADMIN_FUNDING_SOURCE">
9849                     <context link="funding_source" field="owner"/>
9850                 </update>
9851                                 <delete permission="ADMIN_FUNDING_SOURCE">
9852                     <context link="funding_source" field="owner"/>
9853                 </delete>
9854                         </actions>
9855                 </permacrud>
9856         </class>
9857
9858         <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">
9859                 <fields oils_persist:primary="id">
9860                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9861                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9862                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9863                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9864                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9865                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9866                 </fields>
9867                 <links>
9868                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9869                 </links>
9870         </class>
9871
9872         <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">
9873                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9874                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9875                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9876                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9877                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9878                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9879                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9880                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9881                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9882                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9883                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9884                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9885                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9886                 </fields>
9887                 <links>
9888                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9889                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9890                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9891                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9892                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9893                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9894                 </links>
9895                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9896                         <actions>
9897                                 <create permission="ADMIN_ACQ_FUND">
9898                     <context link="fund" field="org"/>
9899                 </create>
9900                                 <retrieve permission="ADMIN_ACQ_FUND">
9901                     <context link="fund" field="org"/>
9902                 </retrieve>
9903                                 <update permission="ADMIN_ACQ_FUND">
9904                     <context link="fund" field="org"/>
9905                 </update>
9906                                 <delete permission="ADMIN_ACQ_FUND">
9907                     <context link="fund" field="org"/>
9908                 </delete>
9909                         </actions>
9910                 </permacrud>
9911         </class>
9912
9913         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9914                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9915                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9916                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9917                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9918                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9919                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9920                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9921                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9922                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9923                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9924                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9925                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9926                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9927                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9928                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9929                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9930                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9931                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9932                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9933                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9934                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9935                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9936                 </fields>
9937                 <links>
9938                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9939                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9940             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9941             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9942             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9943             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9944             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9945             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9946             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9947             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9948             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9949                 </links>
9950         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9951             <actions>
9952                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9953                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9954                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9955                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9956             </actions>
9957         </permacrud>
9958         </class>
9959
9960         <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">
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         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9969             <actions>
9970                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9971                                         <context link="fund" field="org" />
9972                 </retrieve>
9973             </actions>
9974         </permacrud>
9975         </class>
9976
9977         <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">
9978                 <fields oils_persist:primary="fund">
9979                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9980                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9981                 </fields>
9982                 <links>
9983                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9984                 </links>
9985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9986             <actions>
9987                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9988                                         <context link="fund" field="org" />
9989                 </retrieve>
9990             </actions>
9991         </permacrud>
9992         </class>
9993
9994         <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">
9995                 <fields oils_persist:primary="fund">
9996                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9997                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9998                 </fields>
9999                 <links>
10000                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10001                 </links>
10002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10003             <actions>
10004                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10005                                         <context link="fund" field="org" />
10006                 </retrieve>
10007             </actions>
10008         </permacrud>
10009         </class>
10010
10011         <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">
10012                 <fields oils_persist:primary="fund">
10013                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10014                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10015                 </fields>
10016                 <links>
10017                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10018                 </links>
10019         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10020             <actions>
10021                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10022                                         <context link="fund" field="org" />
10023                 </retrieve>
10024             </actions>
10025         </permacrud>
10026         </class>
10027
10028         <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">
10029                 <fields oils_persist:primary="fund">
10030                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10031                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
10032                 </fields>
10033                 <links>
10034                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10035                 </links>
10036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10037             <actions>
10038                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10039                                         <context link="fund" field="org" />
10040                 </retrieve>
10041             </actions>
10042         </permacrud>
10043         </class>
10044
10045    <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">
10046         <fields oils_persist:primary="fund">
10047             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10048             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10049         </fields>
10050         <links>
10051             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10052         </links>
10053     </class>
10054
10055    <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">
10056         <fields oils_persist:primary="fund">
10057             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10058             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
10059         </fields>
10060         <links>
10061             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10062         </links>
10063     </class>
10064
10065    <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">
10066         <fields oils_persist:primary="fund">
10067             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10068             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10069         </fields>
10070         <links>
10071             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10072         </links>
10073     </class>
10074
10075    <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">
10076         <fields oils_persist:primary="fund">
10077             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10078             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10079         </fields>
10080         <links>
10081             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10082         </links>
10083     </class>
10084
10085    <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">
10086         <fields oils_persist:primary="fund">
10087             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10088             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10089         </fields>
10090         <links>
10091             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10092         </links>
10093     </class>
10094
10095         <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">
10096                 <fields oils_persist:primary="funding_source">
10097                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10098                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10099                 </fields>
10100                 <links>
10101                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10102                 </links>
10103         </class>
10104
10105         <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">
10106                 <fields oils_persist:primary="funding_source">
10107                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10108                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10109                 </fields>
10110                 <links>
10111                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10112                 </links>
10113         </class>
10114
10115         <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">
10116                 <fields oils_persist:primary="funding_source">
10117                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10118                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10119                 </fields>
10120                 <links>
10121                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10122                 </links>
10123         </class>
10124
10125         <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">
10126                 <fields oils_persist:primary="fund">
10127                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10128                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10129                 </fields>
10130                 <links>
10131                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10132                 </links>
10133         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10134             <actions>
10135                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10136                                         <context link="fund" field="org" />
10137                 </retrieve>
10138             </actions>
10139         </permacrud>
10140     </class>
10141     <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">
10142         <oils_persist:source_definition><![CDATA[
10143             SELECT
10144                 acqf.*,
10145                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10146                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10147                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10148                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10149             FROM
10150                 acq.fund acqf
10151                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10152                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10153                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10154                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10155         ]]></oils_persist:source_definition>
10156         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10157             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10158             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10159             <field reporter:label="Name" name="name" reporter:datatype="text" />
10160             <field reporter:label="Year" name="year" reporter:datatype="int" />
10161             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10162             <field reporter:label="Code" name="code" reporter:datatype="text" />
10163             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10164             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10165             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10166             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10167             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10168
10169             <!-- non fund-native fields -->
10170             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10171             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10172             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10173             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10174         </fields>
10175         <links>
10176             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10177             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10178             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10179         </links>
10180         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10181             <actions>
10182                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10183             </actions>
10184         </permacrud>
10185         </class>
10186         <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">
10187                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10188                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10189                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10190                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10191                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10192                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10193                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10194                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10195                 </fields>
10196                 <links>
10197                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10198                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10199                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10200                 </links>
10201                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10202                         <actions>
10203                                 <create permission="ADMIN_ACQ_FUND">
10204                     <context link="fund" field="org"/>
10205                 </create>
10206                                 <retrieve permission="ADMIN_ACQ_FUND">
10207                     <context link="fund" field="org"/>
10208                 </retrieve>
10209                                 <update permission="ADMIN_ACQ_FUND">
10210                     <context link="fund" field="org"/>
10211                 </update>
10212                                 <delete permission="ADMIN_ACQ_FUND">
10213                     <context link="fund" field="org"/>
10214                 </delete>
10215                         </actions>
10216                 </permacrud>
10217         </class>
10218
10219     <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">
10220         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10221             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10222             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10223             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10224             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10225             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10226             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10227             <field reporter:label="Note" name="note" reporter:datatype="text" />
10228             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10229         </fields>
10230         <links>
10231             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10232             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10233             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10234         </links>
10235                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10236                         <actions>
10237                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10238                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10239                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10240                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10241                         </actions>
10242                 </permacrud>
10243     </class>
10244
10245         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10246                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10247                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10248                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10249                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10250                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10251                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10252                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10253                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10254                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10255                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10256                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10257                 </fields>
10258                 <links>
10259                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10260                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10261                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10262                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10263                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10264                 </links>
10265                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10266                         <actions>
10267                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10268                         </actions>
10269                 </permacrud>
10270         </class>
10271
10272         <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">
10273                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10275                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10276                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10277                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10278                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10279                 </fields>
10280                 <links>
10281                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10282                 </links>
10283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10284                         <actions>
10285                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10286                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10287                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10288                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10289                         </actions>
10290                 </permacrud>
10291         </class>
10292
10293         <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">
10294                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10295                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10296                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10297                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10298                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10299                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10300                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10301                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10302                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10303                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10304                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10305                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10306                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10307                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10308                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10309                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10310                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10311                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10312                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10313                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10314                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10315                 </fields>
10316                 <links>
10317                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10318                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10319                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10320                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10321                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10322                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10323                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10324                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10325                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10326                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10327                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10328                 </links>
10329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10330                         <actions>
10331                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10332                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10333                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10334                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10335                         </actions>
10336                 </permacrud>
10337         </class>
10338
10339         <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">
10340                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10341                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10342                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10343                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10344                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10345                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10346                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10347                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10348                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10349                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10350                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10351                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10352                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10353                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10354                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10355                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10356                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10357                 </fields>
10358                 <links>
10359                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10360                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10361                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10362                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10363                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10364                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10365                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10366                 </links>
10367                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10368             <actions>
10369                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10370             </actions>
10371                 </permacrud>
10372         </class>
10373
10374         <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">
10375                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10376                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10377                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10378                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10379                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10380                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10381                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10382                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10383                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10384                 </fields>
10385                 <links>
10386                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10387                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10388                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10389                 </links>
10390                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10391             <actions>
10392                 <create permission="CREATE_PURCHASE_ORDER">
10393                     <context link="purchase_order" field="ordering_agency"/>
10394                 </create>
10395                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10396                     <context link="purchase_order" field="ordering_agency"/>
10397                 </retrieve>
10398                 <update permission="CREATE_PURCHASE_ORDER">
10399                     <context link="purchase_order" field="ordering_agency"/>
10400                 </update>
10401                 <delete permission="CREATE_PURCHASE_ORDER">
10402                     <context link="purchase_order" field="ordering_agency"/>
10403                 </delete>
10404             </actions>
10405                 </permacrud>
10406         </class>
10407
10408         <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">
10409                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10410                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10411                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10412                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10413                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10414                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10415                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10416                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10417                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10418                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10419                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10420                 </fields>
10421                 <links>
10422                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10423                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10424                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10425                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10426                 </links>
10427                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10428             <actions>
10429                 <create permission="CREATE_PURCHASE_ORDER">
10430                     <context link="purchase_order" field="ordering_agency"/>
10431                 </create>
10432                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10433                     <context link="purchase_order" field="ordering_agency"/>
10434                 </retrieve>
10435                 <update permission="CREATE_PURCHASE_ORDER">
10436                     <context link="purchase_order" field="ordering_agency"/>
10437                 </update>
10438                 <delete permission="CREATE_PURCHASE_ORDER">
10439                     <context link="purchase_order" field="ordering_agency"/>
10440                 </delete>
10441             </actions>
10442                 </permacrud>
10443         </class>
10444
10445         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10446                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10447                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10448                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10449                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10450                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10451                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10452                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10453                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10454                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10455                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10456                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10457                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10458                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10459                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10460                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10461                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10462                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10463                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10464                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10465                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10466                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10467                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10468                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10469                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10470                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10471                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10472                 </fields>
10473                 <links>
10474                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10475                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10476                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10477                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10478                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10479                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10480                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10481                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10482                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10483                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10484                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10485                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10486                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10487                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10488                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10489                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10490                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10491                 </links>
10492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10493                         <actions>
10494                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10495                                         <context link="purchase_order" field="ordering_agency"/>
10496                                         <context link="picklist" field="org_unit"/>
10497                                 </retrieve>
10498                         </actions>
10499                 </permacrud>
10500         </class>
10501
10502         <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">
10503                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10504                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10505                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10506                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10507                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10508                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10509                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10510                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10511                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10512                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10513                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10514                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10515                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10516                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10517                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10518                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10519                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10520                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10521                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10522                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10523                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10524                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10525                 </fields>
10526                 <links>
10527                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10528                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10529                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10530                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10531                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10532                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10533                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10534                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10535                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10536                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10537                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10538                 </links>
10539                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10540                         <actions>
10541                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10542                                         <context link="purchase_order" field="ordering_agency"/>
10543                                         <context link="picklist" field="org_unit"/>
10544                                 </retrieve>
10545                         </actions>
10546                 </permacrud>
10547         </class>
10548
10549         <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">
10550                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10551                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10552                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10553                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10554                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10555                 </fields>
10556                 <links>
10557                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10558                 </links>
10559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10560                         <actions>
10561                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10562                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10563                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10564                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10565                         </actions>
10566                 </permacrud>
10567         </class>
10568
10569         <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">
10570                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10571                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10572                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10573                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10574                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10575                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10576                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10577                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10578                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10579                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10580                 </fields>
10581                 <links>
10582                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10583                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10584                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10585                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10586                 </links>
10587         </class>
10588
10589         <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">
10590                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10591                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10592                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10593                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10594                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10595                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10596                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10597                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10598                 </fields>
10599                 <links>
10600                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10601                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10602                 </links>
10603         </class>
10604
10605         <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">
10606                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10607                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10608                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10609                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10610                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10611                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10612                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10613                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10614                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10615                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10616                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10617                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10618                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10619                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10620                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10621                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10622                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10623                 </fields>
10624                 <links>
10625                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10626                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10627                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10628                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10629                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10630                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10631                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10632                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10633                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10634                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10635                 </links>
10636         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10637             <actions>
10638                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10639                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10640                     <context link="lineitem" jump="picklist" field="org_unit"/>
10641                 </retrieve>
10642             </actions>
10643         </permacrud>
10644         </class>
10645
10646         <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">
10647                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10648                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10649                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10650                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10651                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10652                 </fields>
10653                 <links/>
10654                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10655                         <actions>
10656                                 <retrieve />
10657                         </actions>
10658                 </permacrud>
10659         </class>
10660
10661         <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">
10662                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10663                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10664                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10665                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10666                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10667                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10668             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10669                 </fields>
10670                 <links/>
10671         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10672             <actions>
10673                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10674                 <retrieve />
10675                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10676                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10677             </actions>
10678         </permacrud>
10679         </class>
10680
10681         <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">
10682                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10683                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10684                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10685                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10686                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10687                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10688                 </fields>
10689                 <links/>
10690         </class>
10691         <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">
10692                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10693                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10694                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10695                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10696                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10697                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10698                 </fields>
10699                 <links>
10700                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10701                 </links>
10702         </class>
10703
10704         <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">
10705             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10706                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10707                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10708                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10709                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10710                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10711                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10712         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10713
10714             </fields>
10715             <links>
10716                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10717             </links>
10718             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10719                 <actions>
10720                     <create permission="ADMIN_PROVIDER">
10721                         <context link="provider" field="owner"/>
10722                     </create>
10723                     <retrieve permission="ADMIN_PROVIDER">
10724                         <context link="provider" field="owner"/>
10725                     </retrieve>
10726                     <update permission="ADMIN_PROVIDER">
10727                         <context link="provider" field="owner"/>
10728                     </update>
10729                     <delete permission="ADMIN_PROVIDER">
10730                         <context link="provider" field="owner"/>
10731                     </delete>
10732                 </actions>
10733             </permacrud>
10734         </class>
10735         
10736         <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">
10737             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10738                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10739                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10740                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10741                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10742             </fields>
10743             <links>
10744                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10745             </links>
10746             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10747                 <actions>
10748                     <create permission="ADMIN_PROVIDER">
10749                         <context link="provider" field="owner"/>
10750                     </create>
10751                     <retrieve permission="ADMIN_PROVIDER">
10752                         <context link="provider" field="owner"/>
10753                     </retrieve>
10754                     <update permission="ADMIN_PROVIDER">
10755                         <context link="provider" field="owner"/>
10756                     </update>
10757                     <delete permission="ADMIN_PROVIDER">
10758                         <context link="provider" field="owner"/>
10759                     </delete>
10760                 </actions>
10761             </permacrud>
10762         </class>
10763         
10764         <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">
10765             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10766                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10767                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10768                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10769                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10770                 </fields>
10771                 <links/>
10772         </class>
10773
10774         <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">
10775                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10776                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10777                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10778                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10779                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10780                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10781                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10782                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10783                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10784                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10785                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10786                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10787                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10788                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10789                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10790                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10791                 </fields>
10792                 <links>
10793                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10794                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10795                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10796                 </links>
10797         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10798             <actions>
10799                 <create permission="ADMIN_PROVIDER">
10800                     <context link="provider" field="owner"/>
10801                 </create>
10802                 <retrieve permission="ADMIN_PROVIDER">
10803                     <context link="provider" field="owner"/>
10804                 </retrieve>
10805                 <update permission="ADMIN_PROVIDER">
10806                     <context link="provider" field="owner"/>
10807                 </update>
10808                 <delete permission="ADMIN_PROVIDER">
10809                     <context link="provider" field="owner"/>
10810                 </delete>
10811             </actions>
10812         </permacrud>
10813         </class>
10814
10815         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10816                 oils_obj:fieldmapper="acq::edi_attr" 
10817                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10818                 <fields oils_persist:primary="key">
10819                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10820                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10821                 </fields>
10822         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10823             <actions>
10824                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10825                 <retrieve/>
10826                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10827                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10828             </actions>
10829         </permacrud>
10830         </class>
10831         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10832                 oils_obj:fieldmapper="acq::edi_attr_set" 
10833                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10834                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10835                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10836                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10837                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10838                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10839                 </fields>
10840                 <links>
10841                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10842                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10843                 </links>
10844         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10845             <actions>
10846                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10847                 <retrieve/>
10848                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10849                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10850             </actions>
10851         </permacrud>
10852         </class>
10853         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10854                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10855                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10856                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10857                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10858                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10859                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10860                 </fields>
10861                 <links>
10862                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10863                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10864                 </links>
10865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10866             <actions>
10867                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10868                 <retrieve/>
10869                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10870                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10871             </actions>
10872         </permacrud>
10873         </class>
10874
10875
10876         <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">
10877                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10878                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10879                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10880                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10881                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10882                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10883                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10884                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10885                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10886                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10887                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10888                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10889                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10890                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10891                 </fields>
10892                 <links>
10893                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10894                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10895                 </links>
10896         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10897             <actions>
10898                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10899                     <context link="account" jump="provider" field="owner"/>
10900                 </retrieve>
10901                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10902                     <context link="account" jump="provider" field="owner"/>
10903                 </update>
10904                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10905                     <context link="account" jump="provider" field="owner"/>
10906                 </delete>
10907             </actions>
10908         </permacrud>
10909         </class>
10910
10911
10912         <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">
10913                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10914                         <field name="id" reporter:datatype="id" />
10915                         <field name="parent" reporter:datatype="link"/>
10916                         <field name="owner" reporter:datatype="link"/>
10917                         <field name="create_time" reporter:datatype="timestamp"/>
10918                         <field name="name" reporter:datatype="text"/>
10919                         <field name="shared" reporter:datatype="bool"/>
10920                         <field name="share_with" reporter:datatype="link"/>
10921                         <field name="simple_reporter" reporter:datatype="bool"/>
10922                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10923                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10924                 </fields>
10925                 <links>
10926                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10927                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10928                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10929                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10930                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10931                 </links>
10932         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10933             <actions>
10934                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10935                     <context link="owner" field="home_ou"/>
10936                 </create>
10937                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10938                     <context link="owner" field="home_ou"/>
10939                 </retrieve>
10940                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10941                     <context link="owner" field="home_ou"/>
10942                 </update>
10943                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10944                     <context link="owner" field="home_ou"/>
10945                 </delete>
10946             </actions>
10947         </permacrud>
10948         </class>
10949         <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">
10950                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10951                         <field name="id" reporter:datatype="id" />
10952                         <field name="parent" reporter:datatype="link"/>
10953                         <field name="owner" reporter:datatype="link"/>
10954                         <field name="create_time" reporter:datatype="timestamp"/>
10955                         <field name="name" reporter:datatype="text"/>
10956                         <field name="shared" reporter:datatype="bool"/>
10957                         <field name="share_with" reporter:datatype="link"/>
10958                         <field name="simple_reporter" reporter:datatype="bool"/>
10959                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10960                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10961                 </fields>
10962                 <links>
10963                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10964                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10965                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10966                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10967                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10968                 </links>
10969         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10970             <actions>
10971                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10972                     <context link="owner" field="home_ou"/>
10973                 </create>
10974                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10975                     <context link="owner" field="home_ou"/>
10976                 </retrieve>
10977                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10978                     <context link="owner" field="home_ou"/>
10979                 </update>
10980                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10981                     <context link="owner" field="home_ou"/>
10982                 </delete>
10983             </actions>
10984         </permacrud>
10985         </class>
10986         <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">
10987                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10988                         <field name="id" reporter:datatype="id" />
10989                         <field name="parent" reporter:datatype="link"/>
10990                         <field name="owner" reporter:datatype="link"/>
10991                         <field name="create_time" reporter:datatype="timestamp"/>
10992                         <field name="name" reporter:datatype="text"/>
10993                         <field name="shared" reporter:datatype="bool"/>
10994                         <field name="share_with" reporter:datatype="link"/>
10995                         <field name="simple_reporter" reporter:datatype="bool"/>
10996                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10997                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10998                 </fields>
10999                 <links>
11000                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11001                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
11002                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
11003                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11004                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
11005                 </links>
11006         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11007             <actions>
11008                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11009                     <context link="owner" field="home_ou"/>
11010                 </create>
11011                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11012                     <context link="owner" field="home_ou"/>
11013                 </retrieve>
11014                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11015                     <context link="owner" field="home_ou"/>
11016                 </update>
11017                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11018                     <context link="owner" field="home_ou"/>
11019                 </delete>
11020             </actions>
11021         </permacrud>
11022         </class>
11023         <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">
11024                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
11025                         <field name="id" reporter:datatype="id" />
11026                         <field name="owner" reporter:datatype="link"/>
11027                         <field name="create_time" reporter:datatype="timestamp"/>
11028                         <field name="name" reporter:datatype="text"/>
11029                         <field name="data" reporter:datatype="text"/>
11030                         <field name="folder" reporter:datatype="link"/>
11031                         <field name="description" reporter:datatype="text"/>
11032                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11033                 </fields>
11034                 <links>
11035                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11036                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
11037                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
11038                 </links>
11039         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11040             <actions>
11041                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11042                     <context link="owner" field="home_ou"/>
11043                 </create>
11044                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11045                     <context link="owner" field="home_ou"/>
11046                 </retrieve>
11047                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11048                     <context link="owner" field="home_ou"/>
11049                 </update>
11050                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11051                     <context link="owner" field="home_ou"/>
11052                 </delete>
11053             </actions>
11054         </permacrud>
11055         </class>
11056         <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">
11057                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11058                         <field name="id" reporter:datatype="id" />
11059                         <field name="owner" reporter:datatype="link"/>
11060                         <field name="create_time" reporter:datatype="timestamp"/>
11061                         <field name="template" reporter:datatype="link"/>
11062                         <field name="data" reporter:datatype="text"/>
11063                         <field name="folder" reporter:datatype="link"/>
11064                         <field name="recur" reporter:datatype="bool"/>
11065                         <field name="recurrence" reporter:datatype="interval"/>
11066                         <field name="name" reporter:datatype="text"/>
11067                         <field name="description" reporter:datatype="text"/>
11068                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11069                 </fields>
11070                 <links>
11071                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11072                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11073                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11074                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11075                 </links>
11076         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11077             <actions>
11078                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11079                     <context link="owner" field="home_ou"/>
11080                 </create>
11081                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11082                     <context link="owner" field="home_ou"/>
11083                 </retrieve>
11084                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11085                     <context link="owner" field="home_ou"/>
11086                 </update>
11087                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11088                     <context link="owner" field="home_ou"/>
11089                 </delete>
11090             </actions>
11091         </permacrud>
11092         </class>
11093         <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">
11094                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11095                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11096                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11097                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11098                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11099                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11100                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11101                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11102                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11103                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11104                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11105                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11106                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11107                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11108                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11109                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11110                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11111                 </fields>
11112                 <links>
11113                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11114                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11115                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11116                 </links>
11117         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11118             <actions>
11119                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11120                     <context link="runner" field="home_ou"/>
11121                 </create>
11122                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11123                     <context link="runner" field="home_ou"/>
11124                 </retrieve>
11125                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11126                     <context link="runner" field="home_ou"/>
11127                 </update>
11128                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11129                     <context link="runner" field="home_ou"/>
11130                 </delete>
11131             </actions>
11132         </permacrud>
11133         </class>
11134     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11135            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11136            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11137                 <fields oils_persist:primary="run">
11138             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11139             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11140             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11141             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11142             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11143             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11144             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11145             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11146             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11147             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11148             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11149             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11150             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11151             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11152             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11153             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11154                 </fields>
11155                 <links>
11156             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11157             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11158             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11159             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11160             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11161             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11162             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11163             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11164             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11165                 </links>
11166         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11167             <actions>
11168                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11169                     <context link="runner" field="home_ou"/>
11170                 </retrieve>
11171             </actions>
11172         </permacrud>
11173     </class>
11174         <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">
11175                 <fields oils_persist:primary="id">
11176                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11177                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11178                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11179                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11180                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11181                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11182                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11183                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11184                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11185                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11186                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11187                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11188                 </fields>
11189                 <links>
11190                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11191                 </links>
11192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11193                         <actions>
11194                                 <retrieve />
11195                         </actions>
11196                 </permacrud>
11197         </class>
11198         <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">
11199                 <fields oils_persist:primary="id">
11200                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11201                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11202                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11203                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11204                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11205                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11206                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11207                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11208                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11209                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11210                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11211                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11212                 </fields>
11213                 <links>
11214                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11215                 </links>
11216         </class>
11217         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11218                 <fields oils_persist:primary="id">
11219                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11220                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11221                         <field reporter:label="Fingerprint" name="fingerprint" />
11222                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11223                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11224                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11225                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11226                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11227                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11228                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11229                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11230                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11231                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11232                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11233                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11234                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11235                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11236                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11237                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11238                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11239                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11240                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11241                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11242                 </fields>
11243                 <links>
11244                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11245                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11246                 </links>
11247         </class>
11248         <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">
11249                 <fields oils_persist:primary="id">
11250                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11251                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11252                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11253                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11254                 </fields>
11255                 <links>
11256                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11257                 </links>
11258         </class>
11259         <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">
11260                 <fields oils_persist:primary="id">
11261                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11262                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11263                 </fields>
11264                 <links>
11265                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11266                 </links>
11267         </class>
11268         <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">
11269                 <fields oils_persist:primary="id">
11270                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11271                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11272                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11273                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11274                 </fields>
11275                 <links>
11276                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11277                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11278                 </links>
11279                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11280                         <actions>
11281                                 <retrieve permission="VIEW_HOLD">
11282                                         <context link="id" field="pickup_lib"/>
11283                                 </retrieve>
11284                         </actions>
11285                 </permacrud>
11286         </class>
11287         <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">
11288                 <fields oils_persist:primary="xact">
11289                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11290                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11291                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11292                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11293                 </fields>
11294                 <links>
11295                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11296                 </links>
11297         </class>
11298         <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">
11299                 <fields oils_persist:primary="xact">
11300                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11301                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11302                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11303                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11304                 </fields>
11305                 <links>
11306                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11307                 </links>
11308         </class>
11309         <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)">
11310                 <fields oils_persist:primary="id">
11311                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11312                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11313                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11314                 </fields>
11315                 <links>
11316                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11317                 </links>
11318         </class>
11319         <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">
11320                 <fields oils_persist:primary="id">
11321                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11322                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11323                 </fields>
11324                 <links>
11325                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11326                 </links>
11327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11328                         <actions>
11329                                 <retrieve permission="STAFF_LOGIN">
11330                                         <context link="id" field="circ_lib"/>
11331                                 </retrieve>
11332                         </actions>
11333                 </permacrud>
11334         </class>
11335         <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">
11336                 <fields oils_persist:primary="bibid">
11337                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11338                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11339                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11340                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11341                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11342                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11343                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11344                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11345                 </fields>
11346                 <links>
11347                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11348                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11349                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11350                 </links>
11351         </class>
11352         <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">
11353                 <fields oils_persist:primary="copy_id">
11354                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11355                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11356                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11357                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11358                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11359                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11360                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11361                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11362                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11363                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11364                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11365                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11366                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11367                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11368                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11369                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11370                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11371                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11372                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11373                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11374                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11375                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11376                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11377                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11378                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11379                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11380                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11381                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11382                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11383                 </fields>
11384                 <links>
11385                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11386                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11387                 </links>
11388         </class>
11389         <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">
11390                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11391                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11392                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11393                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11394                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11395                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11396                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11397                 </fields>
11398                 <links>
11399                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11400                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11401                 </links>
11402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11403                         <actions>
11404                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11405                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11406                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11407                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11408                         </actions>
11409                 </permacrud>
11410         </class>
11411         <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">
11412                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11413                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11414                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11415                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11416                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11417                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11418                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11419                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11420                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11421                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11422                 </fields>
11423                 <links>
11424                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11425                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11426                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11427                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11428                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11429                 </links>
11430                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11431                         <actions>
11432                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11433                                         <context link="formula" field="owner"/>
11434                                 </create>
11435                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11436                                         <context link="formula" field="owner"/>
11437                                 </retrieve>
11438                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11439                                         <context link="formula" field="owner"/>
11440                                 </update>
11441                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11442                                         <context link="formula" field="owner"/>
11443                                 </delete>
11444                         </actions>
11445                 </permacrud>
11446         </class>
11447
11448         <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">
11449                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11450                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11451                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11452                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11453                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11454                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11455                 </fields>
11456                 <links>
11457                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11458                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11459                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11460                 </links>
11461                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11462                         <actions>
11463                                 <create permission="CREATE_PURCHASE_ORDER">
11464                                         <context link="formula" field="owner"/>
11465                 </create>
11466                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11467                                         <context link="formula" field="owner"/>
11468                 </retrieve>
11469                                 <update permission="CREATE_PURCHASE_ORDER">
11470                                         <context link="formula" field="owner"/>
11471                 </update>
11472                                 <delete permission="CREATE_PURCHASE_ORDER">
11473                                         <context link="formula" field="owner"/>
11474                 </delete>
11475                         </actions>
11476                 </permacrud>
11477         </class>
11478
11479         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11480                 <fields oils_persist:primary="id">
11481                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11482                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11483                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11484                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11485                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11486                 </fields>
11487                 <links>
11488                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11489                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11490                 </links>
11491         </class>
11492
11493         <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">
11494                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11495                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11496                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11497                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11498                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11499                 </fields>
11500                 <links>
11501                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11502                 </links>
11503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11504                         <actions>
11505                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11506                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11507                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11508                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11509                         </actions>
11510                 </permacrud>
11511         </class>
11512
11513         <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">
11514                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11515                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11516                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11517                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11518                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11519                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11520                 </fields>
11521                 <links>
11522                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11523                 </links>
11524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11525                         <actions>
11526                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11527                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11528                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11529                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11530                         </actions>
11531                 </permacrud>
11532         </class>
11533
11534         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11535                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11536                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11537                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11538                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11539                 </fields>
11540                 <links>
11541                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11542                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11543                 </links>
11544         </class>
11545
11546         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11547                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11548                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11549                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11550                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11551                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11552                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11553                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11554                 </fields>
11555                 <links>
11556                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11557                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11558                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11559                 </links>
11560         </class>
11561
11562         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11563                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11564                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11565                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11566                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11567                 </fields>
11568                 <links>
11569                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11570                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11571                 </links>
11572         </class>
11573
11574         <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">
11575                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11576                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11577                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11578                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11579                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11580                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11581                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11582                 </fields>
11583                 <links>
11584                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11585                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11586                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11587                 </links>
11588         </class>
11589
11590         <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">
11591                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11592                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11593                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11594                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11595                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11596                 </fields>
11597                 <links>
11598                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11599                 </links>
11600                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11601             <actions>
11602                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11603                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11604                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11605                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11606             </actions>
11607                 </permacrud>
11608         </class>
11609
11610         <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">
11611                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11612                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11613                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11614                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11615                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11616                 </fields>
11617                 <links>
11618                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11619                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11620                 </links>
11621                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11622                         <actions>
11623                                 <create permission="ADMIN_CLAIM_POLICY">
11624                                         <context link="claim_policy" field="org_unit"/>
11625                 </create>
11626                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11627                                         <context link="claim_policy" field="org_unit"/>
11628                 </retrieve>
11629                                 <update permission="ADMIN_CLAIM_POLICY">
11630                                         <context link="claim_policy" field="org_unit"/>
11631                 </update>
11632                                 <delete permission="ADMIN_CLAIM_POLICY">
11633                                         <context link="claim_policy" field="org_unit"/>
11634                 </delete>
11635                         </actions>
11636                 </permacrud>
11637         </class>
11638
11639     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11640         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11641             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11642             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11643             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11644             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11645             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11646             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11647             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11648             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11649             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11650             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11651             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11652             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11653             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11654             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11655             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11656             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11657                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11658                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11659                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11660         </fields>
11661         <links>
11662             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11663             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11664         </links>
11665     </class>
11666
11667     <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">
11668         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11669             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11670             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11671             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11672             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11673             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11674         </fields>
11675     </class>
11676
11677     <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">
11678         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11679             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11680             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11681             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11682             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11683             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11684             <field reporter:label="City" name="city" reporter:datatype="text"/>
11685             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11686             <field reporter:label="State" name="state" reporter:datatype="text"/>
11687             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11688             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11689             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11690         </fields>
11691     </class>
11692
11693     <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">
11694         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11695             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11696             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11697             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11698             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11699             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11700             <field reporter:label="City" name="city" reporter:datatype="text"/>
11701             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11702             <field reporter:label="State" name="state" reporter:datatype="text"/>
11703             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11704             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11705             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11706         </fields>
11707     </class>
11708
11709     <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">
11710         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11711             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11712             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11713             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11714             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11715             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11716             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11717         </fields>
11718     </class>
11719
11720     <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">
11721         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11722             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11723             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11724             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11725             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11726             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11727             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11728         </fields>
11729     </class>
11730
11731         <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">
11732                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11733                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11734                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11735                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11736                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11737                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11738                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11739                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11740                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11741                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11742                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11743                 </fields>
11744                 <links>
11745                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11746                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11747                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11748                 </links>
11749                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11750                         <actions>
11751                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11752                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11753                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11754                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11755                         </actions>
11756                 </permacrud>
11757         </class>
11758
11759         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11760                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11761                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11762                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11763                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11764                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11765                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11766                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11767                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11768                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11769                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11770                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11771                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11772                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11773                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11774                 </fields>
11775                 <links>
11776                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11777                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11778                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11779                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11780                 </links>
11781                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11782                         <actions>
11783                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11784                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11785                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11786                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11787                         </actions>
11788                 </permacrud>
11789         </class>
11790
11791         <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">
11792                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11793                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11794                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11795                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11796                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11797                 </fields>
11798                 <links>
11799                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11800                 </links>
11801                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11802                         <actions>
11803                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11804                     <context link="fieldset" field="owning_lib"/>
11805                 </create>
11806                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11807                     <context link="fieldset" field="owning_lib"/>
11808                 </retrieve>
11809                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11810                     <context link="fieldset" field="owning_lib"/>
11811                 </update>
11812                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11813                     <context link="fieldset" field="owning_lib"/>
11814                 </delete>
11815                         </actions>
11816                 </permacrud>
11817         </class>
11818
11819     <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">
11820         <fields>
11821             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11822             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11823             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11824         </fields>
11825                 <links>
11826                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11827                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11828                 </links>
11829     </class>
11830
11831     <class id="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">
11832         <fields>
11833             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11834             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11835         </fields>
11836                 <links>
11837                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11838                 </links>
11839     </class>
11840
11841     <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">
11842         <fields>
11843             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11844             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11845             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11846         </fields>
11847                 <links>
11848                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11849                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11850                 </links>
11851     </class>
11852
11853     <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">
11854         <fields>
11855             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11856             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11857         </fields>
11858                 <links>
11859                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11860                 </links>
11861     </class>
11862
11863     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11864                 <oils_persist:source_definition><![CDATA[
11865
11866             SELECT  DISTINCT l.*
11867               FROM  action.unfulfilled_hold_loops l
11868                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11869               WHERE l.count = m.max
11870
11871                 ]]></oils_persist:source_definition>
11872         <fields>
11873             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11874             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11875             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11876         </fields>
11877                 <links>
11878                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11879                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11880                 </links>
11881     </class>
11882
11883         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11884                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11885                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11886                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11887                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11888                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11889                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11890                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11891                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11892                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11893                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11894                 </fields>
11895                 <links>
11896                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11897                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11898                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11899                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11900                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11901                 </links>
11902         </class>
11903
11904         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11905                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11906                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11907                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11908                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11909                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11910                 </fields>
11911                 <links>
11912                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11913                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11914                 </links>
11915         </class>
11916
11917         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11918                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11919                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11920                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11921                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11922                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11923                 </fields>
11924                 <links>
11925                 </links>
11926         </class>
11927
11928         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11929                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11930                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11931                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11932                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11933                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11934                 </fields>
11935                 <links>
11936                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11937                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11938                 </links>
11939         </class>
11940         
11941         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11942                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11943                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11944                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11945                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11946                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11947                 </fields>
11948                 <links>
11949                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11950                 </links>
11951         </class>
11952         
11953         <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">
11954                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11955                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11956                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11957                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11958                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11959                 </fields>
11960                 <links>
11961                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11962                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11963                 </links>
11964         </class>
11965
11966         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11967                 <fields oils_persist:primary="name">
11968                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11969                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11970                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11971                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11972                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11973                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11974                 </fields>
11975                 <links>
11976                 </links>
11977         </class>
11978
11979         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11980                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11981                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11982                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11983                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11984                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11985                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11986                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11987                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11988                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11989                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11990                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11991                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11992                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11993                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11994                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11995                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11996                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11997                 </fields>
11998                 <links>
11999                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12000                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12001                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12002                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12003                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12004                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12005                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12006                 </links>
12007         </class>
12008
12009         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
12010                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
12011                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
12012                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12013                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12014                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
12015                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
12016                 </fields>
12017                 <links>
12018                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12019                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
12020                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
12021                 </links>
12022         </class>
12023
12024         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
12025                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
12026                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
12027                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
12028                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
12029                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
12030                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
12031                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
12032                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12033                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
12034                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12035                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
12036                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
12037                 </fields>
12038                 <links>
12039                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12040                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
12041                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
12042                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
12043                 </links>
12044         </class>
12045
12046         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12047                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12048                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12049                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
12050                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12051                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12052                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
12053                 </fields>
12054                 <links>
12055                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12056                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12057                 </links>
12058         </class>
12059
12060         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12061                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12062                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12063                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12064                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12065                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12066                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12067                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12068                 </fields>
12069                 <links>
12070                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12071                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12072                 </links>
12073         </class>
12074
12075         <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">
12076                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12077                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12078                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12079                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12080                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12081                 </fields>
12082                 <links>
12083                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12084                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12085                 </links>
12086         </class>
12087
12088         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12089                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12090                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12091                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12092                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12093                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12094                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12095                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12096                 </fields>
12097                 <links>
12098                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12099                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12100                 </links>
12101         </class>
12102
12103         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12104                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12105                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12106                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12107                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12108                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12109                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12110                 </fields>
12111                 <links>
12112                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12113                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12114                 </links>
12115         </class>
12116
12117         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12118                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12119                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12120                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12121                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12122                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12123                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12124                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12125                 </fields>
12126                 <links>
12127                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12128                 </links>
12129         </class>
12130
12131         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12132                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12133                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12134                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12135                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12136                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12137                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12138                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12139                 </fields>
12140                 <links>
12141                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12142                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12143                 </links>
12144         </class>
12145
12146         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12147                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12148                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12149                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12150                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12151                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12152                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12153                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12154                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12155                 </fields>
12156                 <links>
12157                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12158                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12159                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12160                 </links>
12161         </class>
12162
12163         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12164                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12165                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12166                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12167                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12168                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12169                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12170                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12171                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12172                 </fields>
12173                 <links>
12174                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12175                 </links>
12176         </class>
12177
12178         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12179                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12180                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12181                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12182                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12183                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12184                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12185                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12186                 </fields>
12187                 <links>
12188                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12189                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12190                 </links>
12191         </class>
12192
12193         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12194                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12195                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12196                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12197                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12198                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12199                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12200                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12201                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12202                 </fields>
12203                 <links>
12204                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12205                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12206                 </links>
12207         </class>
12208
12209         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12210                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12211                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12212                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12213                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12214                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12215                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12216                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12217                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12218                 </fields>
12219                 <links>
12220                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12221                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12222                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12223                 </links>
12224         </class>
12225
12226         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12227                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12228                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12229                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12230                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12231                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12232                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12233                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12234                 </fields>
12235                 <links>
12236                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12237                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12238                 </links>
12239         </class>
12240
12241         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12242                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12243                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12244                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12245                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12246                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12247                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12248                 </fields>
12249                 <links>
12250                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12251                 </links>
12252         </class>
12253
12254         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12255                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12256                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12257                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12258                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12259                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12260                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12261                 </fields>
12262                 <links>
12263                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12264                 </links>
12265         </class>
12266
12267         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12268                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12269                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12270                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12271                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12272                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12273                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12274                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12275                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12276                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12277                 </fields>
12278                 <links>
12279                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12280                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12281                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12282                 </links>
12283         </class>
12284
12285         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12286                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12287                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12288                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12289                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12290                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12291                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12292                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12293                 </fields>
12294                 <links>
12295                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12296                 </links>
12297         </class>
12298
12299         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12300                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12301                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12302                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12303                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12304                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12305                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12306                 </fields>
12307                 <links>
12308                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12309                 </links>
12310         </class>
12311
12312         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12313                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12314                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12315                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12316                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12317                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12318                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12319                 </fields>
12320                 <links>
12321                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12322                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12323                 </links>
12324         </class>
12325
12326         <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">
12327                 <fields oils_persist:primary="id">
12328                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12329                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12330                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12331                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12332                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12333                 </fields>
12334                 <links>
12335                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12336                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12337                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12338                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12339                 </links>
12340         </class>
12341
12342         <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">
12343                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12344                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12345                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12346                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12347                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12348                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12349                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12350                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12351                 </fields>
12352                 <links/>
12353                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12354                         <actions>
12355                                 <retrieve/>
12356                         </actions>
12357                 </permacrud>
12358         </class>
12359
12360         <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">
12361                 <fields oils_persist:primary="ptype_key">
12362                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12363                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12364                 </fields>
12365                 <links/>
12366                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12367                         <actions>
12368                                 <retrieve/>
12369                         </actions>
12370                 </permacrud>
12371         </class>
12372
12373         <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">
12374                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12375                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12376                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12377                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12378                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12379                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12380                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12381                 </fields>
12382                 <links>
12383                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12384                 </links>
12385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12386                         <actions>
12387                                 <retrieve/>
12388                         </actions>
12389                 </permacrud>
12390         </class>
12391
12392         <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">
12393                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12394                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12395                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12396                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12397                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12398                 </fields>
12399                 <links>
12400                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12401                 </links>
12402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12403                         <actions>
12404                                 <retrieve/>
12405                         </actions>
12406                 </permacrud>
12407         </class>
12408
12409     <class
12410         id="uvs"
12411         controller="open-ils.cstore open-ils.pcrud"
12412         oils_obj:fieldmapper="url_verify::session"
12413         oils_persist:tablename="url_verify.session"
12414         reporter:label="URL Verification Session"
12415     >
12416         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12417             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12418             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12419                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12420             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12421             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12422             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12423             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12424             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12425             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12426         </fields>
12427
12428         <links>
12429             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12430             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12431             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12432             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12433             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12434         </links>
12435
12436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12437             <actions>
12438                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12439             </actions>
12440         </permacrud>
12441
12442     </class>
12443
12444     <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">
12445         <oils_persist:source_definition><![CDATA[
12446             SELECT
12447                 cbrebi.id AS id,  -- so we can have a pkey in our view
12448                 uvs.id AS session,
12449                 uvs.owning_lib,
12450                 cbrebi.target_biblio_record_entry
12451             FROM url_verify.session uvs
12452             JOIN container.biblio_record_entry_bucket cbreb
12453                 ON (uvs.container = cbreb.id)
12454             JOIN container.biblio_record_entry_bucket_item cbrebi
12455                 ON (cbrebi.bucket = cbreb.id)
12456         ]]></oils_persist:source_definition>
12457         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12458             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12459             <field reporter:label="Session" name="session" reporter:datatype="link" />
12460             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12461             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12462         </fields>
12463         <links>
12464             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12465             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12466             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12467         </links>
12468         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12469             <actions>
12470                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12471             </actions>
12472         </permacrud>
12473     </class>
12474
12475     <class
12476         id="uvus"
12477         controller="open-ils.cstore open-ils.pcrud"
12478         oils_obj:fieldmapper="url_verify::url_selector"
12479         oils_persist:tablename="url_verify.url_selector"
12480         reporter:label="URL Verification URL Selector"
12481     >
12482         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12483             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12484             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12485                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12486             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12487         </fields>
12488
12489         <links>
12490             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12491             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12492         </links>
12493
12494         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12495             <actions>
12496                 <create permission="URL_VERIFY">
12497                     <context link="session" field="owning_lib"/>
12498                 </create>
12499                 <retrieve permission="URL_VERIFY">
12500                     <context link="session" field="owning_lib"/>
12501                 </retrieve>
12502                 <update permission="URL_VERIFY">
12503                     <context link="session" field="owning_lib"/>
12504                 </update>
12505                 <delete permission="URL_VERIFY">
12506                     <context link="session" field="owning_lib"/>
12507                 </delete>
12508             </actions>
12509         </permacrud>
12510
12511     </class>
12512
12513     <class
12514         id="uvu"
12515         controller="open-ils.cstore open-ils.pcrud"
12516         oils_obj:fieldmapper="url_verify::url"
12517         oils_persist:tablename="url_verify.url"
12518         reporter:label="URL Verification URL"
12519     >
12520         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12521             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12522                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12523                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12524                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12525                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12526             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12527             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12528             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12529             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12530             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12531             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12532             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12533             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12534             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12535             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12536             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12537             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12538             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12539         </fields>
12540
12541         <links>
12542             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12543             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12544             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12545             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12546             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12547         </links>
12548
12549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12550             <actions>
12551                 <create permission="URL_VERIFY">
12552                     <context link="session" field="owning_lib"/>
12553                 </create>
12554                 <retrieve permission="URL_VERIFY">
12555                     <context link="session" field="owning_lib"/>
12556                 </retrieve>
12557                 <update permission="URL_VERIFY">
12558                     <context link="session" field="owning_lib"/>
12559                 </update>
12560                 <delete permission="URL_VERIFY">
12561                     <context link="session" field="owning_lib"/>
12562                 </delete>
12563             </actions>
12564         </permacrud>
12565
12566     </class>
12567
12568     <class
12569         id="uvva"
12570         controller="open-ils.cstore open-ils.pcrud"
12571         oils_obj:fieldmapper="url_verify::verification_attempt"
12572         oils_persist:tablename="url_verify.verification_attempt"
12573         reporter:label="URL Verification Attempt"
12574     >
12575         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12576             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12577                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12578                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12579             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12580             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12581         </fields>
12582
12583         <links>
12584             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12585             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12586         </links>
12587
12588         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12589             <actions>
12590                 <create permission="URL_VERIFY">
12591                     <context link="session" field="owning_lib"/>
12592                 </create>
12593                 <retrieve permission="URL_VERIFY">
12594                     <context link="session" field="owning_lib"/>
12595                 </retrieve>
12596                 <update permission="URL_VERIFY">
12597                     <context link="session" field="owning_lib"/>
12598                 </update>
12599                 <delete permission="URL_VERIFY">
12600                     <context link="session" field="owning_lib"/>
12601                 </delete>
12602             </actions>
12603         </permacrud>
12604
12605     </class>
12606
12607     <class
12608         id="uvuv"
12609         controller="open-ils.cstore open-ils.pcrud"
12610         oils_obj:fieldmapper="url_verify::url_verification"
12611         oils_persist:tablename="url_verify.url_verification"
12612         reporter:label="URL Verification"
12613     >
12614         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12615             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12616                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12617                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12618             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12619             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12620             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12621             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12622                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12623         </fields>
12624
12625         <links>
12626             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12627             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12628             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12629         </links>
12630
12631         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12632             <actions>
12633                 <create permission="URL_VERIFY">
12634                     <context link="attempt" jump="session" field="owning_lib"/>
12635                 </create>
12636                 <retrieve permission="URL_VERIFY">
12637                     <context link="attempt" jump="session" field="owning_lib"/>
12638                 </retrieve>
12639                 <update permission="URL_VERIFY">
12640                     <context link="attempt" jump="session" field="owning_lib"/>
12641                 </update>
12642                 <delete permission="URL_VERIFY">
12643                     <context link="attempt" jump="session" field="owning_lib"/>
12644                 </delete>
12645             </actions>
12646         </permacrud>
12647
12648     </class>
12649
12650         <class
12651                 id="cfdi"
12652                 controller="open-ils.cstore open-ils.pcrud"
12653                 oils_obj:fieldmapper="config::filter_dialog_interface"
12654                 oils_persist:tablename="config.filter_dialog_interface"
12655                 reporter:label="FilterDialog Interface">
12656                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12657                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12658                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12659                 </fields>
12660                 <links>
12661                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
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
12671                 id="cfdfs"
12672                 controller="open-ils.cstore open-ils.pcrud"
12673                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12674                 oils_persist:tablename="config.filter_dialog_filter_set"
12675                 reporter:label="FilterDialog Filter Set">
12676                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12677                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12678                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12679                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12680                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12681                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12682                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12683                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12684                 </fields>
12685                 <links>
12686                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12687                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12688                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12689                 </links>
12690                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12691                         <actions>
12692                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12693                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12694                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12695                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12696                         </actions>
12697                 </permacrud>
12698
12699         </class>
12700
12701         <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">
12702                 <fields oils_persist:primary="code">
12703                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12704                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12705                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12706                 </fields>
12707                 <links/>
12708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12709                         <actions>
12710                                 <retrieve/>
12711                         </actions>
12712                 </permacrud>
12713         </class>
12714
12715         <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">
12716                 <oils_persist:source_definition><![CDATA[
12717
12718             SELECT  b.id,
12719                     MAX(dcp.edit_date) AS last_delete_date
12720              FROM   biblio.record_entry b
12721                     JOIN asset.call_number cn ON (cn.record = b.id)
12722                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12723              WHERE  NOT b.deleted
12724              GROUP BY b.id
12725              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12726
12727                 ]]></oils_persist:source_definition>
12728                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12729                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12730                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12731                 </fields>
12732                 <links>
12733                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12734                 </links>
12735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12736                         <actions>
12737                                 <retrieve/>
12738                         </actions>
12739                 </permacrud>
12740         </class>
12741
12742         <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">
12743                 <fields oils_persist:primary="id">
12744                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12745                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12746                 </fields>
12747                 <links/>
12748                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12749                         <actions>
12750                                 <retrieve/>
12751                         </actions>
12752                 </permacrud>
12753         </class>
12754
12755         <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">
12756                 <fields oils_persist:primary="id">
12757                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12758                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12759                 </fields>
12760                 <links/>
12761                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12762                         <actions>
12763                                 <retrieve/>
12764                         </actions>
12765                 </permacrud>
12766         </class>
12767
12768
12769         <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">
12770                 <oils_persist:source_definition><![CDATA[
12771                 SELECT
12772                     x.id,
12773                     COALESCE( y.copy_count, 0 ) AS copy_count,
12774                     x.hold_count AS hold_count,
12775                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12776                 FROM
12777                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12778                         FROM
12779                             action.hold_request ahr
12780                             JOIN reporter.hold_request_record rhrr USING (id)
12781                         WHERE
12782                             ahr.cancel_time IS NULL
12783                             AND ahr.fulfillment_time IS NULL
12784                         GROUP BY bib_record
12785                     )x
12786                     JOIN
12787                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12788                         FROM
12789                             action.hold_request ahr
12790                             JOIN reporter.hold_request_record rhrr USING (id)
12791                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12792                         WHERE
12793                             ahr.cancel_time IS NULL
12794                             AND ahr.fulfillment_time IS NULL
12795                             AND ahr.capture_time IS NULL
12796                             AND ahr.frozen IS FALSE
12797                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12798                             AND ahr.hold_type != 'M'
12799                            GROUP BY bib_record
12800                     )y
12801                     USING (id)
12802                 ]]></oils_persist:source_definition>
12803                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12804                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12805                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12806                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12807                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12808                 </fields>
12809                 <links>
12810                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12811                 </links>
12812                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12813                         <actions>
12814                                 <retrieve/>
12815                         </actions>
12816                 </permacrud>
12817         </class>
12818
12819         <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">
12820                 <oils_persist:source_definition><![CDATA[
12821             SELECT *,
12822                 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,
12823                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12824             FROM
12825                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12826                     FROM
12827                         action.hold_request ahr
12828                         JOIN reporter.hold_request_record rhrr USING (id)
12829                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12830                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12831                     WHERE
12832                         ahr.cancel_time IS NULL
12833                         AND ahr.fulfillment_time IS NULL
12834                     GROUP BY bib_record, pickup_lib
12835                 )x
12836                 JOIN
12837                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12838                     FROM
12839                         action.hold_request ahr
12840                         JOIN reporter.hold_request_record rhrr USING (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 ahr.pickup_lib = 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, pickup_lib
12851                 )y
12852                 USING(id,pickup_lib)
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="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12884                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12885                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_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 Pickup Library" name="pickup_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="pickup_lib" 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="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">
12903                 <oils_persist:source_definition><![CDATA[
12904             SELECT *,
12905                 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,
12906                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12907             FROM
12908                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12909                     FROM
12910                         action.hold_request ahr
12911                         JOIN actor.usr au ON (ahr.usr = au.id)
12912                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12913                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12914                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12915                     WHERE
12916                         ahr.cancel_time IS NULL
12917                         AND ahr.fulfillment_time IS NULL
12918                     GROUP BY bib_record, home_ou
12919                 )x
12920                 JOIN
12921                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12922                     FROM
12923                         action.hold_request ahr
12924                         JOIN actor.usr au ON (ahr.usr = au.id)
12925                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12926                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12927                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12928                     WHERE
12929                         ahr.cancel_time IS NULL
12930                         AND ahr.fulfillment_time IS NULL
12931                         AND ahr.capture_time IS NULL
12932                         AND ahr.frozen IS FALSE
12933                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12934                         AND ahr.hold_type != 'M'
12935                     GROUP BY bib_record, home_ou
12936                 )y
12937                 USING (id,home_ou)
12938                 JOIN
12939                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12940                     FROM
12941                         action.hold_request ahr
12942                         JOIN reporter.hold_request_record rhrr USING (id)
12943                     WHERE
12944                         ahr.cancel_time IS NULL
12945                         AND ahr.fulfillment_time IS NULL
12946                     GROUP BY bib_record
12947                 )z
12948                 USING (id)
12949                 JOIN
12950                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12951                     FROM
12952                         action.hold_request ahr
12953                         JOIN reporter.hold_request_record rhrr USING (id)
12954                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12955                     WHERE
12956                         ahr.cancel_time IS NULL
12957                         AND ahr.fulfillment_time IS NULL
12958                         AND ahr.capture_time IS NULL
12959                         AND ahr.frozen IS FALSE
12960                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12961                         AND ahr.hold_type != 'M'
12962                     GROUP BY bib_record
12963                 )u
12964                 USING (id)
12965         ]]></oils_persist:source_definition>
12966         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12967                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12968                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12969                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12970                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12971                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12972                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12973                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12974                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12975         </fields>
12976         <links>
12977                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12978                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12979         </links>
12980         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12981                 <actions>
12982                         <retrieve/>
12983                 </actions>
12984         </permacrud>
12985 </class>
12986
12987         <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) ">
12988                 <oils_persist:source_definition><![CDATA[
12989                 WITH counts_at_ou AS (
12990                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12991                 FROM
12992                     (SELECT rhrr.bib_record AS id,
12993                             aou.id AS pickup_lib_or_desc,
12994                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12995                        FROM actor.org_unit aou
12996                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12997                             action.hold_request ahr
12998                             JOIN reporter.hold_request_record rhrr USING (id)
12999                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13000                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13001                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
13002                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13003                             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
13004                       GROUP BY 1, 2
13005                 ) a
13006                 JOIN
13007                     (SELECT rhrr.bib_record AS id,
13008                             aou.id AS pickup_lib_or_desc,
13009                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
13010                        FROM actor.org_unit aou
13011                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13012                             action.hold_request ahr
13013                             JOIN reporter.hold_request_record rhrr USING (id)
13014                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13015                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13016                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
13017                             -- Comment out the next line to count copies included from other bibs by metarecord holds
13018                             AND ahr.hold_type != 'M'
13019                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13020                             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
13021                       GROUP BY 1, 2
13022                 ) b
13023                 USING (id,pickup_lib_or_desc)
13024             )
13025             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13026                    y.holds_everywhere, z.copy_count_everywhere,
13027                 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,
13028                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13029             FROM counts_at_ou x
13030                 JOIN
13031                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13032                     FROM
13033                         action.hold_request ahr
13034                         JOIN reporter.hold_request_record rhrr USING (id)
13035                     WHERE
13036                         ahr.cancel_time IS NULL
13037                         AND ahr.fulfillment_time IS NULL
13038                     GROUP BY bib_record
13039                 )y
13040                 USING (id)
13041                 JOIN
13042                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13043                     FROM
13044                         action.hold_request ahr
13045                         JOIN reporter.hold_request_record rhrr USING (id)
13046                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13047                     WHERE
13048                         ahr.cancel_time IS NULL
13049                         AND ahr.fulfillment_time IS NULL
13050                         AND ahr.capture_time IS NULL
13051                         AND ahr.frozen IS FALSE
13052                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13053                         AND ahr.hold_type != 'M'
13054                         GROUP BY bib_record
13055                 )z
13056                 USING (id)
13057                 ]]></oils_persist:source_definition>
13058                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13059                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13060                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13061                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13062                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13063                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13064                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13065                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13066                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13067                 </fields>
13068                 <links>
13069                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13070                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13071                 </links>
13072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13073                         <actions>
13074                                 <retrieve/>
13075                         </actions>
13076                 </permacrud>
13077         </class>
13078
13079         <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">
13080                 <oils_persist:source_definition><![CDATA[
13081             SELECT
13082                 ac.id,
13083                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13084                 MAX(actac.xact_start) AS last_circ
13085             FROM asset.copy ac
13086                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13087             GROUP BY ac.id
13088
13089             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13090             --SELECT
13091             --    ac.id,
13092             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13093             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13094             --FROM asset.copy ac
13095             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13096             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13097             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13098                 ]]></oils_persist:source_definition>
13099                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13100                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13101                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13102                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13103                 </fields>
13104                 <links>
13105                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13106                 </links>
13107                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13108                         <actions>
13109                                 <retrieve/>
13110                         </actions>
13111                 </permacrud>
13112         </class>
13113
13114         <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">
13115                 <fields oils_persist:primary="id">
13116                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13117                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13118                 </fields>
13119                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13120                         <actions>
13121                                 <retrieve/>
13122                         </actions>
13123                 </permacrud>
13124         </class>
13125
13126         <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">
13127                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13128                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13129                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13130                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13131                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13132                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13133                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13134                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13135                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13136                 </fields>
13137                 <links>
13138                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13139                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13140                 </links>
13141                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13142                         <actions>
13143                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13144                                 <retrieve/>
13145                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13146                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13147                         </actions>
13148                 </permacrud>
13149         </class>
13150
13151         <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">
13152                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13153                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13154                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13155                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13156                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13157                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13158                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13159                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13160                 </fields>
13161                 <links>
13162                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13163                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13164                 </links>
13165                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13166                         <actions>
13167                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13168                                 <retrieve/>
13169                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13170                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13171                         </actions>
13172                 </permacrud>
13173         </class>
13174
13175
13176         <!-- ********************************************************************************************************************* -->
13177         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13178         <!-- ********************************************************************************************************************* -->
13179         <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">
13180                 <fields oils_persist:primary="id">
13181                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13182                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13183                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13184                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13185                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13186                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13187                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13188                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13189                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13190                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13191                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13192                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13193                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13194                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13195                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13196                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13197                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13198                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13199                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13200                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13201                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13202                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13203                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13204                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13205                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13206                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13207                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13208                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13209                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13210                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13211                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13212                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13213                 </fields>
13214                 <links>
13215                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13216                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13217                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13218                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13219                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13220                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13221                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13222                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13223                 </links>
13224         </class>
13225
13226         <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">
13227                 <fields oils_persist:primary="id">
13228                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13229                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13230                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13231                 </fields>
13232                 <links>
13233                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13234                 </links>
13235         </class>
13236
13237         <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">
13238                 <fields oils_persist:primary="id">
13239                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13240                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13241                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13242                 </fields>
13243                 <links>
13244                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13245                 </links>
13246         </class>
13247
13248         <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">
13249                 <fields oils_persist:primary="id">
13250                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13251
13252                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13253                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13254                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13255
13256                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13257                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13258                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13259
13260                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13261                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13262
13263                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13264                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13265                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13266
13267                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13268                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13269
13270                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13271                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13272                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13273
13274                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13275                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13276                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13277
13278                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13279                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13280                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13281                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13282
13283                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13284                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13285
13286                 </fields>
13287                 <links>
13288                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13289                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13290                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13291                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13292                 </links>
13293         </class>
13294
13295         <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">
13296                 <oils_persist:source_definition><![CDATA[
13297
13298             SELECT
13299                 po.ordering_agency AS ordering_agency,
13300                 po.id AS purchase_order,
13301                 li.id AS lineitem,
13302                 lid.id AS lineitem_detail,
13303                 cpa.id AS claim_policy_action
13304             FROM
13305                 acq.lineitem_detail lid
13306                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13307                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13308                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13309                 JOIN acq.claim_policy_action cpa ON (
13310                     cpa.claim_policy = cp.id
13311
13312                     -- we only care about claim policy actions whose claim
13313                     -- interval we'd reached or exceeded
13314                     AND (NOW() - cpa.action_interval) > po.order_date
13315
13316                     -- filter out all claim policy actions where claim events
13317                     -- have occurred on or after the action's action_interval
13318                     AND NOT EXISTS (
13319                         SELECT 1
13320                         FROM
13321                             acq.claim_event evt
13322                             JOIN acq.claim claim ON (
13323                                 claim.id = evt.claim
13324                                 AND claim.lineitem_detail = lid.id
13325                             )
13326                         WHERE
13327                             evt.event_date >= (po.order_date + cpa.action_interval)
13328                     )
13329                 )
13330             WHERE
13331                 lid.cancel_reason IS NULL
13332                 AND li.cancel_reason IS NULL -- belt/suspenders
13333                 AND po.cancel_reason IS NULL -- belt/suspenders
13334                 AND lid.recv_time IS NULL
13335                 AND po.state = 'on-order'
13336             ORDER BY 1, 2, 3, 4, 5
13337
13338                 ]]></oils_persist:source_definition>
13339                 <fields>
13340                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13341                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13342                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13343                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13344                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13345                 </fields>
13346                 <links>
13347                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13348                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13349                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13350                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13351                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13352                 </links>
13353         </class>
13354         <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">
13355                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13356                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13357                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13358                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13359                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13360                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13361                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13362                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13363                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13364                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13365                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13366                 </fields>
13367                 <links>
13368                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13369                 </links>
13370     </class>
13371         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13372                 <oils_persist:source_definition><![CDATA[
13373             SELECT * FROM acq.lineitem_summary 
13374                                 WHERE item_count > (invoice_count + cancel_count)
13375         ]]></oils_persist:source_definition>
13376                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13377                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13378                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13379                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13380                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13381                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13382                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13383                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13384                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13385                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13386                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13387                 </fields>
13388                 <links>
13389                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13390                 </links>
13391     </class>
13392         <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">
13393                 <oils_persist:source_definition><![CDATA[
13394
13395                         SELECT  t.*
13396                           FROM  action.transit_copy t
13397                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13398                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13399                           WHERE s.parent_ou <> d.parent_ou
13400
13401                 ]]></oils_persist:source_definition>
13402                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13403                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13404                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13405                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13406                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13407                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13408                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13409                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13410                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13411                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13412                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13413                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13414                 </fields>
13415                 <links>
13416                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13417                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13418                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13419                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13420                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13421                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13422                 </links>
13423         </class>
13424
13425     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13426                 <oils_persist:source_definition><![CDATA[
13427
13428         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13429                 SELECT
13430                         cp.id as copy,
13431                         COUNT(circ.id),
13432                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13433                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13434                 FROM
13435                         asset.copy cp
13436                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13437                 GROUP BY 1, 3, 4
13438                 UNION ALL
13439                 SELECT
13440                         cp.id as copy,
13441                         COUNT(circ.id),
13442                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13443                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13444                 FROM
13445                         asset.copy cp
13446                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13447                 GROUP BY 1, 3, 4
13448                 UNION ALL
13449                 SELECT
13450                         id as copy,
13451                         circ_count,
13452                         -1 AS year,
13453                         false as is_renewal
13454                 FROM
13455                         extend_reporter.legacy_circ_count
13456         )x GROUP BY 1, 3, 4
13457
13458                 ]]></oils_persist:source_definition>
13459         <fields>
13460             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13461             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13462             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13463             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13464         </fields>
13465                 <links>
13466                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13467                 </links>
13468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13469                         <actions>
13470                                 <retrieve/>
13471                         </actions>
13472                 </permacrud>
13473     </class>
13474
13475         <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">
13476                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13477                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13478                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13479                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13480                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13481                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13482                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13483                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13484                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13485                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13486                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13487                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13488                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13489                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13490                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13491                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13492                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13493                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13494                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13495                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13496                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13497                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13498                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13499                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13500                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13501                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13502                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13503                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13504                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13505                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13506                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13507                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13508                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13509                 </fields>
13510                 <links>
13511                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13512                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13513                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13514                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13515                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13516                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13517                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13518                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13519                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13520                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13521                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13522                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13523                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13524                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13525                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13526                 </links>
13527         </class>
13528
13529     <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">
13530         <fields oils_persist:primary="id">
13531             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13532             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13533             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13534             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13535             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13536             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13537             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13538             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13539             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13540             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13541             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13542             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13543             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13544             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13545             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13546             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13547             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13548             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13549             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13550             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13551             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13552             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13553             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13554             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13555             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13556             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13557             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13558             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13559             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13560             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13561             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13562             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13563             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13564             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13565         </fields>
13566         <links>
13567             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13568             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13569             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13570             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13571             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13572             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13573             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13574             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13575         </links>
13576     </class>
13577
13578     <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">
13579         <fields oils_persist:primary="id">
13580             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13581             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13582             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13583             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13584         </fields>
13585         <links>
13586             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13587             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13588         </links>
13589     </class>
13590
13591     <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">
13592         <fields oils_persist:primary="owning_lib">
13593             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13594             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13595             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13596         </fields>
13597         <links>
13598             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13599         </links>
13600     </class>
13601
13602     <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">
13603         <fields oils_persist:primary="id">
13604             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13605             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13606             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13607             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13608             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13609         </fields>
13610         <links>
13611             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13612             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13613             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13614         </links>
13615     </class>
13616
13617     <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">
13618         <fields oils_persist:primary="circ_lib">
13619             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13620             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13621             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13622             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13623         </fields>
13624         <links>
13625             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13626             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13627         </links>
13628     </class>
13629
13630     <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">
13631         <fields oils_persist:primary="id">
13632             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13633             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13634             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13635             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13636             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13637         </fields>
13638         <links>
13639             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13640             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13641             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13642         </links>
13643     </class>
13644
13645     <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">
13646         <fields oils_persist:primary="home_ou">
13647             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13648             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13649             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13650             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13651         </fields>
13652         <links>
13653             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13654             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13655         </links>
13656     </class>
13657         <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">
13658                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13659                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13660                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13661                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13662                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13663                 </fields>
13664                 <links>
13665                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13666                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13667                 </links>
13668                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13669                         <actions>
13670                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13671                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13672                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13673                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13674                         </actions>
13675                 </permacrud>
13676         </class>
13677         <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">
13678                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13679                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13680                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13681                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13682                 </fields>
13683                 <links>
13684                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13685                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13686                         </links>
13687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13688                 <actions>
13689                                 <create permission="ADMIN_ACQ_FUND_TAG">
13690                                         <context link="tag" field="owner"/>
13691                                 </create>
13692                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13693                                         <context link="tag" field="owner"/>
13694                                 </retrieve>
13695                                 <update permission="ADMIN_ACQ_FUND_TAG">
13696                                         <context link="tag" field="owner"/>
13697                                 </update>
13698                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13699                                         <context link="tag" field="owner"/>
13700                                 </delete>
13701                         </actions>
13702                 </permacrud>
13703         </class>
13704         <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">
13705                 <oils_persist:source_definition><![CDATA[
13706                 SELECT
13707                         poi.purchase_order AS purchase_order,
13708                         ii.invoice AS invoice,
13709                         NULL AS lineitem,
13710                         poi.id AS po_item,
13711                         NULL AS picklist
13712                 FROM
13713                         acq.po_item poi
13714                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13715                 UNION SELECT
13716                         jub.purchase_order AS purchase_order,
13717                         ie.invoice AS invoice,
13718                         jub.id AS lineitem,
13719                         NULL AS po_item,
13720                         jub.picklist AS picklist
13721                 FROM
13722                         acq.lineitem jub
13723                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13724                 UNION SELECT
13725                         ii.purchase_order AS purchase_order,
13726                         ii.invoice AS invoice,
13727                         NULL AS lineitem,
13728                         NULL AS po_item,
13729                         NULL AS picklist
13730                 FROM
13731                         acq.invoice_item ii
13732                 WHERE ii.po_item IS NULL
13733                 UNION SELECT
13734                         ie.purchase_order AS purchase_order,
13735                         ie.invoice AS invoice,
13736                         NULL AS lineitem,
13737                         NULL AS po_item,
13738                         NULL AS picklist
13739                 FROM
13740                         acq.invoice_entry ie
13741                 WHERE ie.lineitem IS NULL
13742                 UNION SELECT
13743                         NULL AS purchase_order,
13744                         NULL AS invoice,
13745                         jub.id AS lineitem,
13746                         NULL AS po_item,
13747                         jub.picklist AS picklist
13748                 FROM
13749                         acq.lineitem jub
13750                 WHERE jub.purchase_order IS NULL
13751                 ]]></oils_persist:source_definition>
13752                 <fields>
13753                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13754                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13755                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13756                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13757                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13758                 </fields>
13759                 <links>
13760                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13761                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13762                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13763                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13764                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13765                 </links>
13766         </class>
13767         <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">
13768                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13769                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13770                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13771                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13772                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13773                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13774                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13775                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13776                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13777                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13778                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13779                 </fields>
13780                 <links>
13781                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13782                 </links>
13783                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13784                         <actions>
13785                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13786                                 <retrieve/>
13787                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13788                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13789                         </actions>
13790                 </permacrud>
13791         </class>
13792
13793         <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">
13794                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13795                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13796                         <field name="date_applied" reporter:datatype="timestamp"/>
13797                         <field name="org" reporter:datatype="org_unit"/>
13798                         <field name="original_value" reporter:datatype="text"/>
13799                         <field name="new_value" reporter:datatype="text"/>
13800                         <field name="field_name" reporter:datatype="link"/>
13801                 </fields>
13802                 <links>
13803                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13804                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13805                 </links>
13806         </class>
13807         <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">
13808                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13809                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13810                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13811                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13812                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13813                 </fields>
13814                 <links>
13815                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13816                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13817                 </links>
13818         </class>
13819         <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">
13820                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13821                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13822                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13823                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13824                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13825                 </fields>
13826                 <links>
13827                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13828                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13829                 </links>
13830         </class>
13831         <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">
13832                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13833                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13834                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13835                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13836                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13837                 </fields>
13838                 <links>
13839                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13840                 </links>
13841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13842                         <actions>
13843                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13844                                 <retrieve/>
13845                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13846                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13847                         </actions>
13848                 </permacrud>
13849         </class>
13850         <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">
13851                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13852                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13853                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13854                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13855                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13856                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13857                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13858                 </fields>
13859                 <links>
13860                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13861                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13862                 </links>
13863                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13864                         <actions>
13865                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13866                                 <retrieve/>
13867                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13868                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13869                         </actions>
13870                 </permacrud>
13871         </class>
13872         <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">
13873                 <fields oils_persist:primary="code">
13874                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13875                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13876                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13877                 </fields>
13878                 <links>
13879                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13880                 </links>
13881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13882                         <actions>
13883                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13884                                 <retrieve/>
13885                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13886                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13887                         </actions>
13888                 </permacrud>
13889         </class>
13890         <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">
13891                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13893                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13894                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13895                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13896                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13897                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13898                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13899                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13900                 </fields>
13901                 <links>
13902                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13903                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13904                 </links>
13905                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13906                         <actions>
13907                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13908                                 <retrieve/>
13909                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13910                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13911                         </actions>
13912                 </permacrud>
13913         </class>
13914         <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">
13915                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13916                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13917                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13918                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13919                 </fields>
13920                 <links>
13921                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13922                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13923                 </links>
13924                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13925                         <actions>
13926                                 <create permission="UPDATE_COPY">
13927                     <context link="copy" field="circ_lib"/>
13928                 </create>
13929                                 <retrieve/>
13930                                 <update permission="UPDATE_COPY">
13931                     <context link="copy" field="circ_lib"/>
13932                 </update>
13933                                 <delete permission="UPDATE_COPY">
13934                     <context link="copy" field="circ_lib"/>
13935                 </delete>
13936                         </actions>
13937                 </permacrud>
13938         </class>
13939         <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">
13940         <oils_persist:source_definition><![CDATA[
13941         SELECT ahcm.target_copy AS id,count(*) AS count
13942          FROM
13943          action.hold_request ahr,
13944          action.hold_copy_map ahcm
13945          WHERE
13946          ahr.cancel_time IS NULL AND
13947          ahr.fulfillment_time IS NULL AND
13948          ahr.capture_time IS NULL AND
13949          ahr.id = ahcm.hold
13950          GROUP BY ahcm.target_copy
13951         ]]></oils_persist:source_definition>
13952         <fields oils_persist:primary="id">
13953             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13954             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13955         </fields>
13956         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13957             <actions>
13958                <retrieve/>
13959             </actions>
13960         </permacrud>
13961         </class>
13962
13963         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13964                 oils_obj:fieldmapper="config::workstation_setting_type" 
13965                 oils_persist:tablename="config.workstation_setting_type" 
13966                 reporter:label="Workstation Setting Type">
13967                 <fields oils_persist:primary="name">
13968                         <field name="name" reporter:datatype="text"/>
13969                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13970                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13971                         <field name="datatype" reporter:datatype="text"/>
13972                         <field name="fm_class" reporter:datatype="text"/>
13973                         <field name="grp" reporter:datatype="link"/>
13974                 </fields>
13975                 <links>
13976                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13977                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13978                 </links>
13979                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13980                         <actions>
13981                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13982                                 <retrieve/>
13983                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13984                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13985                         </actions>
13986                 </permacrud>
13987         </class>
13988
13989         <!-- no pcrud access is granted for now, because it's assumed these
13990                          setting values will be applied and retrived via the API. -->
13991         <class id="awss" 
13992                 controller="open-ils.cstore"
13993                 oils_obj:fieldmapper="actor::workstation_setting" 
13994                 oils_persist:tablename="actor.workstation_setting" 
13995                 reporter:label="Workstation Setting">
13996                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13997                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13998                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13999                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
14000                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
14001                 </fields>
14002                 <links>
14003                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
14004                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
14005                 </links>
14006         </class>
14007
14008         <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">
14009         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
14010                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
14011                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
14012                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
14013         </fields>
14014         </class>
14015
14016         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
14017                 oils_obj:fieldmapper="config::print_template" 
14018                 oils_persist:tablename="config.print_template" 
14019                 reporter:label="Print Templates">
14020                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
14021                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
14022                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
14023                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14024                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
14025                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
14026                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
14027                         <field name="content_type" reporter:datatype="text"/>
14028                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
14029                 </fields>
14030                 <links>
14031                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14032                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14033                 </links>
14034                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14035                         <actions>
14036                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14037                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14038                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14039                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14040                         </actions>
14041                 </permacrud>
14042         </class>
14043
14044         <class id="cct" 
14045                 controller="open-ils.cstore open-ils.pcrud"
14046                 oils_obj:fieldmapper="config::carousel_type" 
14047                 oils_persist:tablename="config.carousel_type" 
14048                 reporter:label="Carousel Types">
14049                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14050                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
14051                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14052                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14053                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14054                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14055                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14056                 </fields>
14057                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14058                         <actions>
14059                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14060                                 <retrieve/>
14061                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14062                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14063                         </actions>
14064                 </permacrud>
14065         </class>
14066
14067         <class id="cc" 
14068                 controller="open-ils.cstore open-ils.pcrud"
14069                 oils_obj:fieldmapper="container::carousel" 
14070                 oils_persist:tablename="container.carousel" 
14071                 reporter:label="Carousels">
14072                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14073                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14074                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14075                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14076                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14077                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14078                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14079                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14080                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14081                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14082                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14083                         <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 -->
14084                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14085                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14086                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14087                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14088                 </fields>
14089                 <links>
14090                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14091                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14092                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14093                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14094                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14095                 </links>
14096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14097                         <actions>
14098                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14099                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14100                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14101                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14102                         </actions>
14103                 </permacrud>
14104         </class>
14105
14106         <class id="ccou" 
14107                 controller="open-ils.cstore open-ils.pcrud"
14108                 oils_obj:fieldmapper="container::carousel_org_unit" 
14109                 oils_persist:tablename="container.carousel_org_unit" 
14110                 reporter:label="Carousels Visible at Library">
14111                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14112                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14113                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14114                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14115                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14116                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14117                 </fields>
14118                 <links>
14119                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14120                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14121                 </links>
14122                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14123                         <actions>
14124                                 <create permission="ADMIN_CAROUSEL">
14125                                     <context link="carousel" field="owner" />
14126                                 </create>
14127                                 <retrieve permission="ADMIN_CAROUSEL">
14128                                     <context link="carousel" field="owner" />
14129                                 </retrieve>
14130                                 <update permission="ADMIN_CAROUSEL">
14131                                     <context link="carousel" field="owner" />
14132                                 </update>
14133                                 <delete permission="ADMIN_CAROUSEL">
14134                                     <context link="carousel" field="owner" />
14135                                 </delete>
14136                         </actions>
14137                 </permacrud>
14138         </class>
14139
14140         <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">
14141                 <fields oils_persist:primary="name">
14142                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14143                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14144                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14145                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14146                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14147                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14148                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14149                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14150                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14151                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14152                 </fields>
14153                 <links>
14154                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14155                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14156                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14157                 </links>
14158                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14159                         <actions>
14160                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14161                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14162                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14163                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14164                         </actions>
14165                 </permacrud>
14166         </class>
14167         <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">
14168                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14169                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14170                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14171                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14172                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14173                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14174                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14175                 </fields>
14176                 <links>
14177                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14178                 </links>
14179                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14180                         <actions>
14181                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14182                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14183                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14184                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14185                         </actions>
14186                 </permacrud>
14187         </class>
14188
14189     <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">
14190         <fields oils_persist:primary="code">
14191             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14192             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14193         </fields>
14194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14195                         <actions>
14196                                 <retrieve/>
14197                         </actions>
14198                 </permacrud>
14199         </class>
14200
14201     <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">
14202         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14203             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14204             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14205             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14206             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14207             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14208             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14209             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14210             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14211                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14212         </fields>
14213                 <links>
14214                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14215                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14216                 </links>
14217         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14218             <actions>
14219                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14220                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14221                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14222                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14223             </actions>
14224         </permacrud>
14225     </class>
14226
14227         <!-- Simple Reporter classes are currently used only by the SR UI -->
14228     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14229         <oils_persist:source_definition><![CDATA[
14230             SELECT
14231               -- Circ id; just for counting
14232               combcirc.id AS circ_id,
14233
14234               -- User info, currently limiting to what's available from action.all_circulation
14235               combcirc.usr_post_code AS usr_post_code,
14236               combcirc.usr_birth_year AS usr_bith_year,
14237               combcirc.usr_profile AS usr_profile_id,
14238               pgtu.name AS usr_profile,
14239               combcirc.usr_home_ou AS usr_home_ou_id,
14240               aouuh.shortname AS usr_home_ou_shortname,
14241               aouuh.name AS usr_home_ou_name,
14242               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14243               aouus.shortname AS usr_sys_shortname,
14244               aouus.name AS usr_sys_name,
14245
14246               -- Circ info
14247               -- Checkout
14248               combcirc.xact_start AS xact_start,
14249               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14250               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14251               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14252               combcirc.circ_lib AS circ_lib_id,
14253               aouco.shortname AS circ_lib_shortname,
14254               aouco.name AS circ_lib_name,
14255               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14256               aoucos.shortname AS circ_sys_shortname,
14257               aoucos.name AS circ_sys_name,
14258               auco.usrname AS circ_staff,
14259               awso.name AS checkout_workstation,
14260
14261               combcirc.due_date AS due_date,
14262               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14263               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14264               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14265
14266               -- Checkin
14267               combcirc.xact_finish AS xact_finish,
14268               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14269               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14270               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14271               aouci.shortname AS checkin_lib_shortname,
14272               aouci.name AS checkin_lib_name,
14273               auci.usrname AS checkin_staff,
14274               awsi.name AS checkin_workstation,
14275               aoucis.shortname AS checkin_sys_shortname,
14276               aoucis.name AS checkin_sys_name,
14277
14278               combcirc.checkin_time AS checkin_time,
14279
14280               -- Misc circ info
14281               combcirc.renewal_remaining AS renewal_remaining,
14282               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14283               combcirc.grace_period AS grace_period,
14284
14285               combcirc.stop_fines AS stop_fines,
14286               combcirc.stop_fines_time AS stop_fines_time,
14287
14288               combcirc.duration AS duration,
14289               combcirc.fine_interval AS fine_interval,
14290               combcirc.recurring_fine AS recurring_fine,
14291               combcirc.max_fine AS max_fine,
14292               combcirc.duration_rule AS duration_rule,
14293               combcirc.recurring_fine_rule AS recurring_fine_rule,
14294               combcirc.max_fine_rule AS max_fine_rule,
14295               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14296               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,
14297               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14298
14299               -- Copy info
14300               acp.barcode AS copy_barcode,
14301               acp.circ_modifier AS copy_circ_modifier_code,
14302               ccm.name AS copy_circ_modifier_name,
14303               acp.circ_lib AS copy_circ_lib_id,
14304               acp.location AS location_id,
14305               acpl.name AS location_name,
14306               aoucp.shortname AS copy_circ_lib_shortname,
14307               aoucp.name AS copy_circ_lib_name,
14308               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14309               aoucps.shortname AS copy_sys_shortname,
14310               aoucps.name AS copy_sys_name,
14311               combcirc.copy_owning_lib AS copy_owning_lib_id,
14312               aoucpo.shortname AS copy_owning_lib_shortname,
14313               aoucpo.name AS copy_owning_lib_name,
14314               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14315               acnp.label AS copy_call_number_prefix,
14316               acn.label AS copy_call_number_label,
14317               acns.label AS copy_call_number_suffix,
14318               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14319               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14320               acn.label_sortkey AS copy_call_number_label_sortkey,
14321               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14322               COALESCE(rmsr.title, acp.dummy_title) AS title,
14323               COALESCE(rmsr.author, acp.dummy_author) AS author,
14324               rmsr.publisher AS publisher,
14325               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14326               array_to_string(rmsr.isbn, ', ') AS isbn,
14327               array_to_string(rmsr.issn, ', ') AS issn,
14328               part.label AS part_label,
14329               part.label_sortkey AS part_label_sortkey,
14330               acn.record AS bib_id,
14331               rmsr.tcn_value AS tcn_value
14332
14333             FROM
14334               action.all_circulation combcirc
14335
14336               -- User
14337               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14338               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14339               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14340
14341               -- Circ
14342               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14343               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14344               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14345               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14346               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14347               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14348               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14349               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14350
14351               -- Copy / call / title
14352               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14353                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14354               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14355               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14356               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14357               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14358               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14359               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14360               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14361               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14362               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14363               LEFT JOIN (
14364                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14365                 FROM biblio.monograph_part bmp
14366                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14367                 WHERE NOT bmp.deleted
14368               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14369         ]]></oils_persist:source_definition>
14370         <field_groups>
14371             <group name="common" reporter:label="Common Fields"/>
14372             <group name="item" reporter:label="Item Fields"/>
14373             <group name="user" reporter:label="Patron Fields"/>
14374             <group name="title" reporter:label="Call Number and Title Fields"/>
14375             <group name="org" reporter:label="Libraries"/>
14376         </field_groups>
14377         <fields oils_persist:primary="circ_id">
14378             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14379             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14380             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14381             <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"/>
14382             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14383             <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"/>
14384             <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"/>
14385             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14386             <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"/>
14387             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14388             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14389             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14390             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14391             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14392             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14393             <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"/>
14394             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14395             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14396             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14397             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14398             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14399             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14400             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14401             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14402             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14403             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14404             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14405             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14406             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14407             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14408             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14409             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14410             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14411             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14412             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14413             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14414             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14415             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14416             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14417             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14418             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14419             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14420             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14421             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14422             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14423             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14424             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14425             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14426             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14427             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14428             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14429             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14430             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14431             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14432             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14433             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14434             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14435             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14436             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14437             <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"/>
14438             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14439             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14440             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14441             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14442             <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"/>
14443             <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"/>
14444             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14445             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14446             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14447             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14448             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14449             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14450             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14451             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14452             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14453             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14454             <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"/>
14455             <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"/>
14456             <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"/>
14457             <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"/>
14458             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14459             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14460             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14461             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14462             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14463             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14464             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14465             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14466             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14467             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14468         </fields>
14469         <links>
14470             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14471             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14472             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14473         </links>
14474     </class>
14475
14476     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14477         <oils_persist:source_definition><![CDATA[
14478             SELECT
14479               au.home_ou AS home_ou_filter,
14480               au.id AS user_id,
14481               cardp.barcode AS barcode_primary,
14482               au.usrname AS usrname,
14483               au.email AS email,
14484               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14485               au.prefix AS prefix,
14486               au.first_given_name AS first_given_name,
14487               au.second_given_name AS second_given_name,
14488               au.family_name AS family_name,
14489               au.suffix AS suffix,
14490               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14491               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14492               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14493               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14494               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14495               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14496               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14497               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14498               au.profile AS profile_id,
14499               pgt.name AS profile,
14500               au.alias AS alias,
14501               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14502               au.day_phone AS day_phone,
14503               au.evening_phone AS evening_phone,
14504               au.other_phone AS other_phone,
14505               au.dob AS dob,
14506               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14507               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14508               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14509               au.active AS active,
14510               au.barred AS barred,
14511               au.deleted AS deleted,
14512               au.juvenile AS juvenile,
14513               au.claims_returned_count AS claims_returned_count,
14514               au.credit_forward_balance AS credit_forward_balance,
14515               au.create_date AS create_date,
14516               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14517               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14518               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14519               au.expire_date AS expire_date,
14520               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14521               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14522               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14523               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14524               au.last_update_time AS last_update_time,
14525               au.home_ou AS home_ou_id,
14526               aouh.shortname AS home_ou_shortname,
14527               aouh.name AS home_ou_name,
14528               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14529               aous.shortname AS home_sys_shortname,
14530               aous.name AS home_sys_name,
14531               auam.valid AS mailing_valid,
14532               auam.address_type AS mailing_address_type,
14533               auam.street1 AS mailing_street1,
14534               auam.street2 AS mailing_street2,
14535               auam.city AS mailing_city,
14536               auam.state AS mailing_state,
14537               auam.country AS mailing_country,
14538               auam.post_code AS mailing_post_code,
14539               auam.county AS mailing_county,
14540               auam.within_city_limits AS mailing_within_city_limits,
14541               auam.pending AS mailing_pending,
14542               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14543               auap.valid AS physical_valid,
14544               auap.address_type AS physical_address_type,
14545               auap.street1 AS physical_street1,
14546               auap.street2 AS physical_street2,
14547               auap.city AS physical_city,
14548               auap.state AS physical_state,
14549               auap.country AS physical_country,
14550               auap.post_code AS physical_post_code,
14551               auap.county AS physical_county,
14552               auap.within_city_limits AS physical_within_city_limits,
14553               auap.pending AS physical_pending,
14554               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14555               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14556               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14557               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14558               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14559               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14560               asceum1.stat_cat_entry AS legacy_stat_cat1,
14561               asceum2.stat_cat_entry AS legacy_stat_cat2,
14562
14563               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14564               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14565               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14566               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14567               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,
14568               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14569
14570             FROM
14571               actor.usr au
14572               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14573               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14574               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14575               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14576               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14577               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14578               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14579               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14580               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14581               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14582               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14583               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14584               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14585               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14586               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14587               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14588
14589             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14590               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14591               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14592               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14593               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14594               76,77,78,79,80,81
14595         ]]></oils_persist:source_definition>
14596         <field_groups>
14597             <group name="common" reporter:label="Common Fields"/>
14598             <group name="name" reporter:label="Name Fields"/>
14599             <group name="contact" reporter:label="Contact Fields"/>
14600             <group name="address" reporter:label="Address Related Fields"/>
14601             <group name="org" reporter:label="Libraries"/>
14602         </field_groups>
14603         <fields oils_persist:primary="user_id">
14604             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14605                 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"/>
14606             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14607             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14608             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14609             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14610             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14611             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14612             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14613             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14614             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14615             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14616             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14617             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14618             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14619             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14620             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14621             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14622             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14623             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14624             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14625             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14626             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14627             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14628             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14629             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14630             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14631             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14632             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14633             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14634             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14635             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14636             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14637             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14638             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14639             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14640             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14641             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14642             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14643             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14644             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14645             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14646             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14647             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14648             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14649             <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"/>
14650             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14651             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14652             <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"/>
14653             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14654             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14655             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14656             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14657             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14658             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14659             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14660             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14661             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14662             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14663             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14664             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14665             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14666             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14667             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14668             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14669             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14670             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14671             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14672             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14673             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14674             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14675             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14676             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14677             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14678             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14679             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14680             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14681             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14682             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14683             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14684             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14685             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14686             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14687             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14688             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14689             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14690             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14691         </fields>
14692         <links>
14693             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14694         </links>
14695     </class>
14696
14697     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14698         <oils_persist:source_definition><![CDATA[
14699             SELECT
14700               -- ids
14701               acp.id AS copy_id,
14702               acp.floating AS floating_id,
14703               acn.id AS acn_id,
14704               acp.circ_lib AS circ_lib_id,
14705               acp.status AS status_id,
14706               acp.location AS location_id,
14707               acp.age_protect AS age_protect_id,
14708               aous.id AS circ_sys_id,
14709               acn.owning_lib AS owning_lib_id,
14710               aouos.id AS owning_sys_id,
14711               awsi.id AS inv_workstation_id,
14712
14713               -- OUs
14714               aou.shortname AS circ_lib_shortname,
14715               aou.name AS circ_lib_name,
14716               aous.shortname AS circ_sys_shortname,
14717               aous.name AS circ_sys_name,
14718               aouo.shortname AS owning_lib_shortname,
14719               aouo.name AS owning_lib_name,
14720               aouos.shortname AS owning_sys_shortname,
14721               aouos.name AS owning_sys_name,
14722
14723               -- dates
14724               acp.create_date AS create_date_time,
14725               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14726               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14727               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14728               acp.active_date AS active_date_time,
14729               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14730               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14731               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14732               acp.edit_date AS edit_date_time,
14733               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14734               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14735               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14736               acp.status_changed_time AS status_changed_time_time,
14737               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14738               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14739               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14740               ali.inventory_date AS latest_inv_date,
14741               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14742               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14743               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14744
14745               -- acp
14746               acp.barcode AS barcode,
14747               ccs.name AS status,
14748               acpl.name AS location_name,
14749                                                         acp.circ_modifier AS copy_circ_modifier_code,
14750                                                         ccm.name AS copy_circ_modifier_name,
14751               acp.price AS price,
14752               acp.cost AS acq_price,
14753               acp.deleted AS copy_deleted,
14754               acp.ref AS reference,
14755               acp.circulate AS copy_circulate,
14756               (acp.circulate AND acpl.circulate) AS circulate,
14757               acp.holdable AS copy_holdable,
14758               acp.deposit AS deposit,
14759               acp.deposit_amount AS deposit_amount,
14760               acp.alert_message AS alert_message,
14761               acp.opac_visible AS copy_opac_visible,
14762               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14763               crahp.name AS age_protect,
14764               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14765               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14766               acp.copy_number AS copy_number,
14767               acp.circ_as_type AS circ_as_type,
14768               acp.loan_duration AS loan_duration_int,
14769               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14770               acp.fine_level AS fine_level_int,
14771               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14772
14773               -- Call Number
14774               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14775               acnp.label AS copy_call_number_prefix,
14776               acn.label AS copy_call_number_label,
14777               acns.label AS copy_call_number_suffix,
14778               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14779               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14780               acn.label_sortkey AS copy_call_number_label_sortkey,
14781               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14782               racnd.dewey AS call_number_dewey,
14783               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14784               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14785               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14786               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14787
14788               -- Misc
14789               COALESCE(rmsr.title, acp.dummy_title) AS title,
14790               COALESCE(rmsr.author, acp.dummy_author) AS author,
14791               rmsr.publisher AS publisher,
14792               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14793               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14794               array_to_string(rmsr.issn, ', ') AS issn,
14795               part.label AS part_label,
14796               part.label_sortkey AS part_label_sortkey,
14797               acn.record AS bib_id,
14798               rmsr.tcn_value AS tcn_value,
14799               acn.deleted AS call_deleted,
14800               bre.deleted AS bib_deleted,
14801               ccs.holdable AS status_holdable,
14802               acpl.holdable AS location_holdable,
14803               acp.circulate AS location_circulate,
14804               awsi.name AS inventory_workstation,
14805               aucr.usrname AS creating_user,
14806               aued.usrname AS editing_user,
14807
14808               -- Aggregates
14809               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14810               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,
14811               COUNT(DISTINCT combcirc.id) AS circ_total,
14812               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14813
14814             FROM
14815               asset.copy acp
14816               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14817               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14818               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14819               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14820               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14821               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14822               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14823               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14824               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14825               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14826               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14827               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14828               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14829               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14830               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14831               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14832               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14833               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14834               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14835               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14836               LEFT JOIN (
14837                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14838                 FROM biblio.monograph_part bmp
14839                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14840                 WHERE NOT bmp.deleted
14841               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14842
14843             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14844               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14845               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14846               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14847               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14848               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14849               91,92,93,94,95,96
14850
14851         ]]></oils_persist:source_definition>
14852         <field_groups>
14853             <group name="common" reporter:label="Common Fields"/>
14854             <group name="dates" reporter:label="Date Fields"/>
14855             <group name="title" reporter:label="Call Number and Title Fields"/>
14856             <group name="org" reporter:label="Libraries"/>
14857         </field_groups>
14858         <fields oils_persist:primary="copy_id">
14859             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14860             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14861             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14862             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14863             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14864             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14865             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14866             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14867             <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"/>
14868             <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"/>
14869             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14870             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14871             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14872             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14873             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14874             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14875             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14876             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14877             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14878             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14879             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14880             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14881             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14882             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14883             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14884             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14885             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14886             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14887             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14888             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14889             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14890             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14891             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14892             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14893             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14894             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14895             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14896             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14897             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14898             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14899             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14900             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14901             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14902             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14903             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14904             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14905             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14906             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14907             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14908             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14909             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14910             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14911             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14912             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14913             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14914             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14915             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14916             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14917             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14918             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14919             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14920             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14921             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14922             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14923             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14924             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14925             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14926             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14927             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14928             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14929             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14930             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14931             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14932             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14933             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14934             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14935             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14936             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14937             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14938             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14939             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14940             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14941             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14942             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14943             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14944             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14945             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14946             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14947             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14948             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14949             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14950             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14951             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14952             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14953         </fields>
14954         <links>
14955             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14956             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14957             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14958             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14959             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14960             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14961         </links>
14962     </class>
14963
14964     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14965         <oils_persist:source_definition><![CDATA[
14966
14967             SELECT
14968               -- ids
14969               acp.id AS copy_id,
14970               acn.id AS acn_id,
14971               acp.circ_lib AS circ_lib_id,
14972               acp.status AS status_id,
14973               acp.location AS location_id,
14974               acp.age_protect AS age_protect_id,
14975               aous.id AS circ_sys_id,
14976               acn.owning_lib AS owning_lib_id,
14977               aouos.id AS owning_sys_id,
14978               awsi.id AS inv_workstation_id,
14979
14980               -- OUs
14981               aou.shortname AS circ_lib_shortname,
14982               aou.name AS circ_lib_name,
14983               aous.shortname AS circ_sys_shortname,
14984               aous.name AS circ_sys_name,
14985               aouo.shortname AS owning_lib_shortname,
14986               aouo.name AS owning_lib_name,
14987               aouos.shortname AS owning_sys_shortname,
14988               aouos.name AS owning_sys_name,
14989
14990               -- dates
14991               acp.create_date AS create_date_time,
14992               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14993               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14994               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14995               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14996               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14997               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14998               acp.active_date AS active_date_time,
14999               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
15000               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
15001               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
15002               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
15003               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
15004               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
15005               acp.edit_date AS edit_date_time,
15006               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
15007               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
15008               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
15009               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
15010               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
15011               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
15012               acp.status_changed_time AS status_changed_time_time,
15013               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
15014               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
15015               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
15016               ali.inventory_date AS latest_inv_date,
15017               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
15018               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
15019               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
15020               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
15021               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
15022               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
15023
15024               -- acp
15025               acp.barcode AS barcode,
15026               ccs.name AS status,
15027               acpl.name AS location_name,
15028               acp.circ_modifier AS circ_modifier_code,
15029               ccm.name AS circ_modifier_name,
15030               acp.price AS price,
15031               acp.cost AS acq_price,
15032               acp.deleted AS copy_deleted,
15033               acp.ref AS reference,
15034               acp.circulate AS copy_circulate,
15035               (acp.circulate AND acpl.circulate) AS circulate,
15036               acp.holdable AS copy_holdable,
15037               acp.deposit AS deposit,
15038               acp.deposit_amount AS deposit_amount,
15039               acp.alert_message AS alert_message,
15040               acp.opac_visible AS copy_opac_visible,
15041               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
15042               crahp.name AS age_protect,
15043               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15044               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15045               acp.copy_number AS copy_number,
15046               acp.circ_as_type AS circ_as_type,
15047               acp.loan_duration AS loan_duration_int,
15048               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15049               acp.fine_level AS fine_level_int,
15050               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15051
15052               -- Call Number
15053               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15054               acnp.label AS copy_call_number_prefix,
15055               acn.label AS copy_call_number_label,
15056               acns.label AS copy_call_number_suffix,
15057               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15058               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15059               acn.label_sortkey AS copy_call_number_label_sortkey,
15060               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15061               racnd.dewey AS call_number_dewey,
15062               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15063               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15064               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15065               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15066
15067               -- Misc
15068               COALESCE(rmsr.title, acp.dummy_title) AS title,
15069               COALESCE(rmsr.author, acp.dummy_author) AS author,
15070               rmsr.publisher AS publisher,
15071               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15072               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15073               array_to_string(rmsr.issn, ', ') AS issn,
15074               part.label AS part_label,
15075               part.label_sortkey AS part_label_sortkey,
15076               acn.record AS bib_id,
15077               rmsr.tcn_value AS tcn_value,
15078               acn.deleted AS call_deleted,
15079               bre.deleted AS bib_deleted,
15080               ccs.holdable AS status_holdable,
15081               acpl.holdable AS location_holdable,
15082               acp.circulate AS location_circulate,
15083               awsi.name AS inventory_workstation,
15084
15085               -- Aggregates
15086               -- may decide these price games aren't worth it, but estimated collection value is useful
15087               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,
15088               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15089               MAX(combcirc.xact_start) AS last_circ_datetime,
15090               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15091               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15092               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15093               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15094               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15095               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15096               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15097               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15098               (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,
15099               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15100               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15101               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15102               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15103               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15104               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15105               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,
15106               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,
15107               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,
15108               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
15109
15110             FROM
15111               asset.copy acp
15112               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15113               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15114               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15115               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15116               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15117               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15118               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15119               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15120               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15121               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15122               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15123               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15124               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15125               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15126               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15127               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15128               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15129               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15130               LEFT JOIN (
15131                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15132                 FROM biblio.monograph_part bmp
15133                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15134                 WHERE NOT bmp.deleted
15135               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15136
15137             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15138               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15139               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15140               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15141               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15142               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15143               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15144
15145         ]]></oils_persist:source_definition>
15146         <field_groups>
15147             <group name="common" reporter:label="Common Fields"/>
15148             <group name="dates" reporter:label="Date Fields"/>
15149             <group name="inv" reporter:label="Inventory Fields"/>
15150             <group name="title" reporter:label="Call Number and Title Fields"/>
15151             <group name="org" reporter:label="Libraries"/>
15152         </field_groups>
15153         <fields oils_persist:primary="copy_id">
15154              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15155              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15156              <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"/>
15157              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15158              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15159              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15160              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15161              <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"/>
15162              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15163              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15164              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15165              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15166              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15167              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15168              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15169              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15170              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15171              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15172              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15173              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15174              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15175              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15176              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15177              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15178              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15179              <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"/>
15180              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15181              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15182              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15183              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15184              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15185              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15186              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15187              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15188              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15189              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15190              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15191              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15192              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15193              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15194              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15195              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15196              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15197              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15198              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15199              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15200              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15201              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15202              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15203              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15204              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15205              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15206              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15207              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15208              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15209              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15210              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15211              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15212              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15213              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15214              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15215              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15216              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15217              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15218              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15219              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15220              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15221              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15222              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15223              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15224              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15225              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15226              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15227              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15228              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15229              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15230              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15231              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15232              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15233              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15234              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15235              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15236              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15237              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15238              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15239              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15240              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15241              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15242              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15243              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15244              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15245              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15246              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15247              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15248              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15249              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15250              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15251              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15252              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15253              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15254              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15255              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15256              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15257              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15258              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15259              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15260              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15261              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15262              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15263              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15264              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15265              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15266              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15267              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15268              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15269              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15270              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15271              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15272              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15273              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15274              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15275              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15276              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15277              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15278              <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"/>
15279              <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"/>
15280              <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"/>
15281         </fields>
15282         <links>
15283             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15284             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15285             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15286             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15287             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15288         </links>
15289     </class>
15290
15291     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15292         <oils_persist:source_definition><![CDATA[
15293
15294             SELECT
15295               -- ids
15296               xact.id AS xact_id,
15297               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15298               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15299
15300               -- OUs
15301               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15302               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15303               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15304               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15305
15306               -- billings
15307               billings.total_amount AS billing_grand_total,
15308               billings.total_unvoided_amount AS billing_total,
15309
15310               billings.voided_billing_count AS billing_voided_count,
15311               billings.all_billing_types AS all_billing_types,
15312               billings.billing_types AS billing_types,
15313
15314               billings.total_voided_amount AS billing_total_voided,
15315               billings.total_overdue_amount AS billing_overdue_amount,
15316               billings.total_lost_amount AS billing_lost_amount,
15317               billings.total_long_od_amount AS billing_long_od_amount,
15318               billings.total_damaged_amount AS billing_damaged_amount,
15319               billings.total_deposit_amount AS billing_deposit_amount,
15320               billings.total_rental_amount AS billing_rental_amount,
15321
15322               -- payments
15323               payments.total_amount AS payment_grand_total,
15324               payments.total_unvoided_amount AS payment_total,
15325
15326               payments.voided_payment_count AS payment_voided_count,
15327               payments.all_payment_types AS all_payment_types,
15328               payments.payment_types AS payment_types,
15329
15330               payments.total_voided_amount AS payment_total_voided,
15331               payments.total_account_adjustment AS payment_account_adjustment_amount,
15332               payments.total_cash_payment AS payment_cash_amount,
15333               payments.total_check_payment AS payment_check_amount,
15334               payments.total_credit_card_payment AS payment_credit_card_amount,
15335               payments.total_debit_card_payment AS payment_debit_card_amount,
15336               payments.total_credit_payment AS payment_credit_amount,
15337               payments.total_forgive_payment AS payment_forgive_amount,
15338               payments.total_work_payment AS payment_work_amount,
15339               payments.total_goods_payment AS payment_goods_amount,
15340               payments.total_currency_payment AS payment_currency_amount,
15341               payments.total_non_currency_payment AS payment_non_currency_amount,
15342
15343               -- dates
15344               xact.xact_start AS xact_start,
15345               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15346               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15347               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15348               xact.xact_finish AS xact_finish,
15349               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15350               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15351               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15352               billings.earliest_billing_ts AS earliest_billing_ts,
15353               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15354               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15355               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15356               billings.latest_billing_ts AS latest_billing_ts,
15357               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15358               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15359               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15360               payments.earliest_payment_ts AS earliest_payment_ts,
15361               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15362               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15363               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15364               payments.latest_payment_ts AS latest_payment_ts,
15365               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15366               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15367               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15368
15369               -- Misc
15370               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15371               (xact.xact_finish IS NOT NULL) AS xact_closed
15372
15373             FROM
15374               money.billable_xact xact
15375               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15376               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15377               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15378               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15379               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15380               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15381
15382               -- oohh nooo.... If not done this way you encounter situations
15383               -- like multiplying billing totals x number of payments and
15384               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15385               LEFT JOIN (
15386                 SELECT
15387                   xact,
15388                   MIN(billing_ts) AS earliest_billing_ts,
15389                   MAX(billing_ts) AS latest_billing_ts,
15390
15391                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15392                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15393                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15394
15395                   SUM(amount) AS total_amount,
15396                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15397                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15398                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15399                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15400                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15401                   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.
15402                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15403                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15404
15405                 FROM
15406                   money.all_billings
15407                 GROUP BY 1
15408               ) billings ON (xact.id = billings.xact)
15409               -- Can't include accepting user or cash_drawer because that will "duplicate"
15410               -- rows if multiple staff accept payments on a single xact...
15411               LEFT JOIN (
15412                 SELECT
15413                   xact,
15414                   MIN(payment_ts) AS earliest_payment_ts,
15415                   MAX(payment_ts) AS latest_payment_ts,
15416
15417                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15418                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15419                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15420
15421                   SUM(amount) AS total_amount,
15422                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15423                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15424                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15425                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15426                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15427                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15428                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15429                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15430                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15431                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15432                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15433                   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,
15434                   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
15435
15436                 FROM
15437                   money.all_payments
15438                 GROUP BY 1
15439               ) payments ON (xact.id = payments.xact)
15440
15441         ]]></oils_persist:source_definition>
15442         <field_groups>
15443             <group name="common" reporter:label="Common Fields"/>
15444             <group name="bill" reporter:label="Billing Fields"/>
15445             <group name="pay" reporter:label="Payment Fields"/>
15446             <group name="dates" reporter:label="Date Fields"/>
15447             <group name="org" reporter:label="Libraries"/>
15448         </field_groups>
15449         <fields oils_persist:primary="xact_id">
15450              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15451              <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"/>
15452              <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"/>
15453              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15454              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15455              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15456              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15457              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15458              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15459              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15460              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15461              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15462              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15463              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15464              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15465              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15466              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15467              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15468              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15469              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15470              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15471              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15472              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15473              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15474              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15475              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15476              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15477              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15478              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15479              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15480              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15481              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15482              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15483              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15484              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15485              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15486              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15487              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15488              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15489              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15490              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15491              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15492              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15493              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15494              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15495              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15496              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15497              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15498              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15499              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15500              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15501              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15502              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15503              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15504              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15505              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15506              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15507              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15508              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15509              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15510              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15511              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15512         </fields>
15513     </class>
15514
15515         <class id="coauf" 
15516                 controller="open-ils.cstore open-ils.pcrud"
15517                 oils_obj:fieldmapper="config::openathens_uid_field" 
15518                 oils_persist:tablename="config.openathens_uid_field" 
15519                 reporter:label="OpenAthens unique identifiers">
15520                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15521                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15522                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15523                 </fields>
15524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15525                         <actions>
15526                                 <retrieve/>
15527                         </actions>
15528                 </permacrud>
15529         </class>
15530
15531         <class id="coanf" 
15532                 controller="open-ils.cstore open-ils.pcrud"
15533                 oils_obj:fieldmapper="config::openathens_name_field" 
15534                 oils_persist:tablename="config.openathens_name_field" 
15535                 reporter:label="OpenAthens name fields">
15536                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15537                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15538                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15539                 </fields>
15540                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15541                         <actions>
15542                                 <retrieve/>
15543                         </actions>
15544                 </permacrud>
15545         </class>
15546
15547         <class id="coai" 
15548                 controller="open-ils.cstore open-ils.pcrud"
15549                 oils_obj:fieldmapper="config::openathens_identity" 
15550                 oils_persist:tablename="config.openathens_identity" 
15551                 reporter:label="Sign-on to OpenAthens">
15552                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15553                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15554                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15555                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15556                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15557                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15558                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15559                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15560                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15561                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15562                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15563                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15564                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15565                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15566                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15567                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15568                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15569                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15570                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15571                 </fields>
15572                 <links>
15573                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15574                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15575                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15576                 </links>
15577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15578                         <actions>
15579                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15580                                 <retrieve/>
15581                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15582                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15583                         </actions>
15584                 </permacrud>
15585         </class>
15586
15587         <!-- ********************************************************************************************************************* -->
15588 </IDL>
15589
15590 <!--
15591     vim:noet:ts=4:sw=4:
15592 -->