]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#2036842: new reporting sources for invoice totals
[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 reporter:label="Stop Blocked User?" name="stop_blocked_user" reporter:datatype="bool"/>
2139                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2140                 </fields>
2141                 <links>
2142                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2147                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2149                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2150                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2151                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2152                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2153                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2154                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2155             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2156                 </links>
2157         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2158             <actions>
2159                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2163             </actions>
2164         </permacrud>
2165         </class>
2166
2167         <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">
2168                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2169                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2170                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2171                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2172                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2173                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2175                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2176                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2177                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2178                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2183                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2184             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2185                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2186                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2187             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2188                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2189                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2191                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2192             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2193             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2194             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2195                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2196                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2197                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2198                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2199                         <field name="renew_extends_due_date" reporter:datatype="bool" reporter:label="Early Renewal Extends Due Date"/>
2200                         <field name="renew_extend_min_interval" reporter:datatype="interval" reporter:label="Early Renewal Minimum Duration Interval"/>
2201                 </fields>
2202                 <links>
2203                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2205                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2206                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2207                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2208                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2209                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2210                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2211                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2212                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2213                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2214                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2215                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2216                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2217             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2218                 </links>
2219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2220             <actions>
2221                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2223                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2224                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2225             </actions>
2226         </permacrud>
2227         </class>
2228
2229     <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">
2230         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2231             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2232             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2233             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2234         </fields>
2235         <links/>
2236         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2237             <actions>
2238                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2239                 <retrieve/>
2240                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2241                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2242             </actions>
2243         </permacrud>
2244     </class>
2245
2246     <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">
2247         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2248             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2249             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2250             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2251             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2252             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2253             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2254             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2255         </fields>
2256         <links>
2257             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2258         </links>
2259         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2260             <actions>
2261                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2262                 <retrieve/>
2263                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2264                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2265             </actions>
2266         </permacrud>
2267     </class>
2268
2269     <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">
2270         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2271             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2272             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2273             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2274             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2275             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2276         </fields>
2277         <links>
2278             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2279             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2280         </links>
2281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2282             <actions>
2283                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2284                     <context link="matchpoint" field="org_unit"/>
2285                 </create>
2286                 <retrieve/>
2287                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2288                     <context link="matchpoint" field="org_unit"/>
2289                 </update>
2290                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2291                     <context link="matchpoint" field="org_unit"/>
2292                 </delete>
2293             </actions>
2294         </permacrud>
2295     </class>
2296
2297     <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">
2298         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2299             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2300             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2301             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2302         </fields>
2303         <links>
2304             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2305             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2306         </links>
2307         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2308             <actions>
2309                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2310                     <context link="limit_set" field="owning_lib"/>
2311                 </create>
2312                 <retrieve/>
2313                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2314                     <context link="limit_set" field="owning_lib"/>
2315                 </update>
2316                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2317                     <context link="limit_set" field="owning_lib"/>
2318                 </delete>
2319             </actions>
2320         </permacrud>
2321     </class>
2322     <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">
2323         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2324             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2325             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2326             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2327         </fields>
2328         <links>
2329             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2330             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2331         </links>
2332         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2333             <actions>
2334                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2335                     <context link="limit_set" field="owning_lib"/>
2336                 </create>
2337                 <retrieve/>
2338                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2339                     <context link="limit_set" field="owning_lib"/>
2340                 </update>
2341                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2342                     <context link="limit_set" field="owning_lib"/>
2343                 </delete>
2344             </actions>
2345         </permacrud>
2346     </class>
2347
2348     <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">
2349         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2350             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2351             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2352             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2353             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2354         </fields>
2355         <links>
2356             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2357             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2358         </links>
2359         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2360             <actions>
2361                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2362                     <context link="limit_set" field="owning_lib"/>
2363                 </create>
2364                 <retrieve/>
2365                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2366                     <context link="limit_set" field="owning_lib"/>
2367                 </update>
2368                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2369                     <context link="limit_set" field="owning_lib"/>
2370                 </delete>
2371             </actions>
2372         </permacrud>
2373     </class>
2374
2375         <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">
2376                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2377                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2378                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2379                 </fields>
2380                 <links/>
2381         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2382             <actions>
2383                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2384                 <retrieve/>
2385                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2386                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2387             </actions>
2388         </permacrud>
2389         </class>
2390
2391         <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">
2392                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2393                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2394                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2395                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2396                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2397                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2398                 </fields>
2399                 <links>
2400                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2401                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2402                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2403                 </links>
2404         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2405             <actions>
2406                 <create permission="ADMIN_SURVEY">
2407                     <context link="survey" field="owner"/>
2408                 </create>
2409                 <retrieve/>
2410                 <update permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </update>
2413                 <delete permission="ADMIN_SURVEY">
2414                     <context link="survey" field="owner"/>
2415                 </delete>
2416             </actions>
2417         </permacrud>
2418         </class>
2419         <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">
2420                 <fields oils_persist:primary="id" oils_persist:sequence="">
2421                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2422                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2423                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2424                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2425                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2426                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2427                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2428                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2429                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2430                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2431                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2432                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2433                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2434                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2435                 </fields>
2436                 <links>
2437                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2438                 </links>
2439                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2440                         <actions>
2441                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2442                                         <context link="usr" field="home_ou" />
2443                                 </retrieve>
2444                         </actions>
2445                 </permacrud>
2446         </class>
2447         <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">
2448                 <fields oils_persist:primary="id" oils_persist:sequence="">
2449                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2450                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2451                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2452                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2453                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2454                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2455                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2456                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2457                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2458                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2459                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2460                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2461                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2462                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2463                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2464                 </fields>
2465                 <links>
2466                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2467                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2468                 </links>
2469         </class>
2470         <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">
2471                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2472                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2474                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2475                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2476                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2477                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2478                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2479                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2480                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2481                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2482                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2483                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2484                 </fields>
2485                 <links>
2486                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2487                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2488                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2489                 </links>
2490                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2491                         <actions> <!-- created magically, so no create action -->
2492                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2493                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2494                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2495                         </actions>
2496                 </permacrud>
2497         </class>
2498         <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)">
2499                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2500                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2501                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2502                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2503                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2504                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2505                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2506                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2507                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2508                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2509                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2510                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2511                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2512                 </fields>
2513                 <links>
2514                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2515                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2516                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2517                 </links>
2518                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2519                         <actions> <!-- created magically, so no create action -->
2520                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2521                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2522                         </actions>
2523                 </permacrud>
2524         </class>
2525         <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">
2526         <fields oils_persist:primary="id">
2527                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2528                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2530                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2531                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2532                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2533                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2534                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2535                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2536                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2537                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2538                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2539                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2540                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2541                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2542                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2543                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2544                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2545                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2546                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2547                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2548                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2549                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2550                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2551                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2552                 </fields>
2553                 <links>
2554                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2555                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2556                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2559                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2560                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2561                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2562                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2563                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2564                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2565                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2566                 </links>
2567                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2568                         <actions> <!-- created magically, so no create action -->
2569                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2570                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2571                         </actions>
2572                 </permacrud>
2573         </class>
2574
2575         <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">
2576                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2577                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2578                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2579                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2580                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2581                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2582                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2583                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2584                 </fields>
2585                 <links>
2586                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2587                 </links>
2588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2589                         <actions>
2590                                 <create permission="UPDATE_USER">
2591                                         <context link="usr" field="home_ou"/>
2592                                 </create>
2593                                 <retrieve permission="VIEW_USER">
2594                                         <context link="usr" field="home_ou"/>
2595                                 </retrieve>
2596                                 <update permission="UPDATE_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </update>
2599                                 <delete permission="UPDATE_USER">
2600                                         <context link="usr" field="home_ou"/>
2601                                 </delete>
2602                         </actions>
2603                 </permacrud>
2604         </class>
2605         <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">
2606                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2607                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2608                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2609                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2610                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2611                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2612                 </fields>
2613                 <links>
2614                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2615                 </links>
2616         </class>
2617         <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">
2618                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2619                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2620                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2621                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2622                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2623                 </fields>
2624                 <links>
2625                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2626                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2627                 </links>
2628                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2629                         <actions>
2630                                 <retrieve permission="VIEW_USER">
2631                                         <context link="usr" field="home_ou" />
2632                                 </retrieve>
2633                         </actions>
2634                 </permacrud>
2635         </class>
2636         <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">
2637                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2638                         <field name="field" reporter:datatype="link"/>
2639                         <field name="id" reporter:datatype="id" />
2640                         <field name="source" reporter:datatype="link"/>
2641                         <field name="value" reporter:datatype="text"/>
2642                 </fields>
2643                 <links>
2644                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2645                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2646                 </links>
2647         </class>
2648         <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">
2649                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2650                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2651                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2652                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2653                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2654                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2655                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2656                 </fields>
2657                 <links>
2658                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2659                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2660                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2661                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2662                 </links>
2663                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2664                         <actions>
2665                                 <retrieve/>
2666                         </actions>
2667                 </permacrud>
2668         </class>
2669         <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">
2670                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2671                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2672                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2673                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2674                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2675                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2676                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2677                 </fields>
2678                 <links>
2679                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2680                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2681                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2682                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2683                 </links>
2684                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2685                         <actions>
2686                                 <retrieve/>
2687                         </actions>
2688                 </permacrud>
2689         </class>
2690         <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">
2691                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2692                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2693                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2694                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2695                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2696                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2697                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2698                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2699                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2700                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2701                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2702                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2703                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2704                 </fields>
2705                 <links>
2706                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2707                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2709                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2710                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2711                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2712                 </links>
2713         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2714             <actions>
2715                 <create permission="TRANSIT_COPY" context_field="owner">
2716                     <context link="target_copy" field="circ_lib"/>
2717                 </create>
2718                 <retrieve/>
2719                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2720                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2721             </actions>
2722         </permacrud>
2723         </class>
2724         <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">
2725                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2726                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2727                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2728                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2729                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2730                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2731                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2732                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2733                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2734                 </fields>
2735                 <links>
2736                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2737                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2738                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2739                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2740                 </links>
2741         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2742             <actions>
2743                 <create permission="ADMIN_SURVEY">
2744                     <context link="survey" field="owner"/>
2745                 </create>
2746                 <retrieve permission="VIEW_USER">
2747                     <context link="usr" field="home_ou"/>
2748                 </retrieve>
2749                 <update permission="ADMIN_SURVEY">
2750                     <context link="survey" field="owner"/>
2751                 </update>
2752                 <delete permission="ADMIN_SURVEY">
2753                     <context link="survey" field="owner"/>
2754                 </delete>
2755             </actions>
2756         </permacrud>
2757         </class>
2758         <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">
2759                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2760                         <field name="bucket" reporter:datatype="link"/>
2761                         <field name="id" reporter:datatype="id" />
2762                         <field name="target_copy" reporter:datatype="link"/>
2763                         <field name="create_time" reporter:datatype="timestamp" />
2764                         <field name="pos" reporter:datatype="int" />
2765                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2766                 </fields>
2767                 <links>
2768                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2769                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2770             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2771                 </links>
2772                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2773                         <actions>
2774                                 <retrieve permission="ADMIN_COPY_BUCKET">
2775                     <context link="bucket" field="owning_lib"/>
2776                 </retrieve>
2777             </actions>
2778         </permacrud>
2779         </class>
2780         <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">
2781                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2782                         <field name="id" reporter:datatype="id" />
2783                         <field name="item" reporter:datatype="link"/>
2784                         <field name="note" reporter:datatype="text" />
2785                 </fields>
2786                 <links>
2787                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2788                 </links>
2789         </class>
2790
2791         <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">
2792                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2793                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2794                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2795                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2796                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2797                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2798                 </fields>
2799                 <links>
2800                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2801                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2802                 </links>
2803                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2804                         <actions>
2805                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                                 <retrieve/>
2807                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2808                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2809                         </actions>
2810                 </permacrud>
2811         </class>
2812
2813         <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">
2814                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2815                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2816                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2817                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2818                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2819                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2820                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2821                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2822                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2823                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2824                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2825                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2827                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2828                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2829                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2830                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2831                 </fields>
2832                 <links>
2833                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2834                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2835                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2836                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2837                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2838                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2839                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2840                 </links>
2841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2842                         <actions>
2843                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2844                                 <retrieve/>
2845                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2846                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2847                         </actions>
2848                 </permacrud>
2849         </class>
2850
2851         <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">
2852                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2853                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2854                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2855                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2856                 </fields>
2857                 <links>
2858                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2859                 </links>
2860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2861                         <actions>
2862                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2863                                 <retrieve/>
2864                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2865                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2866                         </actions>
2867                 </permacrud>
2868         </class>
2869
2870         <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">
2871                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2872                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2873                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2874                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2875                 </fields>
2876                 <links>
2877                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2878                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2879                 </links>
2880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2881                         <actions>
2882                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2883                                 <retrieve/>
2884                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2885                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2886                         </actions>
2887                 </permacrud>
2888         </class>
2889
2890         <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">
2891                 <fields oils_persist:primary="code">
2892                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2893                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2894                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2895                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2896                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2897                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2898                 </fields>
2899                 <links>
2900                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2901                 </links>
2902                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2903                         <actions>
2904                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2905                                 <retrieve/>
2906                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2907                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2908                         </actions>
2909                 </permacrud>
2910         </class>
2911
2912         <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">
2913                 <fields oils_persist:primary="code">
2914                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2915                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2916                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2917                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2918                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2919                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2920                 </fields>
2921                 <links>
2922                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2923                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2924                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2925                 </links>
2926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2927                         <actions>
2928                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2929                                 <retrieve/>
2930                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2931                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2932                         </actions>
2933                 </permacrud>
2934         </class>
2935
2936     <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">
2937         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2938             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2939             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2940             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2941         </fields>
2942         <links>
2943             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2944             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2945         </links>
2946         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2947             <actions>
2948                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2949                 <retrieve/>
2950                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2951                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2952             </actions>
2953         </permacrud>
2954     </class>
2955
2956         <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">
2957                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2958                         <field name="active" reporter:datatype="bool"/>
2959                         <field name="create_date" reporter:datatype="timestamp"/>
2960                         <field name="creator" />
2961                         <field name="deleted" reporter:datatype="bool"/>
2962                         <field name="edit_date" reporter:datatype="timestamp"/>
2963                         <field name="editor" />
2964                         <field name="id" reporter:datatype="id" />
2965                         <field name="last_xact_id" />
2966                         <field name="marc" />
2967                         <field name="source" />
2968                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2969                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2970                         <field name="heading" />
2971                         <field name="simple_heading" />
2972                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2973                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2974                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2975                 </fields>
2976                 <links>
2977                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2978                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2979                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2980                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2981                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2982                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2983                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2984                 </links>
2985                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2986                         <actions>
2987                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2988                                 <retrieve/>
2989                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2990                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2991                         </actions>
2992                 </permacrud>
2993         </class>
2994         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2995                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2996                         <field name="char_encoding" />
2997                         <field name="id" />
2998                         <field name="record" />
2999                         <field name="record_status" />
3000                         <field name="thesaurus" />
3001                 </fields>
3002                 <links>
3003                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3004                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3005                 </links>
3006         </class>
3007         <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">
3008                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3009                         <field name="id" reporter:datatype="id" />
3010                         <field name="bib" reporter:datatype="link" />
3011                         <field name="authority" reporter:datatype="link" />
3012                 </fields>
3013                 <links>
3014                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3015                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3016                 </links>
3017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3018                         <actions>
3019                                 <retrieve/>
3020                         </actions>
3021                 </permacrud>
3022         </class>
3023         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3024                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3025                         <field name="id" reporter:datatype="id" />
3026                         <field name="record" reporter:datatype="link" />
3027                         <field name="atag" reporter:datatype="link" />
3028                         <field name="value" reporter:datatype="text" />
3029                         <field name="thesaurus" reporter:datatype="text" />
3030                 </fields>
3031                 <links>
3032                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3033                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3034                 </links>
3035         </class>
3036
3037         <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">
3038                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3039                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3040                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3041                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3042                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3043                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3044                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3045                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3046                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3047                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3048                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3049                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3050                 </fields>
3051                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3052                         <actions>
3053                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3054                                 <retrieve/>
3055                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3056                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3057                         </actions>
3058                 </permacrud>
3059         </class>
3060
3061         <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">
3062                 <fields oils_persist:primary="code" oils_persist:sequence="">
3063                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3064                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3065                 </fields>
3066                 <links/>
3067         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3068             <actions>
3069                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3070                 <retrieve/>
3071                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3072                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3073             </actions>
3074         </permacrud>
3075         </class>
3076         <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">
3077                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3078                         <field name="accepting_usr" />
3079                         <field name="amount" reporter:datatype="money" />
3080                         <field name="amount_collected" reporter:datatype="money" />
3081                         <field name="approval_code" reporter:datatype="text"/>
3082                         <field name="cash_drawer" reporter:datatype="link"/>
3083                         <field name="cc_number" reporter:datatype="text"/>
3084                         <field name="cc_order_number" reporter:datatype="text"/>
3085                         <field name="cc_processor" reporter:datatype="text"/>
3086                         <field name="id" reporter:datatype="id" />
3087                         <field name="note" reporter:datatype="text"/>
3088                         <field name="payment_ts" reporter:datatype="timestamp"/>
3089                         <field name="xact" reporter:datatype="link"/>
3090                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3091                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3092                 </fields>
3093                 <links>
3094                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3095                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3096                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3097                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3098                 </links>
3099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3100             <actions>
3101                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3102                     <context link="xact" jump="usr" field="home_ou"/>
3103                 </retrieve>
3104                         </actions>
3105                 </permacrud>
3106         </class>
3107         <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">
3108                 <fields oils_persist:primary="name">
3109                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3110                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3111                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3112                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3113                 </fields>
3114                 <links/>
3115         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3116             <actions>
3117                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3118                 <retrieve/>
3119                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3120                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3121             </actions>
3122         </permacrud>
3123         </class>
3124
3125         <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">
3126                 <fields oils_persist:primary="alias">
3127                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3128                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3129                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3130                 </fields>
3131                 <links>
3132                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3133                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3134                 </links>
3135         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3136             <actions>
3137                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3138                 <retrieve/>
3139                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3140                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3141             </actions>
3142         </permacrud>
3143         </class>
3144
3145         <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">
3146                 <fields oils_persist:primary="name">
3147                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3148                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3149                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3150                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3151                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3152                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3153                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3154                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3155                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3156                         <field reporter:label="Low Result Threshold for Suggestions" name="low_result_threshold" reporter:datatype="int" />
3157                         <field reporter:label="Max Suggestions" name="max_suggestions" reporter:datatype="int" />
3158                         <field reporter:label="Perform Variant Heading Authority Suggestion Cross-reference" name="variant_authority_suggestion" reporter:datatype="bool" />
3159                         <field reporter:label="Minimum Bib Record Suggestion Threshold" name="min_suggestion_use_threshold" reporter:datatype="int" />
3160                         <field reporter:label="Suggestion SOUNDEX Weight" name="soundex_weight" reporter:datatype="int" />
3161                         <field reporter:label="Suggestion PG Trigram Weight" name="pg_trgm_weight" reporter:datatype="int" />
3162                         <field reporter:label="Suggestion Keyboard Distance Weight" name="keyboard_distance_weight" reporter:datatype="int" />
3163                         <field reporter:label="Retain Case in Suggestions" name="symspell_transfer_case" reporter:datatype="bool" />
3164                         <field reporter:label="Avoid alternate suggestions on correctly spelled words" name="symspell_skip_correct" reporter:datatype="bool" />
3165                         <field reporter:label="Symspell suggestion calculation verbosity" name="symspell_suggestion_verbosity" reporter:datatype="int" />
3166                         <field reporter:label="Maximum average word Edit Distance" name="max_phrase_edit_distance" reporter:datatype="int" />
3167                         <field reporter:label="Maximum suggestions per word" name="suggestion_word_option_count" reporter:datatype="int" />
3168                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3169                 </fields>
3170                 <links>
3171                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3172                 </links>
3173         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3174             <actions>
3175                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3176                 <retrieve/>
3177                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3178                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3179             </actions>
3180         </permacrud>
3181         </class>
3182
3183         <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">
3184                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3185                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3186                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3187                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3188                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3189                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3190                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3191                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3192                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3193                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3194                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3195                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3196                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3197                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3198                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3199                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3200                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3201                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3202                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3203                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3204                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3205                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3206                 </fields>
3207                 <links>
3208                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3209                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3210                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3211                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3212                 </links>
3213         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3214             <actions>
3215                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3216                 <retrieve/>
3217                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3218                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3219             </actions>
3220         </permacrud>
3221         </class>
3222
3223         <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">
3224                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3225                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3226                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3227                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3228                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3229                 </fields>
3230                 <links>
3231                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3232                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3233                 </links>
3234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3235             <actions>
3236                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3237                 <retrieve/>
3238                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3239                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3240             </actions>
3241         </permacrud>
3242         </class>
3243
3244         <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">
3245                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3246                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3247                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3248                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3249                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3250                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3251                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3252                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3253                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3254                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3255                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3256                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3257                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3258                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3259                 </fields>
3260                 <links>
3261                 </links>
3262                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3263                         <actions>
3264                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3265                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3266                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3267                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3268                         </actions>
3269                 </permacrud>
3270         </class>
3271         <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">
3272                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3273                         <field name="id" reporter:datatype="id" />
3274                         <field name="name" reporter:datatype="text"/>
3275                         <field name="xpath" reporter:datatype="text"/>
3276                         <field name="format" reporter:datatype="link"/>
3277                         <field name="first_word" reporter:datatype="bool" />
3278                 </fields>
3279                 <links/>
3280         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3281             <actions>
3282                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3283                 <retrieve/>
3284                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3285                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3286             </actions>
3287         </permacrud>
3288         </class>
3289         <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">
3290                 <fields oils_persist:primary="code" oils_persist:sequence="">
3291                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3292                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3293                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297             <actions>
3298                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3299                 <retrieve/>
3300                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3301                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3302             </actions>
3303         </permacrud>
3304         </class>
3305         <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">
3306                 <fields oils_persist:primary="code" oils_persist:sequence="">
3307                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3308                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3309                 </fields>
3310                 <links/>
3311         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3312             <actions>
3313                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3314                 <retrieve/>
3315                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3316                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3317             </actions>
3318         </permacrud>
3319         </class>
3320     <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">
3321         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3322             <field reporter:label="ID" name="id" reporter:datatype="id" />
3323             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3324             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3325             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3326             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3327             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3328             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3329             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3330                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3331         </fields>
3332         <links>
3333             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3334             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3335             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3336                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3337         </links>
3338         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3339             <actions>
3340                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3341                 <retrieve/>
3342                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3343                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3344             </actions>
3345         </permacrud>
3346     </class>
3347     <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">
3348         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3349             <field reporter:label="ID" name="id" reporter:datatype="id" />
3350             <field reporter:label="Course" name="course" reporter:datatype="link" />
3351             <field reporter:label="User" name="usr" reporter:datatype="link" />
3352             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3353         </fields>
3354         <links>
3355             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3356             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3357             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3358         </links>
3359         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3360             <actions>
3361                 <create permission="MANAGE_RESERVES">
3362                                         <context link="course" field="owning_lib" />
3363                 </create>
3364                 <retrieve/>
3365                 <update permission="MANAGE_RESERVES">
3366                                         <context link="course" field="owning_lib" />
3367                 </update>
3368                 <delete permission="MANAGE_RESERVES">
3369                                         <context link="course" field="owning_lib" />
3370                 </delete>
3371             </actions>
3372         </permacrud>
3373     </class>
3374     <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">
3375         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3376             <field reporter:label="ID" name="id" reporter:datatype="id" />
3377             <field reporter:label="Course" name="course" reporter:datatype="link" />
3378             <field reporter:label="Item" name="item" reporter:datatype="link" />
3379             <field reporter:label="Record" name="record" reporter:datatype="link" />
3380             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3381             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3382             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3383             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3384             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3385             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3386             <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link" />
3387         </fields>
3388         <links>
3389             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3390             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3391             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3392             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3393             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3394             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3395             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3396             <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou" />
3397         </links>
3398         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3399             <actions>
3400                 <create permission="MANAGE_RESERVES">
3401                                         <context link="course" field="owning_lib" />
3402                 </create>
3403                 <retrieve/>
3404                 <update permission="MANAGE_RESERVES">
3405                                         <context link="course" field="owning_lib" />
3406                 </update>
3407                 <delete permission="MANAGE_RESERVES">
3408                                         <context link="course" field="owning_lib" />
3409                 </delete>
3410             </actions>
3411         </permacrud>
3412     </class>
3413         <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">
3414                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3415                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3416                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3417             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3418                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3419                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3420                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3421                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3422                 </fields>
3423                 <links>
3424             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3425                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3426                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3427                 </links>
3428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3429                         <actions>
3430                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3431                                 <retrieve/>
3432                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3433                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3434                         </actions>
3435                 </permacrud>
3436         </class>
3437     <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">
3438         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3439             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3440             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3441             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3442         </fields>
3443         <links>
3444             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3445             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3446         </links>
3447         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3448             <actions>
3449                 <create permission="MANAGE_RESERVES">
3450                                         <context link="course" field="owning_lib" />
3451                 </create>
3452                 <retrieve/>
3453                 <update permission="MANAGE_RESERVES">
3454                                         <context link="course" field="owning_lib" />
3455                 </update>
3456                 <delete permission="MANAGE_RESERVES">
3457                                         <context link="course" field="owning_lib" />
3458                 </delete>
3459             </actions>
3460         </permacrud>
3461     </class>
3462         <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">
3463                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3464                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3465                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3466             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3467                 </fields>
3468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3469                         <actions>
3470                                 <create permission="MANAGE_RESERVES" global_required="true" />
3471                                 <retrieve/>
3472                                 <update permission="MANAGE_RESERVES" global_required="true" />
3473                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3474                         </actions>
3475                 </permacrud>
3476         </class>
3477         
3478     <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">
3479         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3480             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3481             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3482             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3483             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3484         </fields>
3485         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3486             <actions>
3487                 <retrieve/>
3488             </actions>
3489         </permacrud>
3490     </class>
3491         <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">
3492                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3493                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3494                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3495                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3496                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3497                 </fields>
3498                 <links>
3499                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3500                 </links>
3501         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3502             <actions>
3503                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3504                 <retrieve/>
3505                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3506                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3507             </actions>
3508         </permacrud>
3509         </class>
3510         <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">
3511                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3512                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3513                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3514                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3515                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3516                 </fields>
3517                 <links>
3518                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3519                 </links>
3520         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3521             <actions>
3522                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3523                 <retrieve/>
3524                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3525                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3526             </actions>
3527         </permacrud>
3528         </class>
3529         <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">
3530                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3531                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3532                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3533                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3534                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3535                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3536                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3537                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3538                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3539                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3540                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3541                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3542                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3543                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3544                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3545                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3546                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3547                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3548                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3549                 </fields>
3550                 <links>
3551                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3552                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3553                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3554                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3555                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3556                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3557                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3558                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3559                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3560                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3561                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3562                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3563                 </links>
3564         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3565             <actions>
3566                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3567                 <retrieve/>
3568                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3569                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3570             </actions>
3571         </permacrud>
3572         </class>
3573         <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">
3574                 <fields oils_persist:primary="call_number">
3575                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3576                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3577                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3578                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3579                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3580                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3581                 </fields>
3582                 <links>
3583                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3584                 </links>
3585         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3586             <actions>
3587                 <retrieve/>
3588             </actions>
3589         </permacrud>
3590         </class>
3591         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3592                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3593                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3594                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3595                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3596                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3597                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3598                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3599                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3600                 </fields>
3601                 <links>
3602                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3603                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3604         </links>
3605         </class>
3606         <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">
3607                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3608                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3609                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3610                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3611                 </fields>
3612                 <links>
3613                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3614                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3615                 </links>
3616         </class>
3617         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3618                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3619                         <field name="id" reporter:datatype="id" />
3620                         <field name="value" oils_persist:i18n="true" />
3621                 </fields>
3622                 <links/>
3623         </class>
3624         <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">
3625                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3626                         <field name="balance_owed" reporter:datatype="money" />
3627                         <field name="total_owed" reporter:datatype="money" />
3628                         <field name="total_paid" reporter:datatype="money" />
3629                         <field name="usr" reporter:datatype="link"/>
3630                 </fields>
3631                 <links>
3632                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3633         </links>
3634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3635             <actions>
3636                 <retrieve permission="VIEW_USER">
3637                     <context link="usr" field="home_ou"/>
3638                 </retrieve>
3639             </actions>
3640         </permacrud>
3641         </class>
3642         <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">
3643                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3644                         <field name="balance_owed" reporter:datatype="money" />
3645                         <field name="total_owed" reporter:datatype="money" />
3646                         <field name="total_paid" reporter:datatype="money" />
3647                         <field name="usr" reporter:datatype="link"/>
3648                 </fields>
3649                 <links>
3650                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3651         </links>
3652         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3653             <actions>
3654                 <retrieve permission="VIEW_USER">
3655                     <context link="usr" field="home_ou"/>
3656                 </retrieve>
3657             </actions>
3658         </permacrud>
3659         </class>
3660         <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">
3661                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3662                         <field name="collector" />
3663                         <field name="enter_time" reporter:datatype="timestamp"/>
3664                         <field name="id" reporter:datatype="id" />
3665                         <field name="location" reporter:datatype="link"/>
3666                         <field name="usr" reporter:datatype="link"/>
3667                 </fields>
3668                 <links>
3669                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3670                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3671                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3672                 </links>
3673         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3674             <actions>
3675                 <create permission="money.collections_tracker.create" context_field="location"/>
3676                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3677                 <delete permission="money.collections_tracker.create" context_field="location"/>
3678             </actions>
3679         </permacrud>
3680         </class>
3681         <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">
3682                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3683                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3684                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3685                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3686                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3687                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3688                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3689                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3690                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3691                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3692                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3693                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3694                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3695                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3696                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3697                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3698                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3699                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3700                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3701                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3704                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3705                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3706                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3707                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3708                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3709                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3710                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3711                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3712                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3713                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3714                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3715                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3716                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3717                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3718                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3719                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3720                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3721                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3722                 </fields>
3723                 <links>
3724                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3725                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3726                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3727                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3728                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3729                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3730                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3731                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3732                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3733                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3734                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3735                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3736                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3737                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3738                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3739                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3740                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3741                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3742                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3743                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3744                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3745                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3746                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3747                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3748                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3749                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3750                 </links>
3751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3752             <actions>
3753                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3754                 <retrieve/>
3755                 <update permission="UPDATE_MARC" global_required="true"/>
3756                 <!-- 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. -->
3757                 <delete permission="DELETE_RECORD" global_required="true"/>
3758             </actions>
3759         </permacrud>
3760         </class>
3761         <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">
3762                 <fields oils_persist:primary="id">
3763                         <field name="dow_0_close" />
3764                         <field name="dow_0_open" />
3765                         <field name="dow_0_note"  reporter:datatype="text" />
3766                         <field name="dow_1_close" />
3767                         <field name="dow_1_open" />
3768                         <field name="dow_1_note"  reporter:datatype="text" />
3769                         <field name="dow_2_close" />
3770                         <field name="dow_2_open" />
3771                         <field name="dow_2_note"  reporter:datatype="text" />
3772                         <field name="dow_3_close" />
3773                         <field name="dow_3_open" />
3774                         <field name="dow_3_note"  reporter:datatype="text" />
3775                         <field name="dow_4_close" />
3776                         <field name="dow_4_open" />
3777                         <field name="dow_4_note"  reporter:datatype="text" />
3778                         <field name="dow_5_close" />
3779                         <field name="dow_5_open" />
3780                         <field name="dow_5_note"  reporter:datatype="text" />
3781                         <field name="dow_6_close" />
3782                         <field name="dow_6_open" />
3783                         <field name="dow_6_note"  reporter:datatype="text" />
3784                         <field name="id" reporter:datatype="id" />
3785                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3786                 </fields>
3787                 <links>
3788                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3789                 </links>
3790         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3791             <actions>
3792                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3793                 <retrieve/>
3794                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3795                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3796             </actions>
3797         </permacrud>
3798         </class>
3799         <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">
3800                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3801                         <field name="id" reporter:datatype="id" />
3802                         <field name="record" reporter:datatype="link"/>
3803                         <field name="label" reporter:datatype="text"/>
3804                         <field name="label_sortkey" reporter:datatype="text"/>
3805                         <field name="deleted" reporter:datatype="bool"/>
3806                 </fields>
3807                 <links>
3808                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3809                 </links>
3810         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3811             <actions>
3812                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3813                 <retrieve/>
3814                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3815                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3816             </actions>
3817         </permacrud>
3818         </class>
3819         <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">
3820                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3821                         <field name="id" reporter:datatype="id" />
3822                         <field name="target_copy" reporter:datatype="link" />
3823                         <field name="part" reporter:datatype="link"/>
3824                 </fields>
3825                 <links>
3826                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3827                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3828                 </links>
3829         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3830             <actions>
3831                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3832                 <retrieve/>
3833                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3834                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3835             </actions>
3836         </permacrud>
3837         </class>
3838     <class  id="aecc"
3839             controller="open-ils.cstore open-ils.pcrud"
3840             oils_obj:fieldmapper="action::emergency_closing_circulation"
3841             oils_persist:tablename="action.emergency_closing_circulation"
3842             reporter:label="Emergency Closing Circulation Entry"
3843             oils_persist:readonly="true"
3844     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3845         <fields oils_persist:primary="id">
3846             <field name="id" reporter:datatype="id" />
3847             <field name="circulation" reporter:datatype="link" />
3848                         <field name="emergency_closing" reporter:datatype="link"/>
3849             <field name="original_due_date" reporter:datatype="timestamp" />
3850             <field name="process_time" reporter:datatype="timestamp" />
3851         </fields>
3852         <links>
3853             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3854             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3855         </links>
3856         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3857             <actions>
3858                 <retrieve/>
3859             </actions>
3860         </permacrud>
3861     </class>
3862     <class  id="aecr"
3863             controller="open-ils.cstore open-ils.pcrud"
3864             oils_obj:fieldmapper="action::emergency_closing_reservation"
3865             oils_persist:tablename="action.emergency_closing_reservation"
3866             reporter:label="Emergency Closing Reservation Entry"
3867             oils_persist:readonly="true"
3868     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3869         <fields oils_persist:primary="id">
3870             <field name="id" reporter:datatype="id" />
3871             <field name="reservation" reporter:datatype="link" />
3872                         <field name="emergency_closing" reporter:datatype="link"/>
3873             <field name="original_end_time" reporter:datatype="timestamp" />
3874             <field name="process_time" reporter:datatype="timestamp" />
3875         </fields>
3876         <links>
3877             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3878             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3879         </links>
3880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3881             <actions>
3882                 <retrieve/>
3883             </actions>
3884         </permacrud>
3885     </class>
3886     <class  id="aech"
3887             controller="open-ils.cstore open-ils.pcrud"
3888             oils_obj:fieldmapper="action::emergency_closing_hold"
3889             oils_persist:tablename="action.emergency_closing_hold"
3890             reporter:label="Emergency Closing Hold Entry"
3891             oils_persist:readonly="true"
3892     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3893         <fields oils_persist:primary="id">
3894             <field name="id" reporter:datatype="id" />
3895             <field name="hold" reporter:datatype="link" />
3896                         <field name="emergency_closing" reporter:datatype="link"/>
3897             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3898             <field name="process_time" reporter:datatype="timestamp" />
3899         </fields>
3900         <links>
3901             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3902             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3903         </links>
3904         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3905             <actions>
3906                 <retrieve/>
3907             </actions>
3908         </permacrud>
3909     </class>
3910     <class  id="aecs"
3911             controller="open-ils.cstore open-ils.pcrud"
3912             oils_obj:fieldmapper="action::emergency_closing_status"
3913             oils_persist:tablename="action.emergency_closing_status"
3914             reporter:label="Emergency Closing Status"
3915             oils_persist:readonly="true"
3916     >
3917         <fields oils_persist:primary="id">
3918             <field name="id" reporter:datatype="id" />
3919             <field name="creator" reporter:datatype="link" />
3920             <field name="create_time" reporter:datatype="timestamp" />
3921             <field name="process_start_time" reporter:datatype="timestamp" />
3922             <field name="process_end_time" reporter:datatype="timestamp" />
3923             <field name="last_update_time" reporter:datatype="timestamp" />
3924             <field name="circulations" reporter:datatype="int" />
3925             <field name="circulations_complete" reporter:datatype="int" />
3926             <field name="reservations" reporter:datatype="int" />
3927             <field name="reservations_complete" reporter:datatype="int" />
3928             <field name="holds" reporter:datatype="int" />
3929             <field name="holds_complete" reporter:datatype="int" />
3930         </fields>
3931         <links>
3932             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3933         </links>
3934         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3935             <actions>
3936                 <retrieve/>
3937             </actions>
3938         </permacrud>
3939     </class>
3940     <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">
3941         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3942             <field name="id" reporter:datatype="id" />
3943             <field name="creator" reporter:datatype="link" />
3944             <field name="create_time" reporter:datatype="timestamp" />
3945             <field name="process_start_time" reporter:datatype="timestamp" />
3946             <field name="process_end_time" reporter:datatype="timestamp" />
3947             <field name="last_update_time" reporter:datatype="timestamp" />
3948             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3949             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3950             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3951             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3952             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3953         </fields>
3954         <links>
3955             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3956             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3957             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3958             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3959             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3960             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3961         </links>
3962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3963             <actions>
3964                 <create permission="EMERGENCY_CLOSING">
3965                     <context link="closing" field="org_unit" />
3966                 </create>
3967                 <retrieve/>
3968                 <update permission="EMERGENCY_CLOSING">
3969                     <context link="closing" field="org_unit" />
3970                 </update>
3971                 <delete permission="EMERGENCY_CLOSING">
3972                     <context link="closing" field="org_unit" />
3973                 </delete>
3974             </actions>
3975         </permacrud>
3976     </class>
3977         <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">
3978                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3979                         <field name="close_end" reporter:datatype="timestamp" />
3980                         <field name="close_start" reporter:datatype="timestamp" />
3981                         <field name="id" reporter:datatype="id" />
3982                         <field name="org_unit" reporter:datatype="org_unit"/>
3983                         <field name="reason" reporter:datatype="text"/>
3984                         <field name="full_day" reporter:datatype="bool"/>
3985                         <field name="multi_day" reporter:datatype="bool"/>
3986                         <field name="emergency_closing" reporter:datatype="link"/>
3987                 </fields>
3988                 <links>
3989                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3990                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3991                 </links>
3992         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3993             <actions>
3994                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3995                 <retrieve/>
3996                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3997                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3998             </actions>
3999         </permacrud>
4000         </class>
4001         <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">
4002                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
4003                         <field name="extended" reporter:datatype="interval"/>
4004                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
4005                         <field name="max_renewals" reporter:datatype="int" />
4006                         <field name="name" reporter:datatype="text"/>
4007                         <field name="normal" reporter:datatype="interval"/>
4008                         <field name="shrt" reporter:datatype="interval"/>
4009                         <field name="max_auto_renewals" reporter:datatype="int" />
4010                 </fields>
4011                 <links>
4012                 </links>
4013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4014             <actions>
4015                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4016                 <retrieve/>
4017                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4018                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4019             </actions>
4020         </permacrud>
4021         </class>
4022
4023         <class id="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">
4024                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4025                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4026                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4027             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4028                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4029             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4030                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4031                                 reporter:datatype="link" config_field="true"/>
4032                 </fields>
4033                 <links>
4034             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4035                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4036                 </links>
4037                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4038             <actions>
4039                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4040                 <retrieve/>
4041                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4042                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4043             </actions>
4044                 </permacrud>
4045         </class>
4046
4047         <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">
4048                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4049                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4050                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4051                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4052             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4053                 </fields>
4054                 <links>
4055                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4056                 </links>
4057                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4058             <actions>
4059                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4060                 <retrieve/>
4061                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4062                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4063             </actions>
4064                 </permacrud>
4065         </class>
4066
4067         <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">
4068                 <fields oils_persist:primary="id" oils_persist:sequence="">
4069                         <field name="balance_owed" reporter:datatype="money"/>
4070                         <field name="id" reporter:datatype="id" />
4071                         <field name="last_billing_note" reporter:datatype="text"/>
4072                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4073                         <field name="last_billing_type" reporter:datatype="text"/>
4074                         <field name="last_payment_note" reporter:datatype="text"/>
4075                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4076                         <field name="last_payment_type" reporter:datatype="text"/>
4077                         <field name="total_owed" reporter:datatype="money"/>
4078                         <field name="total_paid" reporter:datatype="money"/>
4079                         <field name="usr" reporter:datatype="link"/>
4080                         <field name="xact_finish" reporter:datatype="timestamp" />
4081                         <field name="xact_start" reporter:datatype="timestamp" />
4082                         <field name="xact_type" reporter:datatype="text"/>
4083                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4084                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4085                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4086                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4087                         <field name="billing_location" reporter:datatype="link"/>
4088                 </fields>
4089                 <links>
4090                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4091                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4092                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4093                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4094                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4095                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4096                 </links>
4097                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4098                         <actions>
4099                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4100                                         <context link="usr" field="home_ou" />
4101                                 </retrieve>
4102                         </actions>
4103                 </permacrud>
4104         </class>
4105         <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">
4106                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4107                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4108                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4109                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4110                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4111                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4112                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4113                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4115                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4116                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4117                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4118                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4119                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4120                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4121                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4122                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4123                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4124                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4125                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4126                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4127                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4128                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4129                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4130                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4131                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4132                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4133                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4134                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4135                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4136                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4137                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4138                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4139                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4140                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4141                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4142                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4143                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4144                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4145                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4146                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4147                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4148                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4149                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4150                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4151                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4152                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4153                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4154                         <field reporter:label="OPAC/Staff Client Username" name="usrname"  reporter:datatype="text"/>
4155                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4156                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4157                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4158                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4159                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4160                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4161                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4162                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4163                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4164                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4165                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4166                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4167                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4168                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4169                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4170                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4171                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4172                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4173                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4174                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4175                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4176                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4177                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4178                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4179             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4180                 </fields>
4181                 <links>
4182                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4183                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4184                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4185                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4186                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4187                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4188                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4189                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4190                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4191                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4192                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4193                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4194                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4195                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4196                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4197                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4198                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4199                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4200                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4201                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4202                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4203                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4204                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4205                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4206                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4207                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4208                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4209                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4210                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4211                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4212                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4213                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4214             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4215                 </links>
4216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4217                         <actions>
4218                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4219                         </actions>
4220                 </permacrud>
4221         </class>
4222         <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">
4223                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4224                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4225                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4226                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4227                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4228                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4229                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4230                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4231                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4232         </fields>
4233                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4234                         <actions>
4235                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4236                                 <retrieve/>
4237                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4238                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4239                         </actions>
4240                 </permacrud>
4241         </class>
4242         <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">
4243                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4244                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4245                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4246                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4247                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4248         </fields>
4249         <links>
4250                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4251                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4252                 </links>
4253                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4254                         <actions>
4255                                 <retrieve permission="RUN_REPORTS">
4256                                         <context link="usr" field="home_ou" />
4257                                 </retrieve>
4258                         </actions>
4259                 </permacrud>
4260         </class>
4261         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4262                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4263                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4264                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4265                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4266                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4267                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4268                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4269         </fields>
4270         <links>
4271                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4272                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4273                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4274                 </links>
4275                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4276                         <actions>
4277                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4278                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4279                                         <context link="usr" field="home_ou" />
4280                                         <context link="ws" field="owning_lib" />
4281                                 </retrieve>
4282                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4283                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4284                         </actions>
4285                 </permacrud>
4286         </class>
4287         <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">
4288                 <fields oils_persist:primary="name">
4289                         <field name="name" reporter:datatype="text"/>
4290                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4291                 </fields>
4292                 <links/>
4293                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4294                         <actions>
4295                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4296                                 <retrieve/>
4297                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4298                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4299                         </actions>
4300                 </permacrud>
4301         </class>
4302         <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">
4303                 <fields oils_persist:primary="name">
4304                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4305                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4306                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4307                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4308                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4309                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4310                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4311                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4312                 </fields>
4313                 <links>
4314                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4315                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4316                 </links>
4317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4318                         <actions>
4319                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4320                                 <retrieve/>
4321                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4322                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4323                         </actions>
4324                 </permacrud>
4325         </class>
4326         <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">
4327                 <fields oils_persist:primary="name">
4328                         <field name="name" reporter:datatype="text"/>
4329                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4330                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4331                         <field name="datatype" reporter:datatype="text"/>
4332                         <field name="view_perm" reporter:datatype="link"/>
4333                         <field name="update_perm" reporter:datatype="link"/>
4334                         <field name="fm_class" reporter:datatype="text"/>
4335                         <field name="grp" reporter:datatype="link"/>
4336                 </fields>
4337                 <links>
4338                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4339                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4340                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4341                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4342                 </links>
4343                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4344                         <actions>
4345                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4346                                 <retrieve/>
4347                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4348                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4349                         </actions>
4350                 </permacrud>
4351         </class>
4352         <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">
4353                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4354                         <field name="id" />
4355                         <field name="name"  reporter:datatype="text"/>
4356                         <field name="org_unit" reporter:datatype="org_unit"/>
4357                         <field name="value"  reporter:datatype="text"/>
4358                 </fields>
4359                 <links>
4360                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4361                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4362                 </links>
4363         </class>
4364         <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">
4365                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4366                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4367                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4368                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4369                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4370                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4371                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4372                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4373                 </fields>
4374                 <links>
4375                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4376                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4377                 </links>
4378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4379             <actions>
4380                 <create permission="CREATE_COPY_NOTE">
4381                     <context link="owning_copy" field="circ_lib"/>
4382                 </create>
4383                 <retrieve permission="VIEW_COPY_NOTES">
4384                     <context link="owning_copy" field="circ_lib"/>
4385                 </retrieve>
4386                 <update permission="UPDATE_COPY_NOTE">
4387                     <context link="owning_copy" field="circ_lib"/>
4388                 </update>
4389                 <delete permission="DELETE_COPY_NOTE">
4390                     <context link="owning_copy" field="circ_lib"/>
4391                 </delete>
4392             </actions>
4393         </permacrud>
4394         </class>
4395         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4396                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4397                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4398                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4399                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4400                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4401                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4402                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4403                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4404                 </fields>
4405                 <links>
4406                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4407                 </links>
4408         </class>
4409         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4410                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4411                         <field name="fingerprint"  reporter:datatype="text"/>
4412                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4413                         <field name="master_record" reporter:datatype="link"/>
4414                         <field name="mods"  reporter:datatype="text"/>
4415                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4416                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4417                 </fields>
4418                 <links>
4419                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4420                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4421                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4422                 </links>
4423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4424                         <actions>
4425                                 <retrieve/>
4426                         </actions>
4427                 </permacrud>
4428         </class>
4429         <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">
4430                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4431                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4432                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4433                 </fields>
4434                 <links/>
4435         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4436             <actions>
4437                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4438                 <retrieve/>
4439                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4440                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4441             </actions>
4442         </permacrud>
4443         </class>
4444         <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">
4445                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4446                         <field name="code"  reporter:datatype="text"/>
4447                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4448                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4449                 </fields>
4450                 <links/>
4451         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4452             <actions>
4453                 <create permission="CREATE_PERM" global_required="true"/>
4454                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4455                 <update permission="UPDATE_PERM" global_required="true"/>
4456                 <delete permission="DELETE_PERM" global_required="true"/>
4457             </actions>
4458         </permacrud>
4459         </class>
4460         <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">
4461                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4462                         <field name="id" reporter:datatype="id" />
4463                         <field name="metarecord" reporter:datatype="link"/>
4464                         <field name="source" reporter:datatype="link"/>
4465                 </fields>
4466                 <links>
4467                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4468                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4469                 </links>
4470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4471                         <actions>
4472                                 <retrieve/>
4473                         </actions>
4474                 </permacrud>
4475         </class>
4476         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4477                         oils_obj:fieldmapper="metabib::display_entry" 
4478                         oils_persist:tablename="metabib.display_entry" 
4479                         oils_persist:field_safe="true"
4480                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4481                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4482                         <field name="id" reporter:datatype="id" />
4483                         <field name="field" reporter:datatype="link"/>
4484                         <field name="source" reporter:datatype="link"/>
4485                         <field name="value"  reporter:datatype="text"/>
4486                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4487                 </fields>
4488                 <links>
4489                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4490                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4491                 </links>
4492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4493                         <actions>
4494                                 <retrieve/>
4495                         </actions>
4496                 </permacrud>
4497         </class>
4498         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4499                 oils_persist:tablename="metabib.flat_display_entry"
4500                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4501                 oils_persist:field_safe="true"
4502                 reporter:label="Flat Display Entry" 
4503                 oils_persist:readonly="true">
4504                 <fields>
4505                         <field name="source" reporter:datatype="id" />
4506                         <field name="name" reporter:datatype="text"/>
4507                         <field name="multi" reporter:datatype="bool"/>
4508                         <field name="label" reporter:datatype="text"/>
4509                         <field name="field" reporter:datatype="link"/>
4510                         <field name="value" reporter:datatype="text"/>
4511                 </fields>
4512                 <links>
4513                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4514                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4515                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4516                 </links>
4517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4518                         <actions>
4519                                 <retrieve/>
4520                         </actions>
4521                 </permacrud>
4522         </class>
4523         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4524                 oils_persist:tablename="metabib.compressed_display_entry"
4525                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4526                 oils_persist:field_safe="true"
4527                 reporter:label="Compressed Display Entry" 
4528                 oils_persist:readonly="true">
4529                 <fields>
4530                         <field name="source" reporter:datatype="id" />
4531                         <field name="name" reporter:datatype="text"/>
4532                         <field name="multi" reporter:datatype="bool"/>
4533                         <field name="label" reporter:datatype="text"/>
4534                         <field name="field" reporter:datatype="link"/>
4535                         <field name="value" reporter:datatype="text"/>
4536                 </fields>
4537                 <links>
4538                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4539                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4540                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4541                 </links>
4542                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4543                         <actions>
4544                                 <retrieve/>
4545                         </actions>
4546                 </permacrud>
4547         </class>
4548         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4549                 oils_persist:tablename="metabib.wide_display_entry"
4550                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4551                 oils_persist:field_safe="true"
4552                 reporter:label="Wide Display Entry" 
4553                 oils_persist:readonly="true">
4554                 <fields oils_persist:primary="source">
4555                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4556                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4557                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4558                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4559                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4560                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4561                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4562                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4563                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4564                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4565                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4566                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4567                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4568                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4569                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4570                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4571                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4572                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4573                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4574                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4575                 </fields>
4576                 <links>
4577                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4578                 </links>
4579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4580                         <actions>
4581                                 <retrieve/>
4582                         </actions>
4583                 </permacrud>
4584         </class>
4585
4586         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4587                 oils_persist:tablename="config.display_field_map"
4588                 oils_obj:fieldmapper="config::display_field_map"
4589                 oils_persist:field_safe="true"
4590                 reporter:label="Display Field Map">
4591                 <fields oils_persist:primary="name">
4592                         <field name="name" reporter:datatype="text"/>
4593                         <field name="field" reporter:datatype="link"/>
4594                         <field name="multi" reporter:datatype="bool"/>
4595                 </fields>
4596                 <links>
4597                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4598                 </links>
4599                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4600                         <actions>
4601                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4602                                 <retrieve/>
4603                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4604                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4605                         </actions>
4606                 </permacrud>
4607         </class>
4608
4609         <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">
4610                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4611                         <field name="id" reporter:datatype="id" />
4612                         <field name="field" reporter:datatype="link"/>
4613                         <field name="source" reporter:datatype="link"/>
4614                         <field name="value"  reporter:datatype="text"/>
4615                 </fields>
4616                 <links>
4617                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4618                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4619                 </links>
4620         </class>
4621         <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">
4622                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4623                         <field name="id" reporter:datatype="id" />
4624                         <field name="value" reporter:datatype="text"/>
4625                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4626                 </fields>
4627                 <links>
4628                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4629                 </links>
4630                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4631                         <actions>
4632                                 <retrieve/>
4633                         </actions>
4634                 </permacrud>
4635         </class>
4636         <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">
4637                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4638                         <field name="id" reporter:datatype="id" />
4639                         <field name="entry" reporter:datatype="link"/>
4640                         <field name="def" reporter:datatype="link"/>
4641                         <field name="source" reporter:datatype="link"/>
4642                 </fields>
4643                 <links>
4644                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4645                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4646                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4647                 </links>
4648         </class>
4649         <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">
4650                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4651                         <field name="id" reporter:datatype="id" />
4652                         <field name="entry" reporter:datatype="link"/>
4653                         <field name="simple_heading" reporter:datatype="link"/>
4654                 </fields>
4655                 <links>
4656                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4657                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4658                 </links>
4659         </class>
4660         <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">
4661                 <oils_persist:source_definition><![CDATA[
4662                         SELECT * FROM metabib.author_field_entry
4663                                                 UNION ALL
4664                         SELECT * FROM metabib.keyword_field_entry
4665                                                 UNION ALL
4666                         SELECT * FROM metabib.identifier_field_entry
4667                                                 UNION ALL
4668                         SELECT * FROM metabib.title_field_entry
4669                                                 UNION ALL
4670                         SELECT * FROM metabib.subject_field_entry
4671                                                 UNION ALL
4672                         SELECT * FROM metabib.series_field_entry
4673                 ]]></oils_persist:source_definition>
4674                 <fields>
4675                         <field name="field" reporter:datatype="link"/>
4676                         <field name="id" reporter:datatype="id" />
4677                         <field name="source" reporter:datatype="link"/>
4678                         <field name="value"  reporter:datatype="text"/>
4679                 </fields>
4680                 <links>
4681                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4682                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4683                 </links>
4684         </class>
4685         <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">
4686                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4687                         <field name="field" reporter:datatype="link"/>
4688                         <field name="id" reporter:datatype="id" />
4689                         <field name="source" reporter:datatype="link"/>
4690                         <field name="value"  reporter:datatype="text"/>
4691                 </fields>
4692                 <links>
4693                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4694                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4695                 </links>
4696         </class>
4697         <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">
4698                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4699                         <field name="accepting_usr" reporter:datatype="link"/>
4700                         <field name="amount" reporter:datatype="money" />
4701                         <field name="amount_collected" reporter:datatype="money" />
4702                         <field name="cash_drawer" reporter:datatype="link"/>
4703                         <field name="id" reporter:datatype="id" />
4704                         <field name="note"  reporter:datatype="text"/>
4705                         <field name="payment_ts" reporter:datatype="timestamp"/>
4706                         <field name="xact" reporter:datatype="link"/>
4707                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4708                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4709                 </fields>
4710                 <links>
4711                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4712                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4713                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4714                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4715                 </links>
4716         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4717             <actions>
4718                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4719                     <context link="xact" jump="usr" field="home_ou"/>
4720                 </retrieve>
4721                         </actions>
4722                 </permacrud>
4723         </class>
4724         <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">
4725                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4726                         <field name="accepting_usr" reporter:datatype="link"/>
4727                         <field name="amount" reporter:datatype="money" />
4728                         <field name="amount_collected" reporter:datatype="money" />
4729                         <field name="id" reporter:datatype="id" />
4730                         <field name="note"  reporter:datatype="text"/>
4731                         <field name="payment_ts" reporter:datatype="timestamp"/>
4732                         <field name="xact" reporter:datatype="link"/>
4733                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4734                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4735                 </fields>
4736                 <links>
4737                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4738                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4739                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4740                 </links>
4741         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4742             <actions>
4743                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4744                     <context link="xact" jump="usr" field="home_ou"/>
4745                 </retrieve>
4746                         </actions>
4747                 </permacrud>
4748         </class>
4749         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4750                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4751                         <field name="accepting_usr" reporter:datatype="link"/>
4752                         <field name="amount" reporter:datatype="money" />
4753                         <field name="amount_collected" reporter:datatype="money" />
4754                         <field name="id" reporter:datatype="id" />
4755                         <field name="note"  reporter:datatype="text"/>
4756                         <field name="payment_ts" reporter:datatype="timestamp"/>
4757                         <field name="xact" reporter:datatype="link"/>
4758                         <field name="billing" reporter:datatype="link"/>
4759                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4760                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4761                 </fields>
4762                 <links>
4763                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4764                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4765                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4766                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4767                 </links>
4768         </class>
4769         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4770                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4771                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4772                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4773                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4774                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4775                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4776                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4777                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4778                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4779                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4780                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4781                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4782                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4783                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4784                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4785                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4786                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4787                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4788                 </fields>
4789                 <links>
4790                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4791                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4792                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4793                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4794                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4795                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4796                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4797                 </links>
4798         </class>
4799
4800         <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">
4801                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4802                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4803                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4804                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4805                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4806                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4807                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4808                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4809                 </fields>
4810                 <links/>
4811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4812             <actions>
4813                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4814                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4815                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4816                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4817             </actions>
4818         </permacrud>
4819         </class>
4820         <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">
4821                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4822                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4823                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4824                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4825                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4826                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4827                 </fields>
4828                 <links>
4829                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4830                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4831                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4832         </links>
4833         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4834             <actions>
4835                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4836                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4837                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4838                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4839             </actions>
4840         </permacrud>
4841         </class>
4842         <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">
4843                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4844                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4845                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4846                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4847                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4848             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4849             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4850             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4851             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4852                 </fields>
4853                 <links/>
4854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4855             <actions>
4856                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4857                 <retrieve/>
4858                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4859                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4860             </actions>
4861         </permacrud>
4862         </class>
4863         <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">
4864                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4865                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4866                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4867                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4868                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4869                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4870                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4871                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4872                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4873                 </fields>
4874                 <links>
4875                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4876                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4877                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4878                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4879                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4880                 </links>
4881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4882                         <actions>
4883                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4884                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4885                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4886                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4887                         </actions>
4888                 </permacrud>
4889         </class>
4890         <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">
4891                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4892                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4893                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4894                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4895                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4896                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4897                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4898                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4899                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4900                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4901                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4902                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4903                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4904                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4905                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4906                 </fields>
4907                 <links>
4908                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4909                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4910                 </links>
4911                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4912                         <actions>
4913                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4914                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4915                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4916                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4917                         </actions>
4918                 </permacrud>
4919         </class>
4920         <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">
4921                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4922                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4923                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4924                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4925                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4926                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4927                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4928                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4929                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4930                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4931                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4932                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4933                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4934                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4935                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4936                 </fields>
4937                 <links>
4938                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4939                 </links>
4940                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4941                         <actions>
4942                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4943                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4944                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4945                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4946                         </actions>
4947                 </permacrud>
4948         </class>
4949
4950
4951         <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">
4952                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4953                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4954                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4955                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4956                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4957                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4958                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4959                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4960                 </fields>
4961                 <links>
4962                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4963                 </links>
4964         </class>
4965
4966         <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">
4967                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4968                         <field name="call_number" />
4969                         <field name="create_date" reporter:datatype="timestamp"/>
4970                         <field name="creator" reporter:datatype="link"/>
4971                         <field name="id" reporter:datatype="id" />
4972                         <field name="pub" reporter:datatype="bool"/>
4973                         <field name="title"  reporter:datatype="text"/>
4974                         <field name="value"  reporter:datatype="text"/>
4975                 </fields>
4976                 <links>
4977                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4978                 </links>
4979         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4980             <actions>
4981                 <create permission="CREATE_VOLUME_NOTE">
4982                     <context link="call_number" field="owning_lib"/>
4983                 </create>
4984                 <retrieve permission="VIEW_VOLUME_NOTES">
4985                     <context link="call_number" field="owning_lib"/>
4986                 </retrieve>
4987                 <update permission="UPDATE_VOLUME_NOTE">
4988                     <context link="call_number" field="owning_lib"/>
4989                 </update>
4990                 <delete permission="DELETE_VOLUME_NOTE">
4991                     <context link="call_number" field="owning_lib"/>
4992                 </delete>
4993             </actions>
4994         </permacrud>
4995         </class>
4996         <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">
4997                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4998                         <field name="create_date" reporter:datatype="timestamp"/>
4999                         <field name="creator" reporter:datatype="link"/>
5000                         <field name="edit_date" reporter:datatype="timestamp"/>
5001                         <field name="editor" reporter:datatype="link"/>
5002                         <field name="id" reporter:datatype="id" />
5003                         <field name="record" reporter:datatype="link"/>
5004                         <field name="value" reporter:datatype="text"/>
5005                 </fields>
5006                 <links>
5007                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
5008                 </links>
5009         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5010             <actions>
5011                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5012                 <retrieve/>
5013                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5014                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5015             </actions>
5016         </permacrud>
5017         </class>
5018         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
5019         <oils_persist:source_definition><![CDATA[
5020 SELECT  usr,
5021         SUM(
5022             CASE
5023                 WHEN (
5024                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5025                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5026                 ) THEN 1
5027                 ELSE 0
5028             END
5029         ) AS out,
5030
5031         SUM(
5032             CASE
5033                 WHEN (
5034                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5035                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5036                 ) THEN 1
5037                 ELSE 0
5038             END
5039         ) AS overdue,
5040
5041         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5042         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5043         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5044   FROM  action.circulation
5045   WHERE checkin_time IS NULL
5046   GROUP BY 1
5047         ]]></oils_persist:source_definition>
5048         <fields oils_persist:primary="usr">
5049             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5050             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5051             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5052             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5053             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5054             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5055         </fields>
5056         <links>
5057             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5058         </links>
5059         </class>
5060         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5061         <oils_persist:source_definition><![CDATA[
5062 SELECT  usr,
5063         STRING_AGG(
5064             CASE
5065                 WHEN (
5066                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5067                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5068                 ) THEN id::TEXT
5069                 ELSE '0'
5070             END
5071         ,',') AS out,
5072
5073         STRING_AGG(
5074             CASE
5075                 WHEN (
5076                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5077                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5078                 ) THEN id::TEXT
5079                 ELSE '0'
5080             END
5081         ,',') AS overdue,
5082
5083         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5084         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5085         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5086   FROM  action.circulation
5087   WHERE checkin_time IS NULL
5088   GROUP BY 1
5089         ]]></oils_persist:source_definition>
5090         <fields oils_persist:primary="usr">
5091             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5092             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5093             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5094             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5095             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5096             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5097         </fields>
5098         <links>
5099             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5100         </links>
5101         </class>
5102         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5103                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5104                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5105                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5106                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5107                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5108                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5109                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5110                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5111                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5112                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5113                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5114                 </fields>
5115                 <links>
5116                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5117                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5118                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5119                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5120                 </links>
5121         </class>
5122         <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">
5123                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5124                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5125                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5126                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5127                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5128                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5129                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5130                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5131                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5132                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5133                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5134                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5135                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5136                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5137                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5138                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5139                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5140                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5141                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5142                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5143                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5144                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5145                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5146                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5147                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5148                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5149                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5150                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5151                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5152                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5153                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5154                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5155                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5156                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5157                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5158                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5159                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5160                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5161                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5162                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5163                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5164                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5165                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5166                 </fields>
5167                 <links>
5168                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5169                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5170                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5171                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5172                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5173                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5174                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5175                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5176                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5177                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5178                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5179                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5180                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5181                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5182                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5183                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5184                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5185                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5186                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5187                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5188                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5189                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5190                 </links>
5191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5192                         <actions>
5193                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5194                         </actions>
5195                 </permacrud>
5196         </class>
5197         <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">
5198                 <fields>
5199                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5200                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5201                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5202                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5203                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5204                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5205                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5206                 </fields>
5207                 <links>
5208                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5209                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5210                 </links>
5211                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5212                         <actions>
5213                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5214                         </actions>
5215                 </permacrud>
5216         </class>
5217         <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">
5218                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5219                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5220                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5221                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5222                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5223                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5224                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5225                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5226                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5227                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5228                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5229                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5230                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5231                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5232                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5233                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5234                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5235                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5236                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5237                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5238                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5239                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5240                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5241                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5242                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5243                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5244                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5245                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5246                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5247                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5248                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5249                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5250                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5251                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5252                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5253                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5254                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5255                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5256                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5257                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5258                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5259                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5260                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5261                 </fields>
5262                 <links>
5263                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5264                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5265                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5266                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5267                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5268                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5269                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5270                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5271                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5272                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5273                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5274                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5275                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5276                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5277                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5278                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5279                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5280                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5281                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5282                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5283                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5284                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5285                 </links>
5286                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5287                         <actions>
5288                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5289                         </actions>
5290                 </permacrud>
5291         </class>
5292
5293         <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">
5294                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5295                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5296                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5297                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5298                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5299                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5300                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5301                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5302                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5303                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5304                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5305                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5306                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5307                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5308                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5309                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5310                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5311                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5312                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5313                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5314                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5315                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5316                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5317                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5318                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5319                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5320                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5321                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5322                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5323                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5324                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5325                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5326                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5327                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5328                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5329                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5330                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5331                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5332                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5333                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5334                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5335                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5336                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5337                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5338                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5339                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5340                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5341                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5342                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5343                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5344                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5345                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5346                 </fields>
5347                 <links>
5348                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5349                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5350                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5351                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5352                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5353                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5354                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5355                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5356                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5357                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5358                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5359                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5360                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5361                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5362                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5363                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5364                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5365                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5366                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5367                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5368                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5369                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5370                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5371                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5372                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5373                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5374                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5375                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5376                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5377                 </links>
5378                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5379                         <actions>
5380                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5381                         </actions>
5382                 </permacrud>
5383         </class>
5384         <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">
5385                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5386                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5387                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5388                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5389                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5390                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5391                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5392                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5393                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5394                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5395                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5396                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5397                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5398                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5399                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5400                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5401                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5402                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5403                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5404                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5405                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5406                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5407                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5408                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5409                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5410                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5411                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5412                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5413                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5414                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5415                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5416                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5417                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5418                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5419                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5420                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5421                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5422                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5423                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5424                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5425                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5426                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5427                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5428                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5429                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5430                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5431                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5432                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5433                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5434                 </fields>
5435                 <links>
5436                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5437                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5438                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5439                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5440                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5441                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5442                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5443                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5444                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5445                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5446                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5447                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5448                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5449                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5450                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5451                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5452                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5453                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5454                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5455                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5456                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5457                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5458                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5459                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5460                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5461                 </links>
5462         </class>
5463         <class id="auch" 
5464                 controller="open-ils.cstore" 
5465                 oils_obj:fieldmapper="action::user_circ_history" 
5466                 oils_persist:tablename="action.usr_circ_history" 
5467                 reporter:label="User Checkout History">
5468                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5469                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5470                         <!-- prevent reporting on the user that owns the checkout history -->
5471                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5472                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5473                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5474                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5475                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5476                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5477                 </fields>
5478                 <links>
5479                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5480                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5481                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5482                 </links>
5483         </class>
5484         <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">
5485                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5486                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5487                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5488                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5489                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5490                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5491                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5492                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5493                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5494                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5495                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5496                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5497                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5498                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5499                 </fields>
5500                 <links>
5501                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5502                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5503                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5504                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5505                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5506                 </links>
5507                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5508                         <actions>
5509                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5510                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5511                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5512                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5513                         </actions>
5514                 </permacrud>
5515         </class>
5516
5517         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5518                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5519                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5520                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5521                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5522                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5523                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5524                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5525                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5526                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5527                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5528                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5529                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5530                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5531                 </fields>
5532                 <links>
5533                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5534                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5535                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5536                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5537                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5538                 </links>
5539                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5540                         <actions>
5541                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5542                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5543                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5544                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5545                         </actions>
5546                 </permacrud>
5547         </class>
5548         
5549         <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">
5550                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5551                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5552                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5553                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5554                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5555                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5556                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5557                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5558                 </fields>
5559                 <links>
5560                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5561                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5562                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5563                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5564                 </links>
5565                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5566                         <actions>
5567                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5568                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5569                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5570                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5571                         </actions>
5572                 </permacrud>
5573         </class>
5574         
5575         <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">
5576                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5577                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5578                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5579                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5580                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5581                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5582                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5583                 </fields>
5584                 <links>
5585                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5586                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5587                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5588                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5589                 </links>
5590                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5591                         <actions>
5592                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5593                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5594                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5595                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5596                         </actions>
5597                 </permacrud>
5598         </class>
5599         
5600         <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">
5601                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5602                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5603                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5604                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5605                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5606                 </fields>
5607                 <links>
5608                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5609                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5610                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5611                 </links>
5612                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5613                         <actions>
5614                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5615                     <context link="resource" field="owner" />
5616                 </create>
5617                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5618                     <context link="resource" field="owner" />
5619                 </retrieve>
5620                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5621                     <context link="resource" field="owner" />
5622                 </update>
5623                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5624                     <context link="resource" field="owner" />
5625                 </delete>
5626                         </actions>
5627                 </permacrud>
5628         </class>
5629         
5630         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5631                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5632                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5633                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5634                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5635                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5636                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5637                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5638                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5639                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5640                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5641                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5642                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5643                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5644                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5645                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5646                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5647                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5648                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5649                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5650                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5651                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5652                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5653                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5654                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5655                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5656                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5657                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5658                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5659                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5660                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5661                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5662                 </fields>
5663                 <links>
5664                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5665                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5666                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5667                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5668                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5669                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5670                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5671                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5672                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5673                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5674                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5675                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5676                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5677                 </links>
5678                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5679                         <actions>
5680                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5681                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5682                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5683                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5684                         </actions>
5685                 </permacrud>
5686         </class>
5687         
5688         <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">
5689                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5690                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5691                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5692                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5693                 </fields>
5694                 <links>
5695                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5696                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5697                 </links>
5698                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5699                         <actions>
5700                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5701                                         <context link="reservation" field="pickup_lib"/>
5702                                 </create>
5703                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5704                                         <context link="reservation" field="pickup_lib"/>
5705                                 </retrieve>
5706                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5707                                         <context link="reservation" field="pickup_lib"/>
5708                                 </update>
5709                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5710                                         <context link="reservation" field="pickup_lib"/>
5711                                 </delete>
5712                         </actions>
5713                 </permacrud>
5714         </class>
5715
5716         <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">
5717                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5718                         <field name="bucket" reporter:datatype="link"/>
5719                         <field name="id" reporter:datatype="id" />
5720                         <field name="target_call_number" reporter:datatype="link" />
5721                         <field name="create_time" reporter:datatype="timestamp" />
5722                         <field name="pos" reporter:datatype="int" />
5723                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5724                 </fields>
5725                 <links>
5726                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5727                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5728             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5729                 </links>
5730                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5731                         <actions>
5732                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5733                     <context link="bucket" field="owning_lib"/>
5734                 </retrieve>
5735             </actions>
5736         </permacrud>
5737         </class>
5738         <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">
5739                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5740                         <field name="id" reporter:datatype="id" />
5741                         <field name="item" reporter:datatype="link"/>
5742                         <field name="note" reporter:datatype="text" />
5743                 </fields>
5744                 <links>
5745                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5746                 </links>
5747         </class>
5748         <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">
5749                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5750                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5751                         <field name="btype" reporter:datatype="text"/>
5752                         <field name="id" reporter:datatype="id" />
5753                         <field name="name" reporter:datatype="text"/>
5754                         <field name="description" reporter:datatype="text"/>
5755                         <field name="owner" reporter:datatype="link"/>
5756                         <field name="pub" reporter:datatype="bool"/>
5757                         <field name="create_time" reporter:datatype="timestamp" />
5758                         <field name="owning_lib" reporter:datatype="org_unit" />
5759                 </fields>
5760                 <links>
5761                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5762                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5763                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5764                 </links>
5765                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5766                         <actions>
5767                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5768                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5769                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5770                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5771                         </actions>
5772                 </permacrud>
5773         </class>
5774         <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">
5775                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5776                         <field name="id" reporter:datatype="id" />
5777                         <field name="bucket" reporter:datatype="link"/>
5778                         <field name="note" reporter:datatype="text" />
5779                 </fields>
5780                 <links>
5781                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5782                 </links>
5783         </class>
5784         <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">
5785                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5786                         <field name="hold" reporter:datatype="link"/>
5787                         <field name="id" reporter:datatype="id" />
5788                         <field name="target_copy" reporter:datatype="link"/>
5789                         <field name="proximity" reporter:datatype="number"/>
5790                 </fields>
5791                 <links>
5792                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5793                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5794                 </links>
5795         </class>
5796         <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">
5797                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5798                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5799                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5800                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5801                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5802                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5803                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5804                 </fields>
5805                 <links>
5806                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5807                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5808                 </links>
5809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5810             <actions>
5811                 <create permission="CREATE_HOLD_NOTIFICATION">
5812                                         <context link="hold" jump="usr" field="home_ou" />
5813                                 </create>
5814                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5815                                         <context link="hold" jump="usr" field="home_ou" />
5816                                 </retrieve>
5817                 <update permission="CREATE_HOLD_NOTIFICATION">
5818                                         <context link="hold" jump="usr" field="home_ou" />
5819                                 </update>
5820                 <delete permission="CREATE_HOLD_NOTIFICATION">
5821                                         <context link="hold" jump="usr" field="home_ou" />
5822                                 </delete>
5823             </actions>
5824         </permacrud>
5825         </class>
5826         <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">
5827                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5828                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5829                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5830                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5831                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5832                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5833                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5834                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5835                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5836                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5837                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5838                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5839                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5840                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5841                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5842                 </fields>
5843                 <links>
5844                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5845                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5846                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5847                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5848                 </links>
5849         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5850             <actions>
5851                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5852                 <retrieve/>
5853                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5854                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5855             </actions>
5856         </permacrud>
5857         </class>
5858         <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">
5859                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5860                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5861                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5862                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5863                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5864             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5865             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5866             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5867                 </fields>
5868                 <links>
5869                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5870                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5871                 </links>
5872         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5873             <actions>
5874                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5875                 <retrieve/>
5876                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5877                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5878             </actions>
5879         </permacrud>
5880         </class>
5881         <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">
5882                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5883                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5884             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5885             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5886                 </fields>
5887                 <links>
5888                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5889                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5890                 </links>
5891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5892             <actions>
5893                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5894                                         <context link="lgroup" field="owner" />
5895                 </create>
5896                 <retrieve/>
5897                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5898                                         <context link="lgroup" field="owner" />
5899                 </update>
5900                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5901                                         <context link="lgroup" field="owner" />
5902                 </delete>
5903             </actions>
5904         </permacrud>
5905         </class>
5906
5907     <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">
5908         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5909             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5910             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5911             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5912             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5913         </fields>
5914         <links>
5915             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5916             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5917         </links>
5918         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5919             <actions>
5920                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5921                 <retrieve/>
5922                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5923                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5924             </actions>
5925         </permacrud>
5926     </class>
5927
5928         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5929                 <fields>
5930                         <field name="sre_id" oils_persist:virtual="true" />
5931                         <field name="location" oils_persist:virtual="true" />
5932                         <field name="owning_lib" oils_persist:virtual="true" />
5933                         <field name="basic_holdings" oils_persist:virtual="true" />
5934                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5935                         <field name="supplement_holdings" oils_persist:virtual="true" />
5936                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5937                         <field name="index_holdings" oils_persist:virtual="true" />
5938                         <field name="index_holdings_add" oils_persist:virtual="true" />
5939                         <field name="online" oils_persist:virtual="true" />
5940                         <field name="missing" oils_persist:virtual="true" />
5941                         <field name="incomplete" oils_persist:virtual="true" />
5942                 </fields>
5943         </class>
5944
5945         <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">
5946                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5947                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5948                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5949                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5950                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5951                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5952                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5953                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5954                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5955                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5956                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5957                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5958                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5959                 </fields>
5960                 <links>
5961                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5962                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5963                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5964                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5965                 </links>
5966                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5967                         <actions>
5968                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5969                                 <retrieve/>
5970                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5971                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5972                         </actions>
5973                 </permacrud>
5974         </class>
5975
5976         <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">
5977                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5978                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5979                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5980                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5981                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5982                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5983                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5984                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5985                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5986                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5987                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5988                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5989                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5990                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5991                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5992                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5993                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5994                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5995                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5996                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5997                 </fields>
5998                 <links>
5999                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6000                 </links>
6001                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6002                         <actions>
6003                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
6004                                         <context link="subscription" field="owning_lib" />
6005                                 </create>
6006                                 <retrieve />
6007                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
6008                                         <context link="subscription" field="owning_lib" />
6009                                 </update>
6010                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
6011                                         <context link="subscription" field="owning_lib" />
6012                                 </delete>
6013                         </actions>
6014                 </permacrud>
6015         </class>
6016
6017         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
6018                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
6019                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6020                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
6021                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
6022                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
6023                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6024                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6025                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6026                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6027                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6028                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6029                 </fields>
6030                 <links>
6031                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6032                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6033                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6034                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6035                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6036                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6037                 </links>
6038                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6039                         <actions>
6040                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6041                                 <retrieve />
6042                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6043                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6044                         </actions>
6045                 </permacrud>
6046         </class>
6047
6048         <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">
6049                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6050                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6051                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6052                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6053                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6054                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6055                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6056                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6057                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6058                 </fields>
6059                 <links>
6060                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6061                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6062                 </links>
6063                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6064                         <actions>
6065                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6066                     <context link="subscription" field="owning_lib"/>
6067                 </create>
6068                                 <retrieve />
6069                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6070                     <context link="subscription" field="owning_lib"/>
6071                 </update>
6072                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6073                     <context link="subscription" field="owning_lib"/>
6074                 </delete>
6075                         </actions>
6076                 </permacrud>
6077         </class>
6078
6079         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6080                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6081                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6082                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6083                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6084                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6085                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6086                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6087                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6088                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6089                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6090                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6091                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6092                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6093                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6094                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6095                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6096                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6097                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6098                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6099                 </fields>
6100                 <links>
6101                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6102                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6103                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6104                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6105                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6106                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6107                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6108                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6109                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6110                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6111                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6112                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6113                 </links>
6114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6115                         <actions>
6116                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6117                                 <retrieve />
6118                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6119                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6120                         </actions>
6121                 </permacrud>
6122         </class>
6123
6124         <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">
6125                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6126                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6127                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6128                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6129                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6130                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6131                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6132                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6133                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6134                 </fields>
6135                 <links>
6136                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6137                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6138                 </links>
6139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6140                         <actions>
6141                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6142                                         <context link="distribution" field="holding_lib" />
6143                                 </create>
6144                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6145                                         <context link="distribution" field="holding_lib" />
6146                                 </retrieve>
6147                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6148                                         <context link="distribution" field="holding_lib" />
6149                                 </update>
6150                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6151                                         <context link="distribution" field="holding_lib" />
6152                                 </delete>
6153                         </actions>
6154                 </permacrud>
6155         </class>
6156
6157         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6158                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6159                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6160                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6161                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6162                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6163                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6164                 </fields>
6165                 <links>
6166                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6167                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6168                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6169                 </links>
6170                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6171                         <actions>
6172                                 <create permission="ADMIN_SERIAL_STREAM">
6173                                         <context link="distribution" field="holding_lib" />
6174                                 </create>
6175                                 <retrieve />
6176                                 <update permission="ADMIN_SERIAL_STREAM">
6177                                         <context link="distribution" field="holding_lib" />
6178                                 </update>
6179                                 <delete permission="ADMIN_SERIAL_STREAM">
6180                                         <context link="distribution" field="holding_lib" />
6181                                 </delete>
6182                         </actions>
6183                 </permacrud>
6184         </class>
6185
6186         <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">
6187                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6188                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6189                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6190                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6191                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6192                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6193                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6194                 </fields>
6195                 <links>
6196                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6197                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6198                 </links>
6199                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6200                         <actions>
6201                                 <create permission="ADMIN_SERIAL_STREAM">
6202                                         <context link="stream" jump="distribution" field="holding_lib" />
6203                                 </create>
6204                                 <retrieve permission="RECEIVE_SERIAL">
6205                                         <context link="stream" jump="distribution" field="holding_lib" />
6206                                 </retrieve>
6207                                 <update permission="ADMIN_SERIAL_STREAM">
6208                                         <context link="stream" jump="distribution" field="holding_lib" />
6209                                 </update>
6210                                 <delete permission="ADMIN_SERIAL_STREAM">
6211                                         <context link="stream" jump="distribution" field="holding_lib" />
6212                                 </delete>
6213                         </actions>
6214                 </permacrud>
6215         </class>
6216
6217         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6218                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6219                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6220                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6221                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6222                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6223                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6224                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6225                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6226                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6227                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6228                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6229                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6230                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6231                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6232                 </fields>
6233                 <links>
6234                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6235                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6236                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6237                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6238                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6239                 </links>
6240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6241                         <actions>
6242                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6243                                         <context link="subscription" field="owning_lib" />
6244                                 </create>
6245                                 <retrieve/>
6246                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6247                                         <context link="subscription" field="owning_lib" />
6248                                 </update>
6249                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6250                                         <context link="subscription" field="owning_lib" />
6251                                 </delete>
6252                         </actions>
6253                 </permacrud>
6254         </class>
6255
6256         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6257                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6258                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6259                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6260                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6261                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6262                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6263                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6264                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6265                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6266                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6267                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6268                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6269                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6270                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6271                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6272                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6273                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6274                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6275                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6276                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6277                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6278                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6279                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6280                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6281                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6282                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6283                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6284                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6285                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6286                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6287                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6288                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6289                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6290                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6291                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6292                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6293                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6294                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6295                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6296                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6297                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6298                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6299                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6300                 </fields>
6301                 <links>
6302                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6303                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6304                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6305                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6306                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6307                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6308                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6309                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6310                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6311                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6312                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6313                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6314                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6315                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6316                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6317                 </links>
6318                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6319                         <actions>
6320                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6321                                 <retrieve/>
6322                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6323                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6324                         </actions>
6325                 </permacrud>
6326         </class>
6327
6328         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6329                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6330                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6331                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6332                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6333                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6334                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6335                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6336                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6337                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6338                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6339                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6340                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6341                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6342                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6343                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6344                 </fields>
6345                 <links>
6346                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6347                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6348                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6349                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6350                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6351                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6352                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6353                 </links>
6354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6355                         <actions>
6356                                 <create permission="ADMIN_SERIAL_ITEM">
6357                                         <context link="stream" jump="distribution" field="holding_lib" />
6358                                 </create>
6359                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6360                                         <context link="stream" jump="distribution" field="holding_lib" />
6361                                 </retrieve>
6362                                 <update permission="ADMIN_SERIAL_ITEM">
6363                                         <context link="stream" jump="distribution" field="holding_lib" />
6364                                 </update>
6365                                 <delete permission="ADMIN_SERIAL_ITEM">
6366                                         <context link="stream" jump="distribution" field="holding_lib" />
6367                                 </delete>
6368                         </actions>
6369                 </permacrud>
6370         </class>
6371
6372         <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">
6373                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6374                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6375                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6376                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6377                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6378                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6379                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6380                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6381                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6382                 </fields>
6383                 <links>
6384                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6385                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6386                 </links>
6387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6388                         <actions>
6389                                 <create permission="ADMIN_SERIAL_ITEM">
6390                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6391                                 </create>
6392                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6393                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6394                                 </retrieve>
6395                                 <update permission="ADMIN_SERIAL_ITEM">
6396                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6397                                 </update>
6398                                 <delete permission="ADMIN_SERIAL_ITEM">
6399                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6400                                 </delete>
6401                         </actions>
6402                 </permacrud>
6403         </class>
6404         <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">
6405                 <fields>
6406                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6407                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6408                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6409                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6410                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6411                 </fields>
6412                 <links>
6413                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6414                 </links>
6415         </class>
6416         <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">
6417                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6418                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6419                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6420                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6421                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6422                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6423                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6424                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6425                 </fields>
6426                 <links>
6427                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6428                 </links>
6429         </class>
6430         <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">
6431                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6432                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6433                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6434                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6435                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6436                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6437                 </fields>
6438                 <links>
6439                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6440                 </links>
6441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6442                         <actions>
6443                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6444                                         <context link="distribution" field="holding_lib" />
6445                                 </create>
6446                                 <retrieve/>
6447                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6448                                         <context link="distribution" field="holding_lib" />
6449                                 </update>
6450                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6451                                         <context link="distribution" field="holding_lib" />
6452                                 </delete>
6453                         </actions>
6454                 </permacrud>
6455         </class>
6456
6457         <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">
6458                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6459                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6460                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6461                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6462                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6463                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6464                 </fields>
6465                 <links>
6466                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6467                 </links>
6468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6469                         <actions>
6470                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6471                                         <context link="distribution" field="holding_lib" />
6472                                 </create>
6473                                 <retrieve/>
6474                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6475                                         <context link="distribution" field="holding_lib" />
6476                                 </update>
6477                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6478                                         <context link="distribution" field="holding_lib" />
6479                                 </delete>
6480                         </actions>
6481                 </permacrud>
6482         </class>
6483
6484         <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">
6485                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6486                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6487                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6488                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6489                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6490                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6491                 </fields>
6492                 <links>
6493                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6494                 </links>
6495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6496                         <actions>
6497                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6498                                         <context link="distribution" field="holding_lib" />
6499                                 </create>
6500                                 <retrieve/>
6501                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6502                                         <context link="distribution" field="holding_lib" />
6503                                 </update>
6504                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6505                                         <context link="distribution" field="holding_lib" />
6506                                 </delete>
6507                         </actions>
6508                 </permacrud>
6509         </class>
6510
6511         <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">
6512                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6513                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6514                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6515                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6516                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6517                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6518                 </fields>
6519                 <links>
6520                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6521                 </links>
6522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6523                         <actions>
6524                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6525                                 <retrieve/>
6526                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6527                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6528                         </actions>
6529                 </permacrud>
6530         </class>
6531
6532         <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">
6533                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6534                         <field name="id" reporter:datatype="id" />
6535                         <field name="owning_copy" reporter:datatype="link"/>
6536                         <field name="stat_cat" reporter:datatype="link"/>
6537                         <field name="stat_cat_entry" reporter:datatype="link"/>
6538                 </fields>
6539                 <links>
6540                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6541                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6542                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6543                 </links>
6544                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6545                         <actions>
6546                                 <retrieve/>
6547                         </actions>
6548                 </permacrud>
6549         </class>
6550         <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">
6551                 <fields oils_persist:primary="code">
6552                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6553                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6554                 </fields>
6555                 <links/>
6556         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6557             <actions>
6558                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6559                 <retrieve/>
6560                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6561                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6562             </actions>
6563         </permacrud>
6564         </class>
6565         <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">
6566                 <fields oils_persist:primary="code">
6567                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6568                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6569                 </fields>
6570                 <links/>
6571         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6572             <actions>
6573                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6574                 <retrieve/>
6575                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6576                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6577             </actions>
6578         </permacrud>
6579         </class>
6580         <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">
6581                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6582                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6583                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6584                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6585                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6586                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6587                 </fields>
6588                 <links>
6589             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6590         </links>
6591         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6592             <actions>
6593                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6594                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6595                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6596                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6597             </actions>
6598         </permacrud>
6599         </class>
6600         <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">
6601                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6602                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6603                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6604                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6605                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6606                 </fields>
6607                 <links>
6608                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6609         </links>
6610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6611             <actions>
6612                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6613                 <retrieve/>
6614                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6615                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6616             </actions>
6617         </permacrud>
6618         </class>
6619         <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">
6620                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6621                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6622                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6623                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6624                 </fields>
6625                 <links>
6626                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6627                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6628                 </links>
6629         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6630             <actions>
6631                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6632                 <retrieve/>
6633                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6634                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6635             </actions>
6636         </permacrud>
6637         </class>
6638         <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">
6639                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6640                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6641                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6642                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6643                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6644                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6645                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6646                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6647                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6648                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6649                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6650                 </fields>
6651                 <links>
6652                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6653                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6654                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6655                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6656                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6657                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6658                 </links>
6659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6660             <actions>
6661                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6662                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6663                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6664                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6665             </actions>
6666         </permacrud>
6667         </class>
6668         <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">
6669                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6670                         <field name="id" reporter:datatype="id" />
6671                         <field name="from_org" reporter:datatype="org_unit"/>
6672                         <field name="to_org" reporter:datatype="org_unit"/>
6673                         <field name="prox" reporter:datatype="int" />
6674                 </fields>
6675                 <links>
6676                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6677                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6678                 </links>
6679         </class>
6680         <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">
6681                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6682                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6683                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6684                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6685                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6686                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6687                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6688                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6689                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6690                 </fields>
6691                 <links/>
6692         </class>
6693         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6694                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6695                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6696                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6697                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6698                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6699                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6700                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6701                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6702                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6703                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6704                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6705                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6706                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6707                 </fields>
6708                 <links>
6709                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6710                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6711                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6712                 </links>
6713         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6714             <actions>
6715                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6716                 <retrieve/>
6717                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6718                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6719             </actions>
6720         </permacrud>
6721         </class>
6722         <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">
6723                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6724                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6725                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6726                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6727                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6728                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6729                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6730                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6731                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6732                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6733                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6734                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6735                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6736                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6737                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6738                 </fields>
6739                 <links>
6740                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6741                 </links>
6742         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6743             <actions>
6744                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6745                 <retrieve/>
6746                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6747                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6748             </actions>
6749         </permacrud>
6750         </class>
6751         <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">
6752                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6753                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6754                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6755                         <field name="query_text" reporter:datatype="text"/>
6756                 </fields>
6757         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6758             <actions>
6759                 <retrieve/>
6760             </actions>
6761         </permacrud>
6762         </class>
6763
6764         <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">
6765                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6766                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6767                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6768                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6769                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6770                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6771                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6772                 </fields>
6773                 <links>
6774                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6775                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6776                 </links>
6777         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6778             <actions>
6779                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6780                 <retrieve/>
6781                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6782                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6783             </actions>
6784         </permacrud>
6785         </class>
6786         <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">
6787                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6788                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6789                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6790                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6791                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6792                 </fields>
6793                 <links>
6794                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6795                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6796                 </links>
6797         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6798             <actions>
6799                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6800                     <context link="grp" field="owner"/>
6801                 </create>
6802                 <retrieve/>
6803                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6804                     <context link="grp" field="owner"/>
6805                 </update>
6806                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6807                     <context link="grp" field="owner"/>
6808                 </delete>
6809             </actions>
6810         </permacrud>
6811         </class>
6812
6813         <!-- A note: Please update alhr and ahopl when updating ahr -->
6814         <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">
6815                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6816                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6817                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6818                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6819                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6820                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6821                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6822                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6823                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6824                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6825                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6826                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6827                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6828                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6829                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6830                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6831                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6832                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6833                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6834                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6835                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6836                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6837                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6838                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6839                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6840                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6841                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6842                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6843                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6844                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6845                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6846                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6847                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6848                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6849                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6850                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6851                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6852                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6853                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6854                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6855                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6856                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6857                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6858                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6859                 </fields>
6860                 <links>
6861                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6862                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6863                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6864                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6865                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6866                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6867                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6868                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6869                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6870                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6871                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6872                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6873                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6874                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6875                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6876                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6877                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6878                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6879                 </links>
6880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6881                         <actions>
6882                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6883                         </actions>
6884                 </permacrud>
6885         </class>
6886         <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">
6887                 <oils_persist:source_definition><![CDATA[
6888                 SELECT DISTINCT
6889                         ahr.*,
6890                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6891                                 copy_location_order_position,
6892                         CASE WHEN au.alias IS NOT NULL THEN
6893                                 au.alias
6894                         ELSE
6895                                 au.first_given_name
6896                         END AS usr_alias_or_first_given_name,
6897                         au.first_given_name AS usr_first_given_name,
6898                         au.second_given_name AS usr_second_given_name,
6899                         au.family_name AS usr_family_name,
6900                         au.prefix AS usr_prefix,
6901                         au.suffix AS usr_suffix,
6902                         au.alias AS usr_alias,
6903                         CASE WHEN au.alias IS NOT NULL THEN
6904                                 au.alias
6905                         ELSE
6906                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6907                                         COALESCE(au.family_name, ''),
6908                                         COALESCE(au.suffix, ''),
6909                                         ', ',
6910                                         COALESCE(au.prefix, ''),
6911                                         COALESCE(au.first_given_name, ''),
6912                                         COALESCE(au.second_given_name, '')
6913                                 ], ' '), E'\\s+,', ',')
6914                         END AS usr_alias_or_display_name,
6915                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6916                                 COALESCE(au.family_name, ''),
6917                                 COALESCE(au.suffix, ''),
6918                                 ', ',
6919                                 COALESCE(au.prefix, ''),
6920                                 COALESCE(au.first_given_name, ''),
6921                                 COALESCE(au.second_given_name, '')
6922                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6923                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6924                                 AS call_number_label,
6925                         siss.label AS issuance_label,
6926                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6927                         ahcm_1.copy_count AS potential_copies
6928                 FROM action.hold_request ahr
6929                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6930                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6931                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6932                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6933                 JOIN actor.usr au ON (au.id = ahr.usr)
6934                 JOIN (
6935                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6936                         FROM asset.copy_location
6937                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6938                 LEFT JOIN actor.usr_standing_penalty ausp 
6939                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6940                 LEFT JOIN config.standing_penalty csp
6941                         ON (
6942                                 csp.id = ausp.standing_penalty AND 
6943                                 csp.block_list LIKE '%CAPTURE%' AND (
6944                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6945                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6946                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6947                                         )
6948                                 )
6949                         )
6950                 JOIN (
6951                         SELECT COUNT(target_copy) AS copy_count, hold
6952                         FROM action.hold_copy_map
6953                         GROUP BY 2
6954                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6955                 LEFT JOIN serial.issuance siss
6956                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6957                 LEFT JOIN asset.copy_location_order acplo
6958                         ON (acp.location = acplo.location AND
6959                                 acp.circ_lib = acplo.org)
6960                 WHERE
6961                         ahr.capture_time IS NULL AND
6962                         ahr.cancel_time IS NULL AND
6963                         csp.id IS NULL AND
6964                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6965                         acp.status IN (0,7)
6966                 ]]></oils_persist:source_definition>
6967                 <fields oils_persist:primary="id">
6968                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6969                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6970                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6971                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6972                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6973                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6974                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6975                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6976                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6977                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6978                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6979                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6980                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6981                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6982                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6983                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6984                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6985                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6986                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6987                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6988                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6989                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6990                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6991                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6992                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6993                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6994                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6995                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6996                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6997                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6998                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6999                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7000                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7001                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7002                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7003                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7004                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7005                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7006                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7007                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7008                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7009                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
7010                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
7011                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
7012                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
7013                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
7014                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
7015                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
7016                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
7017                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
7018                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
7019                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
7020                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
7021                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7022                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7023                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7024                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7025                 </fields>
7026                 <links>
7027                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7028                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7029                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7030                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7031                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7032                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7033                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7034                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7035                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7036                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7037                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7038                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7039                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7040                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7041                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7042                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7043                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7044                 </links>
7045                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7046                         <actions>
7047                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7048                         </actions>
7049                 </permacrud>
7050         </class>
7051         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7052                 <oils_persist:source_definition><![CDATA[
7053                         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)
7054                 ]]></oils_persist:source_definition>
7055                 <fields oils_persist:primary="id">
7056                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7057                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7058                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7059                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7060                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7061                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7063                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7064                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7065                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7066                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7067                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7068                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7069                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7070                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7071                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7072                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7073                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7074                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7075                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7076                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7077                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7078                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7079                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7080                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7081                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7082                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7083                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7084                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7085                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7086                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7087                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7088                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7089                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7090                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7091                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7092                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7093                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7094                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7095                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7096                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7097                 </fields>
7098                 <links>
7099                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7100                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7101                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7102                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7103                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7104                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7105                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7106                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7107                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7108                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7109                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7110                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7111                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7112                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7113                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7114                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7115                 </links>
7116         </class>
7117
7118         <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">
7119                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7120                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7121                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7122                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7123                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7124                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7125                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7126                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7127                 </fields>
7128                 <links>
7129                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7130                 </links>
7131                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7132                         <actions>
7133                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7134                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7135                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7136                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7137                         </actions>
7138                 </permacrud>
7139         </class>
7140         <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">
7141                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7142                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7143                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7144                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7145                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7146                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7147                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7148                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7149                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7150                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7151                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7152                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7153                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7154                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7155                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7156                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7157                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7158                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7159                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7160                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7161                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7162                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7163                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7164                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7165                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7166                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7167                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7168                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7169                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7170                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7171                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7172                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7173                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7174                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7175                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7176                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7177                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7178                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7179                 </fields>
7180                 <links>
7181                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7182                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7183                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7184                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7185                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7186                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7187                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7188                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7189                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7190                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7191                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7192                 </links>
7193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7194                         <actions>
7195                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7196                         </actions>
7197                 </permacrud>
7198         </class>
7199         <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">
7200                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7201                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7202                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7203                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7204                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7205                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7206                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7207                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7208                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7209                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7210                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7211                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7212                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7213                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7214                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7215                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7216                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7217                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7218                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7219                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7220                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7221                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7222                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7223                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7224                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7225                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7226                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7227                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7228                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7229                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7230                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7231                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7232                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7233                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7234                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7235                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7236                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7237                 </fields>
7238                 <links>
7239                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7240                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7241                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7242                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7243                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7244                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7245                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7246                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7247                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7248                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7249                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7250                 </links>
7251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7252                         <actions>
7253                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7254                         </actions>
7255                 </permacrud>
7256         </class>
7257
7258         <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">
7259                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7260                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7261                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7262                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7263                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7264                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7265                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7266                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7267                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7268                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7269                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7270                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7271                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7272                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7273                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7274                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7275                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7276                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7277                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7278                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7279                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7280                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7281                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7282                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7283                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7284                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7285                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7286                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7287                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7288                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7289                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7290                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7291                 </fields>
7292                 <links>
7293                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7294                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7295                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7296                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7297                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7298                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7299                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7300                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7301                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7302                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7303                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7304                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7305                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7306                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7307                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7308                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7309                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7310                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7311                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7312                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7313                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7314                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7315                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7316                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7317                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7318                 </links>
7319         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7320             <actions>
7321                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7322                 <retrieve />
7323                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7324                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7325             </actions>
7326         </permacrud>
7327         </class>
7328         <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">
7329                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7330                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7331                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7332                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7333                 </fields>
7334                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7335                         <actions>
7336                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7337                                 <retrieve/>
7338                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7339                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7340                         </actions>
7341                 </permacrud>
7342         </class>
7343         <class id="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">
7344                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7345                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7346                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7347                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7348                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7349                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7350                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7351                 </fields>
7352                 <links>
7353                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7354                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7355                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7356                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7357                 </links>
7358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7359                         <actions>
7360                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7361                                 <retrieve/>
7362                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7363                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7364                         </actions>
7365                 </permacrud>
7366         </class>
7367         <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">
7368                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7369                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7370                         <field name="btype" reporter:datatype="text"/>
7371                         <field name="id" reporter:datatype="id" />
7372                         <field name="name"  reporter:datatype="text"/>
7373                         <field name="description" reporter:datatype="text"/>
7374                         <field name="owner" reporter:datatype="link"/>
7375                         <field name="pub" reporter:datatype="bool"/>
7376                         <field name="create_time" reporter:datatype="timestamp" />
7377                         <field name="owning_lib" reporter:datatype="org_unit" />
7378                 </fields>
7379                 <links>
7380                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7381                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7382                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7383                 </links>
7384                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7385                         <actions>
7386                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7387                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7388                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7389                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7390                         </actions>
7391                 </permacrud>
7392         </class>
7393         <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">
7394                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7395                         <field name="id" reporter:datatype="id" />
7396                         <field name="bucket" reporter:datatype="link"/>
7397                         <field name="note" reporter:datatype="text" />
7398                 </fields>
7399                 <links>
7400                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7401                 </links>
7402         </class>
7403         <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">
7404                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7405                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7406                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7407                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7408                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7409                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7410                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7411                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7412                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7413                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7414                 </fields>
7415                 <links>
7416                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7417                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7418                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7419                 </links>
7420                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7421                         <actions>
7422                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7423                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7424                 <retrieve />
7425                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7426                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7427             </actions>
7428                 </permacrud>
7429         </class>
7430         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7431                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7432                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7433                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7434                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7435                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7436                 </fields>
7437                 <links>
7438                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7439                 </links>
7440                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7441                         <actions>
7442                                 <retrieve permission="VIEW_USER user_request.view">
7443                                         <context link="usr" field="home_ou" />
7444                                 </retrieve>
7445                         </actions>
7446                 </permacrud>
7447         </class>
7448     <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">
7449         <fields oils_persist:primary="field">
7450             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7451             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7452             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7453         </fields>
7454         <links/>
7455         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7456             <actions>
7457                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7458                 <retrieve />
7459                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7460                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7461             </actions>
7462         </permacrud>
7463     </class>
7464         <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">
7465                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7466                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7467                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7468                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7469                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7470                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7471                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7472                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7473                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7474                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7475                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7476                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7477                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7478                 </fields>
7479                 <links>
7480                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7481                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7482                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7483                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7484                 </links>
7485         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7486             <actions>
7487                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7488                 <retrieve />
7489                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7490                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7491             </actions>
7492         </permacrud>
7493         </class>
7494         <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">
7495                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7496                         <field name="field" reporter:datatype="link"/>
7497                         <field name="id" reporter:datatype="id" />
7498                         <field name="source" reporter:datatype="link"/>
7499                         <field name="value"  reporter:datatype="text"/>
7500                 </fields>
7501                 <links>
7502                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7503                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7504                 </links>
7505         </class>
7506         <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">
7507                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7508                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7509                         <field name="btype" reporter:datatype="text"/>
7510                         <field name="id" reporter:datatype="id" />
7511                         <field name="name"  reporter:datatype="text"/>
7512                         <field name="description" reporter:datatype="text"/>
7513                         <field name="owner" reporter:datatype="link"/>
7514                         <field name="pub" reporter:datatype="bool"/>
7515                         <field name="create_time" reporter:datatype="timestamp" />
7516                         <field name="owning_lib" reporter:datatype="org_unit" />
7517                 </fields>
7518                 <links>
7519                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7520                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7521                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7522                 </links>
7523                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7524                         <actions>
7525                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7526                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7527                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7528                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7529                         </actions>
7530                 </permacrud>
7531         </class>
7532         <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">
7533                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7534                         <field name="id" reporter:datatype="id" />
7535                         <field name="bucket" reporter:datatype="link"/>
7536                         <field name="note" reporter:datatype="text" />
7537                 </fields>
7538                 <links>
7539                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7540                 </links>
7541         </class>
7542         <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">
7543                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7544                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7545                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7546                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7547                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7548                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7549                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7550                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7551                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7552                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7553                 </fields>
7554                 <links>
7555                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7556                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7557                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7558                 </links>
7559         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7560             <actions>
7561                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7562                     <context link="xact" jump="usr" field="home_ou"/>
7563                 </retrieve>
7564                         </actions>
7565                 </permacrud>
7566         </class>
7567         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7568                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7569                         <field name="id" reporter:datatype="id" />
7570                         <field name="ind1" />
7571                         <field name="ind2" />
7572                         <field name="record" />
7573                         <field name="subfield" />
7574                         <field name="tag" />
7575                         <field name="value" />
7576                 </fields>
7577                 <links>
7578                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7579                 </links>
7580         </class>
7581         <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">
7582                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7583                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7584                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7585                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7586                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7587                 </fields>
7588                 <links>
7589                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7590                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7591                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7592                 </links>
7593         </class>
7594         <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">
7595                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7596                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7597                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7598                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7599                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7600                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7601                 </fields>
7602                 <links>
7603                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7604                 </links>
7605         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7606             <actions>
7607                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7608                 <retrieve/>
7609                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7610                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7611             </actions>
7612         </permacrud>
7613
7614         </class>
7615         <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">
7616                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7617                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7618                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7619                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7620                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7621                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7622                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7623                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7624                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7625                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7626                 </fields>
7627                 <links>
7628                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7629                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7630                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7631                 </links>
7632         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7633             <actions>
7634                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7635                 <retrieve/>
7636                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7637                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7638             </actions>
7639         </permacrud>
7640         </class>
7641         <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">
7642                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7643                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7644                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7645                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7646                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7647                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7648                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7649                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7650                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7651                 </fields>
7652                 <links>
7653                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7654                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7655                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7656                 </links>
7657                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7658                 <actions>
7659                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7660                     <retrieve/>
7661                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7662                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7663                 </actions>
7664              </permacrud>
7665         </class>
7666         <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">
7667                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7668                         <field name="balance_owed" reporter:datatype="money" />
7669                         <field name="total_owed" reporter:datatype="money" />
7670                         <field name="total_paid" reporter:datatype="money" />
7671                         <field name="usr" reporter:datatype="link"/>
7672                 </fields>
7673                 <links>
7674                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7675                 </links>
7676         </class>
7677     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7678                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7679                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7680                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7681                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7682                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7683                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7684                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7685                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7686                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7687                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7688                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7689                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7690                 </fields>
7691                 <links>
7692                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7693                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7694                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7695                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7696                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7697                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7698                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7699                 </links>
7700         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7701             <actions>
7702                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7703             </actions>
7704         </permacrud>
7705         </class>
7706         <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">
7707                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7708                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7709                         <field name="quality" reporter:datatype="int" />
7710                         <field name="source" reporter:datatype="text"/>
7711                         <field name="transcendant" reporter:datatype="bool"/>
7712                         <field name="can_have_copies" reporter:datatype="bool"/>
7713                 </fields>
7714                 <links/>
7715         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7716             <actions>
7717                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7718                 <retrieve/>
7719                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7720                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7721             </actions>
7722         </permacrud>
7723         </class>
7724         <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">
7725                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7726                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7727                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7728                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7729                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7730                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7731                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7732                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7733                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7734                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7735                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7736                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7737                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7738                 </fields>
7739                 <links>
7740                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7741                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7742                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7743                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7744                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7745                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7746                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7747                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7748                 </links>
7749                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7750                         <actions>
7751                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7752                                         <context link="usr" field="home_ou" />
7753                                 </retrieve>
7754                         </actions>
7755                 </permacrud>
7756         </class>
7757         <class id="actsce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7758                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7759                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7760                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7761                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7762                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7763                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7764                 </fields>
7765                 <links>
7766                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7767                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7768                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7769                 </links>
7770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7771                         <actions>
7772                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7773                     <context link="stat_cat" field="owner"/>
7774                 </create>
7775                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7776                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7777                     <context link="stat_cat" field="owner"/>
7778                 </update>
7779                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7780                     <context link="stat_cat" field="owner"/>
7781                 </delete>
7782                         </actions>
7783                 </permacrud>
7784         </class>
7785         <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">
7786                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7787                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7788                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7789                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7790                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7791                 </fields>
7792                 <links>
7793                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7794                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7795                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7796                 </links>
7797         </class>
7798         <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">
7799                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7800                         <field name="bucket" reporter:datatype="link"/>
7801                         <field name="id" reporter:datatype="id" />
7802                         <field name="target_user" reporter:datatype="link"/>
7803                         <field name="create_time" reporter:datatype="timestamp" />
7804                         <field name="pos" reporter:datatype="int" />
7805                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7806                 </fields>
7807                 <links>
7808                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7809                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7810             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7811                 </links>
7812                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7813                         <actions>
7814                                 <retrieve permission="ADMIN_USER_BUCKET">
7815                     <context link="bucket" field="owning_lib"/>
7816                 </retrieve>
7817             </actions>
7818         </permacrud>
7819         </class>
7820         <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">
7821                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7822                         <field name="id" reporter:datatype="id" />
7823                         <field name="staff" reporter:datatype="link"/>
7824                         <field name="bucket" reporter:datatype="link"/>
7825                         <field name="target" reporter:datatype="int" />
7826                         <field name="hold_type" reporter:datatype="text" />
7827                         <field name="run_date" reporter:datatype="timestamp" />
7828                         <field name="cancelled" reporter:datatype="timestamp" />
7829                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7830                 </fields>
7831                 <links>
7832                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7833                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7834                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7835                 </links>
7836                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7837                         <actions>
7838                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7839                 <retrieve/>
7840                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7841                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7842             </actions>
7843         </permacrud>
7844         </class>
7845         <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">
7846                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7847                         <field name="id" reporter:datatype="id" />
7848                         <field name="batch_hold_event" reporter:datatype="link"/>
7849                         <field name="hold" reporter:datatype="link"/>
7850                 </fields>
7851                 <links>
7852                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7853                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7854                 </links>
7855                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7856                         <actions>
7857                 <retrieve/>
7858             </actions>
7859         </permacrud>
7860         </class>
7861         <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">
7862                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7863                         <field name="id" reporter:datatype="id" />
7864                         <field name="item" reporter:datatype="link"/>
7865                         <field name="note" reporter:datatype="text" />
7866                 </fields>
7867                 <links>
7868                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7869                 </links>
7870         </class>
7871         <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">
7872                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7873                         <field name="balance_owed" reporter:datatype="money" />
7874                         <field name="total_owed" reporter:datatype="money" />
7875                         <field name="total_paid" reporter:datatype="money" />
7876                         <field name="usr" reporter:datatype="link"/>
7877                 </fields>
7878                 <links>
7879                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7880                 </links>
7881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7882                         <actions>
7883                                 <retrieve permission="VIEW_USER">
7884                                         <context link="usr" field="home_ou"/>
7885                                 </retrieve>
7886                         </actions>
7887                 </permacrud>
7888         </class>
7889         <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">
7890                 <fields oils_persist:primary="code" oils_persist:sequence="">
7891                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7892                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7893                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7894                 </fields>
7895                 <links/>
7896         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7897             <actions>
7898                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7899                 <retrieve/>
7900                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7901                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7902             </actions>
7903         </permacrud>
7904         </class>
7905         <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">
7906                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7907                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7908                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7909                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7910                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7911                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7912                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7913                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7914                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7915                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7916                 </fields>
7917                 <links>
7918                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7919                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7920                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7921                 </links>
7922         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7923             <actions>
7924                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7925                     <context link="xact" jump="usr" field="home_ou"/>
7926                 </retrieve>
7927                         </actions>
7928                 </permacrud>
7929         </class>
7930         <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">
7931                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7932                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7933                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7934                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7935                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7936                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7937                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7938                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7939                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7940                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7941                 </fields>
7942                 <links>
7943                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7944                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7945                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7946                 </links>
7947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7948             <actions>
7949                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7950                     <context link="xact" jump="usr" field="home_ou"/>
7951                 </retrieve>
7952                         </actions>
7953                 </permacrud>
7954         </class>
7955         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7956                 <fields oils_persist:primary="id" oils_persist:sequence="">
7957                         <field name="checkin_lib" reporter:datatype="link"/>
7958                         <field name="checkin_staff" reporter:datatype="link"/>
7959                         <field name="checkin_time" reporter:datatype="timestamp"/>
7960                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7961                         <field name="circ_staff" reporter:datatype="link"/>
7962                         <field name="desk_renewal" reporter:datatype="bool"/>
7963                         <field name="due_date" reporter:datatype="timestamp"/>
7964                         <field name="duration" reporter:datatype="interval"/>
7965                         <field name="duration_rule" reporter:datatype="link"/>
7966                         <field name="fine_interval" reporter:datatype="interval"/>
7967                         <field name="id" reporter:datatype="id" />
7968                         <field name="max_fine" reporter:datatype="money" />
7969                         <field name="max_fine_rule" reporter:datatype="link"/>
7970                         <field name="opac_renewal" reporter:datatype="bool"/>
7971                         <field name="phone_renewal" reporter:datatype="bool"/>
7972                         <field name="recurring_fine" reporter:datatype="money" />
7973                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7974                         <field name="renewal_remaining" reporter:datatype="int" />
7975             <field name="grace_period" reporter:datatype="interval" />
7976                         <field name="stop_fines" reporter:datatype="text"/>
7977                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7978                         <field name="target_copy" reporter:datatype="link"/>
7979                         <field name="usr" reporter:datatype="link"/>
7980                         <field name="xact_finish" reporter:datatype="timestamp" />
7981                         <field name="xact_start" reporter:datatype="timestamp" />
7982                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7983                         <field name="auto_renewal" reporter:datatype="bool"/>
7984                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7985                 </fields>
7986                 <links>
7987                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7988                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7989                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7990                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7991                 </links>
7992         </class>
7993         <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">
7994                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7995                         <field name="field" reporter:datatype="link"/>
7996                         <field name="id" reporter:datatype="id" />
7997                         <field name="source" reporter:datatype="link"/>
7998                         <field name="value" reporter:datatype="text"/>
7999                 </fields>
8000                 <links>
8001                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8002                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8003                 </links>
8004         </class>
8005         <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">
8006                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
8007                         <field name="high" reporter:datatype="money" />
8008                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
8009                         <field name="low" reporter:datatype="money" />
8010                         <field name="name" reporter:datatype="text"/>
8011                         <field name="normal" reporter:datatype="money" />
8012                         <field name="recurrence_interval" reporter:datatype="interval"/>
8013             <field name="grace_period" reporter:datatype="interval" />
8014                 </fields>
8015                 <links/>
8016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8017             <actions>
8018                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8019                 <retrieve/>
8020                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8021                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8022             </actions>
8023         </permacrud>
8024         </class>
8025         <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">
8026                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8027                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8028                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8029                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8030                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8031                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
8032                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8033                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8034                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8035                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8036                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8037                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8038                 </fields>
8039                 <links>
8040                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8041                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8042                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8043                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8044                 </links>
8045         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8046             <actions>
8047                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8048                     <context link="xact" jump="usr" field="home_ou"/>
8049                 </retrieve>
8050                         </actions>
8051                 </permacrud>
8052         </class>
8053         <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">
8054                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8055                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8056                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8057                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8058                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8059                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8060                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8061                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8062                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8063                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8064                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8065                 </fields>
8066                 <links>
8067                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8068                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8069                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8070                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8071                 </links>
8072         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8073             <actions>
8074                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8075                     <context link="xact" jump="usr" field="home_ou"/>
8076                 </retrieve>
8077                         </actions>
8078                 </permacrud>
8079         </class>
8080         <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">
8081                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8082                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8083                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8084                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8085                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8086                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8087                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8088                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8089                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8090                         <field reporter:label="Item Number on Volume" name="copy_number" reporter:datatype="text"/>
8091                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8092                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8093                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8094                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8095                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8096                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8097                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8098                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8099                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8100                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8101                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8102                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8103                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8104                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8105                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8106                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8107                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8108                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8109                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8110                         <field reporter:label="Item Status" name="status" reporter:datatype="link"/>
8111                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8112                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8113                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8114                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8115                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8116                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8117                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8118                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8119                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8120                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8121                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8122                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8123                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8124                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8125                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8126                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8127                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8128                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8129                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8130                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8131                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8132                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8133                 </fields>
8134                 <links>
8135                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8136                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8137                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8138                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8139                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8140                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8141                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8142                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8143                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8144                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8145                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8146                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8147                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8148                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8149                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8150                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8151                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8152                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8153                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8154                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8155                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8156                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8157                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8158                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8159                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8160                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8161                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8162                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8163                 </links>
8164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8165             <actions>
8166                 <create permission="CREATE_COPY">
8167                     <context link="call_number" field="owning_lib"/>
8168                 </create>
8169                 <retrieve/>
8170                 <update permission="UPDATE_COPY">
8171                     <context link="call_number" field="owning_lib"/>
8172                 </update>
8173                 <delete permission="DELETE_COPY">
8174                     <context link="call_number" field="owning_lib"/>
8175                 </delete>
8176             </actions>
8177         </permacrud>
8178         </class>
8179
8180         <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">
8181                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8182                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8183                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8184                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8185                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8186                 </fields>
8187                 <links>
8188                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8189                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8190                 </links>
8191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8192                         <actions>
8193                 <create permission="STAFF_LOGIN"/>
8194                 <retrieve/>
8195                 <update permission="STAFF_LOGIN"/>
8196                 <delete permission="STAFF_LOGIN"/>
8197                         </actions>
8198                 </permacrud>
8199         </class>
8200
8201         <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">
8202                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8203             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8204                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8205                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8206                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8207                 </fields>
8208                 <links>
8209                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8210                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8211                 </links>
8212         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8213             <actions>
8214                                 <retrieve/>
8215             </actions>
8216         </permacrud>
8217         </class>
8218
8219         <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">
8220                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8221                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8222                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8223                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8224                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8225                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8226                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8227                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8228                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8229                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8230                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8231                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8232                 </fields>
8233                 <links>
8234                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8235                 </links>
8236         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8237             <actions>
8238                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8239                 <retrieve/>
8240                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8241                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8242             </actions>
8243         </permacrud>
8244         </class>
8245
8246         <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">
8247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8248                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8249                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8250                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8251                 </fields>
8252                 <links>
8253                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8254                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8255                 </links>
8256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8257             <actions>
8258                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8259                 <retrieve/>
8260                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8261                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8262             </actions>
8263         </permacrud>
8264         </class>
8265
8266         <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">
8267                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8268                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8269                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8270                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8271                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8272                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8273                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8274                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8275                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8276                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8277                 </fields>
8278                 <links>
8279                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8280                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8281                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8282                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8283                 </links>
8284         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8285             <actions>
8286                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8287                     <context link="copy" field="circ_lib"/>
8288                 </create>
8289                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8290                     <context link="copy" field="circ_lib"/>
8291                                 </retrieve>
8292                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8293                     <context link="copy" field="circ_lib"/>
8294                                 </update>
8295                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8296                     <context link="copy" field="circ_lib"/>
8297                                 </delete>
8298             </actions>
8299         </permacrud>
8300         </class>
8301
8302         <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">
8303                 <fields oils_persist:primary="id">
8304                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8305                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8306                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8307                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8308                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8309                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8310                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8311                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8312                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8313                 </fields>
8314                 <links>
8315                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8316                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8317                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8318                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8319                 </links>
8320         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8321             <actions>
8322                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8323                     <context link="copy" field="circ_lib"/>
8324                 </create>
8325                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8326                     <context link="copy" field="circ_lib"/>
8327                                 </retrieve>
8328                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8329                     <context link="copy" field="circ_lib"/>
8330                                 </update>
8331                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8332                     <context link="copy" field="circ_lib"/>
8333                                 </delete>
8334             </actions>
8335         </permacrud>
8336         </class>
8337
8338         <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">
8339                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8340                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8341                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8342                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8343                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8344                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8345                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8346                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8347                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8348                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8349                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8350                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8351                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8352                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8353                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8354                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8355                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8356                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8357                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8358                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8359                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8360                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8361                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8362                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8363                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8364                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8365                 </fields>
8366                 <links>
8367                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8368                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8369                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8370                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8371                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8372                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8373                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8374                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8375                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8376                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8377                 </links>
8378                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8379                         <actions>
8380                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8381                                 <retrieve />
8382                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8383                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8384                         </actions>
8385                 </permacrud>
8386         </class>
8387
8388         <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">
8389                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8390                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8391                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8392                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8393                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8394                 </fields>
8395                 <links/>
8396         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8397             <actions>
8398                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8399                 <retrieve/>
8400                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8401                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8402             </actions>
8403         </permacrud>
8404         </class>
8405         <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">
8406                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8407                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8408                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8409                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8410                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8411                 </fields>
8412                 <links/>
8413         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8414             <actions>
8415                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8416                 <retrieve/>
8417                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8418                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8419             </actions>
8420         </permacrud>
8421         </class>
8422         <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">
8423                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8424                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8425                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8426                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8427                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8428                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8429                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8430                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8431                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8432                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8433                 </fields>
8434                 <links>
8435                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8436                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8437                 </links>
8438         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8439             <actions>
8440                 <create permission="CREATE_PERM" global_required="true"/>
8441                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8442                 <update permission="UPDATE_PERM" global_required="true"/>
8443                 <delete permission="DELETE_PERM" global_required="true"/>
8444             </actions>
8445         </permacrud>
8446         </class>
8447         <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">
8448                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8449                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8450                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8451                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8452                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8453                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8454                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8455                 </fields>
8456                 <links>
8457                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8458                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8459                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8460                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8461                 </links>
8462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8463                         <actions>
8464                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8465                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8466                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8467                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8468                         </actions>
8469                 </permacrud>
8470         </class>
8471         <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">
8472                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8473                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8474                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8475                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8476                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8477                 </fields>
8478                 <links>
8479                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8480                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8481                 </links>
8482         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8483             <actions>
8484                 <create permission="ADMIN_SURVEY">
8485                     <context link="question" jump="survey" field="owner"/>
8486                 </create>
8487                 <retrieve/>
8488                 <update permission="ADMIN_SURVEY">
8489                     <context link="question" jump="survey" field="owner"/>
8490                 </update>
8491                 <delete permission="ADMIN_SURVEY">
8492                     <context link="question" jump="survey" field="owner"/>
8493                 </delete>
8494             </actions>
8495         </permacrud>
8496         </class>
8497         <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">
8498                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8499                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8500                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8501                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8502                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8503                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8504                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8505                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8506                 </fields>
8507                 <links>
8508                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8509                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8510                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8511                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8512                 </links>
8513                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8514                         <actions>
8515                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8516                         </actions>
8517                 </permacrud>
8518         </class>
8519         <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">
8520                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8521                         <field name="balance_owed" reporter:datatype="money" />
8522                         <field name="total_owed" reporter:datatype="money" />
8523                         <field name="total_paid" reporter:datatype="money" />
8524                         <field name="usr" reporter:datatype="link"/>
8525                 </fields>
8526                 <links>
8527                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8528                 </links>
8529         </class>
8530         <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">
8531                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8532                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8533                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8534                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8535                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8536                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8537                 </fields>
8538                 <links>
8539                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8540                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8541                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8542                 </links>
8543         </class>
8544         <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">
8545                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8546                         <field name="field" reporter:datatype="link"/>
8547                         <field name="id" reporter:datatype="id" />
8548                         <field name="source" reporter:datatype="link"/>
8549                         <field name="value" reporter:datatype="text"/>
8550                 </fields>
8551                 <links>
8552                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8553                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8554                 </links>
8555         </class>
8556         <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">
8557                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8558                         <field name="field" reporter:datatype="link"/>
8559                         <field name="id" reporter:datatype="id" />
8560                         <field name="source" reporter:datatype="link"/>
8561                         <field name="value" reporter:datatype="text"/>
8562                 </fields>
8563                 <links>
8564                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8565                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8566                 </links>
8567         </class>
8568         <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">
8569                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8570                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8571                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8572                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8573                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8574                 </fields>
8575                 <links>
8576                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8577                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8578                 </links>
8579         </class>
8580         <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">
8581                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8582                         <field name="depth" reporter:datatype="int" />
8583                         <field name="grantable" reporter:datatype="bool"/>
8584                         <field name="grp" reporter:datatype="link"/>
8585                         <field name="id" reporter:datatype="id" />
8586                         <field name="perm" reporter:datatype="link"/>
8587                 </fields>
8588                 <links>
8589                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8590                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8591                 </links>
8592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8593             <actions>
8594                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8595                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8596                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8597                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8598             </actions>
8599         </permacrud>
8600         </class>
8601         <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">
8602                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8603                         <field name="items" oils_persist:virtual="true" />
8604                         <field name="btype" reporter:datatype="text"/>
8605                         <field name="id" reporter:datatype="id" />
8606                         <field name="name" reporter:datatype="text"/>
8607                         <field name="description" reporter:datatype="text"/>
8608                         <field name="owner" reporter:datatype="link"/>
8609                         <field name="pub" reporter:datatype="bool"/>
8610                         <field name="create_time" reporter:datatype="timestamp" />
8611                         <field name="owning_lib" reporter:datatype="org_unit" />
8612                 </fields>
8613                 <links>
8614                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8615                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8616                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8617                 </links>
8618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8619                         <actions>
8620                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8621                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8622                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8623                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8624                         </actions>
8625                 </permacrud>
8626         </class>
8627         <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">
8628                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8629                         <field name="id" reporter:datatype="id" />
8630                         <field name="bucket" reporter:datatype="link"/>
8631                         <field name="note" reporter:datatype="text" />
8632                 </fields>
8633                 <links>
8634                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8635                 </links>
8636         </class>
8637         <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">
8638                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8639                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8640                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8641                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8642                 </fields>
8643                 <links>
8644                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8645                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8646                 </links>
8647         </class>
8648         <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">
8649                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8650                         <field name="depth" reporter:datatype="int"/>
8651                         <field name="grantable" reporter:datatype="bool"/>
8652                         <field name="id" reporter:datatype="id" />
8653                         <field name="perm" reporter:datatype="link"/>
8654                         <field name="usr" reporter:datatype="link"/>
8655                 </fields>
8656                 <links>
8657                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8658                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8659                 </links>
8660         </class>
8661         <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">
8662                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8663                         <field name="object_id" reporter:datatype="text"/>
8664                         <field name="grantable" reporter:datatype="bool"/>
8665                         <field name="id" reporter:datatype="id" />
8666                         <field name="perm" reporter:datatype="link"/>
8667                         <field name="usr" reporter:datatype="link"/>
8668                         <field name="object_type" reporter:datatype="text"/>
8669                 </fields>
8670                 <links>
8671                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8672                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8673                 </links>
8674         </class>
8675         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8676                 <fields oils_persist:primary="id" oils_persist:sequence="">
8677                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8678                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8679                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8680                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8681                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8682                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8683                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8684                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8685                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8686                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8687                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8688                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8689                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8690                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8691                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8692                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8693                 </fields>
8694                 <links>
8695                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8696                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8697                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8698                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8699                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8700                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8701                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8702                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8703                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8704                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
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" jump="usr" field="home_ou"/>
8710                 </retrieve>
8711                         </actions>
8712                 </permacrud>
8713         </class>
8714         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8715                 oils_obj:fieldmapper="money::aged_payment" 
8716                 oils_persist:tablename="money.aged_payment" 
8717                 reporter:label="Payments: Aged">
8718                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8719                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8720                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8721                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8722                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8723                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8724                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8725                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8726                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8727                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8728                         <field name="billing" reporter:datatype="link"/>
8729                 </fields>
8730                 <links>
8731                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8732                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8733                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8734                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8735                 </links>
8736                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8737                         <actions>
8738                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8739                                         <context link="xact" field="usr_home_ou"/>
8740                                 </retrieve>
8741                         </actions>
8742                 </permacrud>
8743         </class>
8744         <class id="mallp" controller="open-ils.cstore" 
8745                 oils_obj:fieldmapper="money::all_payments" 
8746                 oils_persist:tablename="money.all_payments" 
8747                 oils_persist:readonly="true" reporter:core="true"
8748                 reporter:label="Payments: All">
8749                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8750                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8751                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8752                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8753                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8754                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8755                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8756                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8757                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8758                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8759                         <field name="billing" reporter:datatype="link"/>
8760                 </fields>
8761                 <links>
8762                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8763                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8764                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8765                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8766                 </links>
8767         </class>
8768
8769         <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">
8770                 <fields oils_persist:primary="id" oils_persist:sequence="">
8771                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8772                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8773                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8774                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8775                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8776                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8777                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8778                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8779                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8780                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8781                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8782                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8783                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8784                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8785                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8786                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8787                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8788                 </fields>
8789                 <links>
8790                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8791                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8792                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8793                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8794                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8795                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8796                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8797                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8798                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8799                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8800                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8801                 </links>
8802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8803                         <actions>
8804                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8805                                         <context link="xact" jump="usr" field="home_ou"/>
8806                                 </retrieve>
8807                         </actions>
8808                 </permacrud>
8809         </class>
8810         <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">
8811                 <fields oils_persist:primary="id" oils_persist:sequence="">
8812                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8813                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8814                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8815                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8816                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8817                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8818                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8819                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8820                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8821                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8822                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8823                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8824                 </fields>
8825                 <links>
8826                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8827                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8828                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8829                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8830                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8831                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8832                 </links>
8833         </class>
8834         <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">
8835                 <fields oils_persist:primary="id" oils_persist:sequence="">
8836                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8837                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8838                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8839                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8840                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8841                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8842                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8843                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8844                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8845                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8846                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8847                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8848                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8849                 </fields>
8850                 <links>
8851                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8852                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8853                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8854                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8855                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8856                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8857                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8858                 </links>
8859         </class>
8860         <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">
8861                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8862                         <field name="bucket" reporter:datatype="link"/>
8863                         <field name="id" reporter:datatype="id" />
8864                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8865                         <field name="create_time" reporter:datatype="timestamp" />
8866                         <field name="pos" reporter:datatype="int" />
8867                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8868                 </fields>
8869                 <links>
8870                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8871                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8872             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8873                 </links>
8874                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8875                         <actions>
8876                                 <retrieve permission="ADMIN_COPY_BUCKET">
8877                     <context link="bucket" field="owning_lib"/>
8878                 </retrieve>
8879             </actions>
8880         </permacrud>
8881         </class>
8882         <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">
8883                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8884                         <field name="id" reporter:datatype="id" />
8885                         <field name="item" reporter:datatype="link"/>
8886                         <field name="note" reporter:datatype="text" />
8887                 </fields>
8888                 <links>
8889                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8890                 </links>
8891         </class>
8892         <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">
8893                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8894                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8895                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8896                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8897                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8898                 </fields>
8899                 <links>
8900                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8901                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8902                 </links>
8903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8904                         <actions>
8905                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8906                     <context link="stat_cat" field="owner"/>
8907                 </create>
8908                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8909                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8910                     <context link="stat_cat" field="owner"/>
8911                 </update>
8912                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8913                     <context link="stat_cat" field="owner"/>
8914                 </delete>
8915                         </actions>
8916                 </permacrud>
8917         </class>
8918     <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">
8919         <fields oils_persist:primary="field">
8920             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8921             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8922             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8923         </fields>
8924         <links/>
8925         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8926             <actions>
8927                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8928                 <retrieve />
8929                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8930                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8931             </actions>
8932         </permacrud>
8933     </class>
8934         <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">
8935                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8936                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8937                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8938                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool" />
8939                 </fields>
8940                 <links/>
8941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8942             <actions>
8943                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8944                 <retrieve/>
8945                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8946                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8947             </actions>
8948         </permacrud>
8949         </class>
8950
8951
8952         <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">
8953                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8954                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8955                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8956                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8957                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8958                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8959                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8960                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8961                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8962                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8963                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8964                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8965                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8966                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8967                 </fields>
8968                 <links>
8969                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8970                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8971                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8972                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8973                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8974                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8975                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8976                 </links>
8977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8978             <actions>
8979                 <create permission="TRANSIT_COPY">
8980                     <context link="target_copy" field="owner"/>
8981                 </create>
8982                 <retrieve/>
8983                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8984                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8985             </actions>
8986         </permacrud>
8987         </class>
8988         <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">
8989                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8990                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8991                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8992                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8993                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8994                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8995                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8996                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8997                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8998                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8999                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
9000                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
9001                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
9002                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9003                 </fields>
9004                 <links>
9005                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
9006                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
9007                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
9008                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
9009                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
9010                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
9011                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9012                 </links>
9013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9014             <actions>
9015                 <create permission="TRANSIT_COPY" context_field="owner">
9016                     <context link="target_copy" field="circ_lib"/>
9017                 </create>
9018                 <retrieve/>
9019                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
9020                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
9021             </actions>
9022         </permacrud>
9023         </class>
9024         <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">
9025                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9026                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9027                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9028                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9029                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9030                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9031                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9032                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9033                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9034                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9035                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9036                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9037                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9038                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9039                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
9040                 </fields>
9041                 <links>
9042                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9043                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9044                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9045                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
9046                 </links>
9047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9048             <actions>
9049                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9050                     <context link="xact" jump="usr" field="home_ou"/>
9051                 </retrieve>
9052                         </actions>
9053                 </permacrud>
9054         </class>
9055         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9056                 oils_obj:fieldmapper="money::aged_billing" 
9057                 oils_persist:tablename="money.aged_billing" 
9058                 reporter:label="Aged Billing Line Item">
9059                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9060                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9061                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9062                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9063                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9064                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9065                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9066                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9067                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9068                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9069                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9070                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9071                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9072                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9073                 </fields>
9074                 <links>
9075                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9076                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9077                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9078                 </links>
9079                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9080                         <actions>
9081                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9082                                         <context link="xact" field="usr_home_ou"/>
9083                                 </retrieve>
9084                         </actions>
9085                 </permacrud>
9086         </class>
9087         <class id="mallb" controller="open-ils.cstore" 
9088                 oils_obj:fieldmapper="money::all_billings" 
9089                 oils_persist:tablename="money.all_billings" 
9090                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9091                 <fields oils_persist:primary="id" oils_persist:sequence="">
9092                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9093                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9094                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9095                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9096                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9097                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9098                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9099                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9100                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9101                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9102                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9103                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9104                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9105                 </fields>
9106                 <links>
9107                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9108                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9109                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9110                 </links>
9111         </class>
9112         <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">
9113                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9114                         <field name="grp" />
9115                         <field name="id" reporter:datatype="id" />
9116                         <field name="usr" />
9117                 </fields>
9118                 <links>
9119                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9120                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9121                 </links>
9122         </class>
9123         <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">
9124                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9125                         <field name="id" reporter:datatype="id" />
9126                         <field name="fq_field" reporter:datatype="text"/>
9127                         <field name="identity_value" reporter:datatype="text"/>
9128                         <field name="translation" reporter:datatype="text"/>
9129                         <field name="string" reporter:datatype="text"/>
9130                 </fields>
9131                 <links>
9132                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9133                 </links>
9134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9135             <actions>
9136                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9137                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9138                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9139                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9140             </actions>
9141         </permacrud>
9142         </class>
9143         <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">
9144                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9145                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9146                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9147                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9148                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9149                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9150                 </fields>
9151                 <links>
9152                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9153                 </links>
9154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9155             <actions>
9156                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9157                 <retrieve/>
9158                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9159                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9160             </actions>
9161         </permacrud>
9162         </class>
9163         <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">
9164                 <fields oils_persist:primary="code">
9165                         <field name="code" reporter:datatype="id" />
9166                         <field name="marc_code" reporter:datatype="text"/>
9167                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9168                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9169                         <field name="rtl" reporter:datatype="bool"/>
9170                 </fields>
9171                 <links/>
9172         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9173             <actions>
9174                 <create permission="CREATE_LOCALE" global_required="true"/>
9175                 <retrieve/>
9176                 <update permission="UPDATE_LOCALE" global_required="true"/>
9177                 <delete permission="DELETE_LOCALE" global_required="true"/>
9178             </actions>
9179         </permacrud>
9180         </class>
9181         <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">
9182                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9183                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9184                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9185                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9186                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9187                 </fields>
9188                 <links>
9189                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9190                 </links>
9191         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9192             <actions>
9193                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9194                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9195                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9196                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9197             </actions>
9198         </permacrud>
9199         </class>
9200
9201         <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">
9202                 <fields oils_persist:primary="id">
9203                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9204                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9205                 </fields>
9206                 <links/>
9207         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9208             <actions>
9209                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9210                 <retrieve/>
9211                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9212                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9213             </actions>
9214         </permacrud>
9215         </class>
9216
9217         <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">
9218                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9219                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9220                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9221                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9222                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9223                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9224                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9225                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9226                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9227                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9228                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9229                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9230                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9231                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9232                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9233                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9234                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9235                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9236                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9237                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9238                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9239                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9240                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9241                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9242                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9243                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9244                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9245                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9246                 </fields>
9247                 <links>
9248                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9249                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9250                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9251                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9252                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9253                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9254                 </links>
9255         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9256             <actions>
9257                 <create permission="user_request.create">
9258                     <context link="usr" field="home_ou"/>
9259                                 </create>
9260                 <retrieve permission="user_request.view">
9261                     <context link="usr" field="home_ou"/>
9262                                 </retrieve>
9263                 <update permission="user_request.update">
9264                     <context link="usr" field="home_ou"/>
9265                                 </update>
9266                 <delete permission="user_request.delete">
9267                     <context link="usr" field="home_ou"/>
9268                                 </delete>
9269             </actions>
9270         </permacrud>
9271         </class>
9272
9273         <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">
9274         <oils_persist:source_definition><![CDATA[
9275             SELECT r.*, CASE
9276                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9277                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9278                         WHEN l.state = 'received' THEN 5 -- Received
9279                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9280                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9281                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9282                         WHEN l.id IS NULL THEN 1 -- New
9283                         ELSE 0 -- Error
9284                     END AS request_status
9285                     ,u.home_ou
9286             FROM      acq.user_request r
9287             JOIN actor.usr u ON (r.usr = u.id)
9288             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9289             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9290             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9291         ]]></oils_persist:source_definition>
9292                 <fields oils_persist:primary="id">
9293                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9294                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9295                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9296                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9297                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9298                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9299                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9300                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9301                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9302                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9303                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9304                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9305                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9306                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9307                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9308                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9309                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9310                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9311                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9312                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9313                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9314                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9315                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9316                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9317                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9318                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9319                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9320                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9321                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9322                 </fields>
9323                 <links>
9324                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9325                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9326                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9327                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9328                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9329                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9330                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9331                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9332                 </links>
9333         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9334             <actions>
9335                 <retrieve permission="user_request.view">
9336                     <context link="usr" field="home_ou"/>
9337                                 </retrieve>
9338             </actions>
9339         </permacrud>
9340         </class>
9341
9342         <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">
9343                 <fields oils_persist:primary="id">
9344                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9345                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9346                 </fields>
9347                 <links/>
9348         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9349             <actions>
9350                 <retrieve/>
9351             </actions>
9352         </permacrud>
9353         </class>
9354
9355         <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">
9356                 <fields oils_persist:primary="code">
9357                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9358                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9359                 </fields>
9360                 <links/>
9361         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9362             <actions>
9363                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9364                 <retrieve/>
9365                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9366                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9367             </actions>
9368         </permacrud>
9369         </class>
9370
9371         <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">
9372                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9373                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9374                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9375                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9376                         <field reporter:label="Ratio" name="ratio" />
9377                 </fields>
9378                 <links>
9379                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9380                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9381                 </links>
9382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9383                         <actions>
9384                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9385                                 <retrieve/>
9386                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9387                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9388                         </actions>
9389                 </permacrud>
9390         </class>
9391
9392         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9393                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9394                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9395                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9396                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9397                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9398                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9399                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9400                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9401                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9402                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9403                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9404                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9405                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9406                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9407                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9408                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9409                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9410                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9411                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9412                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9413                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9414                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9415                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9416                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9417                 </fields>
9418                 <links>
9419                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9420                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9421                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9422                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9423                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9424                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9425                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9426                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9427                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9428                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9429                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9430                 </links>
9431         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9432             <actions>
9433                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9434                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9435                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9436                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9437             </actions>
9438         </permacrud>
9439         </class>
9440
9441         <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">
9442                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9443                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9444                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9445                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9446                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9447                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9448                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9449                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9450                 </fields>
9451                 <links>
9452                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9453                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9454                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9455                 </links>
9456         </class>
9457
9458         <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">
9459                 <fields oils_persist:primary="code">
9460                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9461                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9462                 </fields>
9463                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9464             <actions>
9465                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9466                 <retrieve/>
9467                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9468                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9469             </actions>
9470                 </permacrud>
9471         </class>
9472
9473         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9474                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9475                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9476                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9477                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9478                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9479                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9480                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9481                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9482                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9483                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9484                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9485                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9486                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9487                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9488                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9489                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9490                 </fields>
9491                 <links>
9492                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9493                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9494                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9495                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9496                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9497                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9498                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9499                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9500                 </links>
9501         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9502             <actions>
9503                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9504                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9505                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9506                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9507             </actions>
9508         </permacrud>
9509         </class>
9510
9511         <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">
9512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9513                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9514                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9515                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9516                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9517                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9518                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9519                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9520                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9521                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9522                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9523                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
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="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9529                 </links>
9530         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9531             <actions>
9532                 <create   permission="ADMIN_INVOICE">
9533                                         <context link="invoice" field="receiver"/>
9534                                 </create>
9535                 <retrieve permission="ADMIN_INVOICE">
9536                                         <context link="invoice" field="receiver"/>
9537                                 </retrieve>
9538                 <update   permission="ADMIN_INVOICE">
9539                                         <context link="invoice" field="receiver"/>
9540                                 </update>
9541                                 <delete   permission="ADMIN_INVOICE">
9542                                         <context link="invoice" field="receiver"/>
9543                                 </delete>
9544             </actions>
9545         </permacrud>
9546         </class>
9547
9548         <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">
9549                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9550                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9551                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9552                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9553                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9554                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9555                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9556                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9557                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9558                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9559                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9560                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9561                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9562                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9563                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9564                 </fields>
9565                 <links>
9566                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9567                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9568                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9569                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9570                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9571                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9572                 </links>
9573         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9574             <actions>
9575                 <create   permission="ADMIN_INVOICE">
9576                                         <context link="invoice" field="receiver"/>
9577                                 </create>
9578                 <retrieve permission="ADMIN_INVOICE">
9579                                         <context link="invoice" field="receiver"/>
9580                                 </retrieve>
9581                 <update   permission="ADMIN_INVOICE">
9582                                         <context link="invoice" field="receiver"/>
9583                                 </update>
9584                                 <delete   permission="ADMIN_INVOICE">
9585                                         <context link="invoice" field="receiver"/>
9586                                 </delete>
9587             </actions>
9588         </permacrud>
9589         </class>
9590
9591         <class id="acqsn" 
9592                 controller="open-ils.cstore open-ils.pcrud" 
9593                 oils_obj:fieldmapper="acq::shipment_notification" 
9594                 oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9595                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9596                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9597                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9598                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9599                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9600                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp" />
9601                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9602                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp" />
9603                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link" />
9604                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" />
9605                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text" />
9606                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9607                         <field reporter:label="Shipment Notification Entries" name="entries" 
9608                                 reporter:datatype="link" oils_persist:virtual="true"/>
9609                 </fields>
9610                 <links>
9611                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9612                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9613                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9614                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9615                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9616                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9617                 </links>
9618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9619                         <actions>
9620                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9621                                 <update   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9622                                 <delete   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9623                         </actions>
9624                 </permacrud>
9625         </class>
9626
9627         <class id="acqsne" 
9628                 controller="open-ils.cstore open-ils.pcrud" 
9629                 oils_obj:fieldmapper="acq::shipment_notification_entry" 
9630                 oils_persist:tablename="acq.shipment_notification_entry" 
9631                 reporter:label="Shipment Notification Entry">
9632                 <fields oils_persist:primary="id" 
9633                         oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9634                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9635                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" />
9636                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9637                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" />
9638                 </fields>
9639                 <links>
9640                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9641                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9642                 </links>
9643                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9644                                 <actions>
9645                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9646                                                 <context link="shipment_notification" field="receiver"/>
9647                                         </retrieve>
9648                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9649                                                 <context link="shipment_notification" field="receiver"/>
9650                                         </update>
9651                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9652                                                 <context link="shipment_notification" field="receiver"/>
9653                                         </delete>
9654                                 </actions>
9655                         </permacrud>
9656         </class>
9657
9658         <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">
9659                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9660                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9661                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9662                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9663                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9664                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9665                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9666                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9667                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9668                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9669                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9670                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9671                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9672                 </fields>
9673                 <links>
9674                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9675                 </links>
9676         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9677             <actions>
9678                 <create permission="ADMIN_PROVIDER">
9679                     <context link="provider" field="owner"/>
9680                 </create>
9681                 <retrieve permission="ADMIN_PROVIDER">
9682                     <context link="provider" field="owner"/>
9683                 </retrieve>
9684                 <update permission="ADMIN_PROVIDER">
9685                     <context link="provider" field="owner"/>
9686                 </update>
9687                 <delete permission="ADMIN_PROVIDER">
9688                     <context link="provider" field="owner"/>
9689                 </delete>
9690             </actions>
9691         </permacrud>
9692         </class>
9693
9694         <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">
9695                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9696                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9697                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9698                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9699                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9700                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9701                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9702                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9703         </fields>
9704                 <links>
9705                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9706                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9707                 </links>
9708         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9709             <actions>
9710                 <create permission="ADMIN_PROVIDER">
9711                     <context link="provider" field="owner"/>
9712                 </create>
9713                 <retrieve permission="ADMIN_PROVIDER">
9714                     <context link="provider" field="owner"/>
9715                 </retrieve>
9716                 <update permission="ADMIN_PROVIDER">
9717                     <context link="provider" field="owner"/>
9718                 </update>
9719                 <delete permission="ADMIN_PROVIDER">
9720                     <context link="provider" field="owner"/>
9721                 </delete>
9722             </actions>
9723         </permacrud>
9724     </class>
9725         <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">
9726                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9727                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9728                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9729                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9730                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9731                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9732                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9733                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9734                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9735                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9736                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9737                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9738                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9739                 </fields>
9740                 <links>
9741                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9742                 </links>
9743         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9744             <actions>
9745                 <create permission="ADMIN_PROVIDER">
9746                     <context link="contact" jump='provider' field="owner"/>
9747                 </create>
9748                 <retrieve permission="ADMIN_PROVIDER">
9749                     <context link="contact" jump='provider' field="owner"/>
9750                 </retrieve>
9751                 <update permission="ADMIN_PROVIDER">
9752                     <context link="contact" jump='provider' field="owner"/>
9753                 </update>
9754                 <delete permission="ADMIN_PROVIDER">
9755                     <context link="contact" jump='provider' field="owner"/>
9756                 </delete>
9757             </actions>
9758         </permacrud>
9759         </class>
9760
9761         <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">
9762                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9763                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9764                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9765                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9766                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9767                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9768                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9769                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9770                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9771                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9772                 </fields>
9773                 <links>
9774                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9775                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9776                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9777                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9778                 </links>
9779         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9780             <actions>
9781                 <create permission="ADMIN_ACQ_FUND">
9782                     <context link="src_fund" field="org"/>
9783                 </create>
9784                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9785                     <context link="src_fund" field="org"/>
9786                     <context link="dest_fund" field="org"/>
9787                 </retrieve>
9788                 <update permission="ADMIN_ACQ_FUND">
9789                     <context link="src_fund" field="org"/>
9790                 </update>
9791                 <delete permission="ADMIN_ACQ_FUND">
9792                     <context link="src_fund" field="org"/>
9793                 </delete>
9794             </actions>
9795         </permacrud>
9796         </class>
9797
9798         <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">
9799                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9800                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9801                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9802                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9803                 </fields>
9804                 <links>
9805             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9806                 </links>
9807                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9808                         <actions>
9809                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9810                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9811                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9812                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9813                         </actions>
9814                 </permacrud>
9815         </class>
9816
9817         <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">
9818                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9819                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9820                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9821                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9822                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9823                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9824                 </fields>
9825                 <links>
9826                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9827                 </links>
9828                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9829                         <actions>
9830                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9831                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9832                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9833                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9834                         </actions>
9835                 </permacrud>
9836         </class>
9837
9838         <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">
9839                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9840                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9841                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9842                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9843                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9844                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9845                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9846                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9847                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9848                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9849                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9850                 </fields>
9851                 <links>
9852                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9853                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9854             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9855             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9856                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9857                 </links>
9858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9859             <actions>
9860                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9861                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9862                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9863                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9864             </actions>
9865         </permacrud>
9866         </class>
9867
9868         <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">
9869                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9870                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9871                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9872                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9873                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9874                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9875                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9876                 </fields>
9877                 <links>
9878                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9879                 </links>
9880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9881                         <actions>
9882                                 <create permission="ADMIN_FUNDING_SOURCE">
9883                     <context link="funding_source" field="owner"/>
9884                 </create>
9885                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9886                     <context link="funding_source" field="owner"/>
9887                 </retrieve>
9888                                 <update permission="ADMIN_FUNDING_SOURCE">
9889                     <context link="funding_source" field="owner"/>
9890                 </update>
9891                                 <delete permission="ADMIN_FUNDING_SOURCE">
9892                     <context link="funding_source" field="owner"/>
9893                 </delete>
9894                         </actions>
9895                 </permacrud>
9896         </class>
9897
9898         <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">
9899                 <fields oils_persist:primary="id">
9900                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9901                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9902                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9903                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9904                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9905                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9906                 </fields>
9907                 <links>
9908                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9909                 </links>
9910         </class>
9911
9912         <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">
9913                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9914                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9915                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9916                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9917                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9918                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9919                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9920                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9921                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9922                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9923                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9924                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9925                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9926                 </fields>
9927                 <links>
9928                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9929                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9930                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9931                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9932                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9933                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9934                 </links>
9935                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9936                         <actions>
9937                                 <create permission="ADMIN_ACQ_FUND">
9938                     <context link="fund" field="org"/>
9939                 </create>
9940                                 <retrieve permission="ADMIN_ACQ_FUND">
9941                     <context link="fund" field="org"/>
9942                 </retrieve>
9943                                 <update permission="ADMIN_ACQ_FUND">
9944                     <context link="fund" field="org"/>
9945                 </update>
9946                                 <delete permission="ADMIN_ACQ_FUND">
9947                     <context link="fund" field="org"/>
9948                 </delete>
9949                         </actions>
9950                 </permacrud>
9951         </class>
9952
9953         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9954                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9955                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9956                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9957                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9958                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9959                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9960                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9961                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9962                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9963                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9964                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9965                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9966                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9967                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9968                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9969                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9970                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9971                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9972                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9973                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9974                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9975                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9976                 </fields>
9977                 <links>
9978                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9979                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9980             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9981             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9982             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9983             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9984             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9985             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9986             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9987             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9988             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9989                 </links>
9990         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9991             <actions>
9992                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9993                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9994                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9995                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9996             </actions>
9997         </permacrud>
9998         </class>
9999
10000         <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">
10001                 <fields oils_persist:primary="fund">
10002                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10003                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10004                 </fields>
10005                 <links>
10006                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10007                 </links>
10008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10009             <actions>
10010                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10011                                         <context link="fund" field="org" />
10012                 </retrieve>
10013             </actions>
10014         </permacrud>
10015         </class>
10016
10017         <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">
10018                 <fields oils_persist:primary="fund">
10019                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10020                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
10021                 </fields>
10022                 <links>
10023                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10024                 </links>
10025         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10026             <actions>
10027                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10028                                         <context link="fund" field="org" />
10029                 </retrieve>
10030             </actions>
10031         </permacrud>
10032         </class>
10033
10034         <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">
10035                 <fields oils_persist:primary="fund">
10036                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10037                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
10038                 </fields>
10039                 <links>
10040                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10041                 </links>
10042         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10043             <actions>
10044                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10045                                         <context link="fund" field="org" />
10046                 </retrieve>
10047             </actions>
10048         </permacrud>
10049         </class>
10050
10051         <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">
10052                 <fields oils_persist:primary="fund">
10053                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10054                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10055                 </fields>
10056                 <links>
10057                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10058                 </links>
10059         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10060             <actions>
10061                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10062                                         <context link="fund" field="org" />
10063                 </retrieve>
10064             </actions>
10065         </permacrud>
10066         </class>
10067
10068         <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">
10069                 <fields oils_persist:primary="fund">
10070                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10071                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
10072                 </fields>
10073                 <links>
10074                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10075                 </links>
10076         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10077             <actions>
10078                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10079                                         <context link="fund" field="org" />
10080                 </retrieve>
10081             </actions>
10082         </permacrud>
10083         </class>
10084
10085    <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">
10086         <fields oils_persist:primary="fund">
10087             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10088             <field reporter:label="Total Allocation Amount" 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="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">
10096         <fields oils_persist:primary="fund">
10097             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10098             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
10099         </fields>
10100         <links>
10101             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10102         </links>
10103     </class>
10104
10105    <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">
10106         <fields oils_persist:primary="fund">
10107             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10108             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10109         </fields>
10110         <links>
10111             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10112         </links>
10113     </class>
10114
10115    <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">
10116         <fields oils_persist:primary="fund">
10117             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10118             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10119         </fields>
10120         <links>
10121             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10122         </links>
10123     </class>
10124
10125    <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">
10126         <fields oils_persist:primary="fund">
10127             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10128             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10129         </fields>
10130         <links>
10131             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10132         </links>
10133     </class>
10134
10135         <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">
10136                 <fields oils_persist:primary="funding_source">
10137                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10138                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10139                 </fields>
10140                 <links>
10141                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10142                 </links>
10143         </class>
10144
10145         <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">
10146                 <fields oils_persist:primary="funding_source">
10147                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10148                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10149                 </fields>
10150                 <links>
10151                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10152                 </links>
10153         </class>
10154
10155         <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">
10156                 <fields oils_persist:primary="funding_source">
10157                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10158                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10159                 </fields>
10160                 <links>
10161                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10162                 </links>
10163         </class>
10164
10165         <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">
10166                 <fields oils_persist:primary="fund">
10167                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10168                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10169                 </fields>
10170                 <links>
10171                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10172                 </links>
10173         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10174             <actions>
10175                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10176                                         <context link="fund" field="org" />
10177                 </retrieve>
10178             </actions>
10179         </permacrud>
10180     </class>
10181     <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">
10182         <oils_persist:source_definition><![CDATA[
10183             SELECT
10184                 acqf.*,
10185                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10186                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10187                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10188                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10189             FROM
10190                 acq.fund acqf
10191                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10192                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10193                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10194                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10195         ]]></oils_persist:source_definition>
10196         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10197             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10198             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10199             <field reporter:label="Name" name="name" reporter:datatype="text" />
10200             <field reporter:label="Year" name="year" reporter:datatype="int" />
10201             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10202             <field reporter:label="Code" name="code" reporter:datatype="text" />
10203             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10204             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10205             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10206             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10207             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10208
10209             <!-- non fund-native fields -->
10210             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10211             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10212             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10213             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10214         </fields>
10215         <links>
10216             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10217             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10218             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10219         </links>
10220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10221             <actions>
10222                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10223             </actions>
10224         </permacrud>
10225         </class>
10226         <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">
10227                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10228                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10229                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10230                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10231                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10232                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10233                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10234                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10235                 </fields>
10236                 <links>
10237                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10238                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10239                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10240                 </links>
10241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10242                         <actions>
10243                                 <create permission="ADMIN_ACQ_FUND">
10244                     <context link="fund" field="org"/>
10245                 </create>
10246                                 <retrieve permission="ADMIN_ACQ_FUND">
10247                     <context link="fund" field="org"/>
10248                 </retrieve>
10249                                 <update permission="ADMIN_ACQ_FUND">
10250                     <context link="fund" field="org"/>
10251                 </update>
10252                                 <delete permission="ADMIN_ACQ_FUND">
10253                     <context link="fund" field="org"/>
10254                 </delete>
10255                         </actions>
10256                 </permacrud>
10257         </class>
10258
10259     <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">
10260         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10261             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10262             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10263             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10264             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10265             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10266             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10267             <field reporter:label="Note" name="note" reporter:datatype="text" />
10268             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10269         </fields>
10270         <links>
10271             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10272             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10273             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10274         </links>
10275                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10276                         <actions>
10277                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10278                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10279                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10280                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10281                         </actions>
10282                 </permacrud>
10283     </class>
10284
10285         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10286                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10287                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10288                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10289                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10290                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10291                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10292                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10293                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10294                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10295                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10296                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10297                 </fields>
10298                 <links>
10299                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10300                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10301                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10302                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10303                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10304                 </links>
10305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10306                         <actions>
10307                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10308                         </actions>
10309                 </permacrud>
10310         </class>
10311
10312         <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">
10313                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10314                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10315                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10316                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10317                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10318                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10319                 </fields>
10320                 <links>
10321                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10322                 </links>
10323                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10324                         <actions>
10325                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10326                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10327                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10328                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10329                         </actions>
10330                 </permacrud>
10331         </class>
10332
10333         <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">
10334                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10335                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10336                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10337                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10338                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10339                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10340                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10341                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10342                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10343                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10344                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10345                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10346                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10347                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10348                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10349                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10350                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10351                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10352                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10353                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10354                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10355                 </fields>
10356                 <links>
10357                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10358                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10359                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10360                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10361                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10362                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10363                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10364                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10365                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10366                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10367                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10368                 </links>
10369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10370                         <actions>
10371                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10372                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10373                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10374                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10375                         </actions>
10376                 </permacrud>
10377         </class>
10378
10379         <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">
10380                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10381                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10382                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10383                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10384                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10385                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10386                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10387                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10388                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10389                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10390                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10391                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10392                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10393                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10394                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10395                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10396                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10397                 </fields>
10398                 <links>
10399                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10400                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10401                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10402                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10403                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10404                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10405                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10406                 </links>
10407                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10408             <actions>
10409                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10410             </actions>
10411                 </permacrud>
10412         </class>
10413
10414         <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">
10415                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10416                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10417                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10418                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10419                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10420                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10421                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10422                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10423                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10424                 </fields>
10425                 <links>
10426                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10427                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10428                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10429                 </links>
10430                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10431             <actions>
10432                 <create permission="CREATE_PURCHASE_ORDER">
10433                     <context link="purchase_order" field="ordering_agency"/>
10434                 </create>
10435                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10436                     <context link="purchase_order" field="ordering_agency"/>
10437                 </retrieve>
10438                 <update permission="CREATE_PURCHASE_ORDER">
10439                     <context link="purchase_order" field="ordering_agency"/>
10440                 </update>
10441                 <delete permission="CREATE_PURCHASE_ORDER">
10442                     <context link="purchase_order" field="ordering_agency"/>
10443                 </delete>
10444             </actions>
10445                 </permacrud>
10446         </class>
10447
10448         <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">
10449                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10450                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10451                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10452                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10453                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10454                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10455                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10456                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10457                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10458                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10459                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10460                 </fields>
10461                 <links>
10462                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10463                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10464                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10465                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10466                 </links>
10467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10468             <actions>
10469                 <create permission="CREATE_PURCHASE_ORDER">
10470                     <context link="purchase_order" field="ordering_agency"/>
10471                 </create>
10472                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10473                     <context link="purchase_order" field="ordering_agency"/>
10474                 </retrieve>
10475                 <update permission="CREATE_PURCHASE_ORDER">
10476                     <context link="purchase_order" field="ordering_agency"/>
10477                 </update>
10478                 <delete permission="CREATE_PURCHASE_ORDER">
10479                     <context link="purchase_order" field="ordering_agency"/>
10480                 </delete>
10481             </actions>
10482                 </permacrud>
10483         </class>
10484
10485         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10486                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10487                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10488                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10489                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10490                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10491                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10492                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10493                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10494                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10495                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10496                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10497                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10498                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10499                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10500                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10501                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10502                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10503                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10504                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10505                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10506                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10507                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10508                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10509                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10510                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10511                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10512                 </fields>
10513                 <links>
10514                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10515                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10516                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10517                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10518                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10519                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10520                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10521                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10522                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10523                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10524                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10525                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10526                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10527                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10528                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10529                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10530                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10531                 </links>
10532                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10533                         <actions>
10534                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10535                                         <context link="purchase_order" field="ordering_agency"/>
10536                                         <context link="picklist" field="org_unit"/>
10537                                 </retrieve>
10538                         </actions>
10539                 </permacrud>
10540         </class>
10541
10542         <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">
10543                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10544                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10545                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10546                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10547                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10548                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10549                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10550                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10551                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10552                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10553                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10554                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10555                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10556                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10557                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10558                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10559                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10560                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10561                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10562                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10563                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10564                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10565                 </fields>
10566                 <links>
10567                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10568                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10569                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10570                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10571                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10572                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10573                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10574                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10575                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10576                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10577                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10578                 </links>
10579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10580                         <actions>
10581                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10582                                         <context link="purchase_order" field="ordering_agency"/>
10583                                         <context link="picklist" field="org_unit"/>
10584                                 </retrieve>
10585                         </actions>
10586                 </permacrud>
10587         </class>
10588
10589         <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">
10590                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10591                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10592                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10593                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10594                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10595                 </fields>
10596                 <links>
10597                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10598                 </links>
10599                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10600                         <actions>
10601                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10602                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10603                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10604                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10605                         </actions>
10606                 </permacrud>
10607         </class>
10608
10609         <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">
10610                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10611                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10612                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10613                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10614                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10615                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10616                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10617                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10618                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10619                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10620                 </fields>
10621                 <links>
10622                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10623                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10624                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10625                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10626                 </links>
10627         </class>
10628
10629         <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">
10630                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10631                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10632                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10633                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10634                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10635                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10636                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10637                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10638                 </fields>
10639                 <links>
10640                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10641                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10642                 </links>
10643         </class>
10644
10645         <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">
10646                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10647                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10648                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10649                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10650                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10651                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10652                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10653                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10654                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10655                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10656                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10657                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10658                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10659                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10660                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10661                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10662                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10663                 </fields>
10664                 <links>
10665                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10666                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10667                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10668                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10669                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10670                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10671                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10672                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10673                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10674                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10675                 </links>
10676         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10677             <actions>
10678                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10679                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10680                     <context link="lineitem" jump="picklist" field="org_unit"/>
10681                 </retrieve>
10682             </actions>
10683         </permacrud>
10684         </class>
10685
10686         <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">
10687                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10688                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10689                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10690                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10691                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10692                 </fields>
10693                 <links/>
10694                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10695                         <actions>
10696                                 <retrieve />
10697                         </actions>
10698                 </permacrud>
10699         </class>
10700
10701         <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">
10702                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10703                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10704                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10705                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10706                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10707                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10708             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10709                 </fields>
10710                 <links/>
10711         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10712             <actions>
10713                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10714                 <retrieve />
10715                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10716                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10717             </actions>
10718         </permacrud>
10719         </class>
10720
10721         <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">
10722                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10723                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10724                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10725                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10726                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10727                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10728                 </fields>
10729                 <links/>
10730         </class>
10731         <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">
10732                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10733                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10734                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10735                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10736                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10737                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10738                 </fields>
10739                 <links>
10740                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10741                 </links>
10742         </class>
10743
10744         <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">
10745             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10746                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10747                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10748                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10749                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10750                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10751                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10752         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10753
10754             </fields>
10755             <links>
10756                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10757             </links>
10758             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10759                 <actions>
10760                     <create permission="ADMIN_PROVIDER">
10761                         <context link="provider" field="owner"/>
10762                     </create>
10763                     <retrieve permission="ADMIN_PROVIDER">
10764                         <context link="provider" field="owner"/>
10765                     </retrieve>
10766                     <update permission="ADMIN_PROVIDER">
10767                         <context link="provider" field="owner"/>
10768                     </update>
10769                     <delete permission="ADMIN_PROVIDER">
10770                         <context link="provider" field="owner"/>
10771                     </delete>
10772                 </actions>
10773             </permacrud>
10774         </class>
10775         
10776         <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">
10777             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10778                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10779                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10780                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10781                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10782             </fields>
10783             <links>
10784                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10785             </links>
10786             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10787                 <actions>
10788                     <create permission="ADMIN_PROVIDER">
10789                         <context link="provider" field="owner"/>
10790                     </create>
10791                     <retrieve permission="ADMIN_PROVIDER">
10792                         <context link="provider" field="owner"/>
10793                     </retrieve>
10794                     <update permission="ADMIN_PROVIDER">
10795                         <context link="provider" field="owner"/>
10796                     </update>
10797                     <delete permission="ADMIN_PROVIDER">
10798                         <context link="provider" field="owner"/>
10799                     </delete>
10800                 </actions>
10801             </permacrud>
10802         </class>
10803         
10804         <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">
10805             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10806                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10807                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10808                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10809                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10810                 </fields>
10811                 <links/>
10812         </class>
10813
10814         <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">
10815                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10816                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10817                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10818                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10819                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10820                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10821                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10822                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10823                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10824                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10825                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10826                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10827                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10828                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10829                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10830                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10831                 </fields>
10832                 <links>
10833                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10834                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10835                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10836                 </links>
10837         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10838             <actions>
10839                 <create permission="ADMIN_PROVIDER">
10840                     <context link="provider" field="owner"/>
10841                 </create>
10842                 <retrieve permission="ADMIN_PROVIDER">
10843                     <context link="provider" field="owner"/>
10844                 </retrieve>
10845                 <update permission="ADMIN_PROVIDER">
10846                     <context link="provider" field="owner"/>
10847                 </update>
10848                 <delete permission="ADMIN_PROVIDER">
10849                     <context link="provider" field="owner"/>
10850                 </delete>
10851             </actions>
10852         </permacrud>
10853         </class>
10854
10855         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10856                 oils_obj:fieldmapper="acq::edi_attr" 
10857                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10858                 <fields oils_persist:primary="key">
10859                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10860                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10861                 </fields>
10862         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10863             <actions>
10864                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10865                 <retrieve/>
10866                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10867                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10868             </actions>
10869         </permacrud>
10870         </class>
10871         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10872                 oils_obj:fieldmapper="acq::edi_attr_set" 
10873                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10874                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10875                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10876                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10877                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10878                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10879                 </fields>
10880                 <links>
10881                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10882                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10883                 </links>
10884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10885             <actions>
10886                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10887                 <retrieve/>
10888                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10889                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10890             </actions>
10891         </permacrud>
10892         </class>
10893         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10894                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10895                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10896                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10897                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10898                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10899                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10900                 </fields>
10901                 <links>
10902                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10903                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10904                 </links>
10905         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10906             <actions>
10907                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10908                 <retrieve/>
10909                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10910                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10911             </actions>
10912         </permacrud>
10913         </class>
10914
10915
10916         <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">
10917                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10918                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10919                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10920                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10921                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10922                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10923                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10924                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10925                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10926                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10927                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10928                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10929                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10930                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10931                 </fields>
10932                 <links>
10933                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10934                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10935                 </links>
10936         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10937             <actions>
10938                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10939                     <context link="account" jump="provider" field="owner"/>
10940                 </retrieve>
10941                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10942                     <context link="account" jump="provider" field="owner"/>
10943                 </update>
10944                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10945                     <context link="account" jump="provider" field="owner"/>
10946                 </delete>
10947             </actions>
10948         </permacrud>
10949         </class>
10950
10951
10952         <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">
10953                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10954                         <field name="id" reporter:datatype="id" />
10955                         <field name="parent" reporter:datatype="link"/>
10956                         <field name="owner" reporter:datatype="link"/>
10957                         <field name="create_time" reporter:datatype="timestamp"/>
10958                         <field name="name" reporter:datatype="text"/>
10959                         <field name="shared" reporter:datatype="bool"/>
10960                         <field name="share_with" reporter:datatype="link"/>
10961                         <field name="simple_reporter" reporter:datatype="bool"/>
10962                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10963                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10964                 </fields>
10965                 <links>
10966                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10967                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10968                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10969                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10970                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10971                 </links>
10972         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10973             <actions>
10974                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10975                     <context link="owner" field="home_ou"/>
10976                 </create>
10977                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10978                     <context link="owner" field="home_ou"/>
10979                 </retrieve>
10980                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10981                     <context link="owner" field="home_ou"/>
10982                 </update>
10983                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10984                     <context link="owner" field="home_ou"/>
10985                 </delete>
10986             </actions>
10987         </permacrud>
10988         </class>
10989         <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">
10990                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10991                         <field name="id" reporter:datatype="id" />
10992                         <field name="parent" reporter:datatype="link"/>
10993                         <field name="owner" reporter:datatype="link"/>
10994                         <field name="create_time" reporter:datatype="timestamp"/>
10995                         <field name="name" reporter:datatype="text"/>
10996                         <field name="shared" reporter:datatype="bool"/>
10997                         <field name="share_with" reporter:datatype="link"/>
10998                         <field name="simple_reporter" reporter:datatype="bool"/>
10999                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
11000                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
11001                 </fields>
11002                 <links>
11003                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11004                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
11005                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
11006                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11007                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
11008                 </links>
11009         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11010             <actions>
11011                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11012                     <context link="owner" field="home_ou"/>
11013                 </create>
11014                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11015                     <context link="owner" field="home_ou"/>
11016                 </retrieve>
11017                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11018                     <context link="owner" field="home_ou"/>
11019                 </update>
11020                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11021                     <context link="owner" field="home_ou"/>
11022                 </delete>
11023             </actions>
11024         </permacrud>
11025         </class>
11026         <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">
11027                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
11028                         <field name="id" reporter:datatype="id" />
11029                         <field name="parent" reporter:datatype="link"/>
11030                         <field name="owner" reporter:datatype="link"/>
11031                         <field name="create_time" reporter:datatype="timestamp"/>
11032                         <field name="name" reporter:datatype="text"/>
11033                         <field name="shared" reporter:datatype="bool"/>
11034                         <field name="share_with" reporter:datatype="link"/>
11035                         <field name="simple_reporter" reporter:datatype="bool"/>
11036                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
11037                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11038                 </fields>
11039                 <links>
11040                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11041                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
11042                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
11043                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11044                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
11045                 </links>
11046         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11047             <actions>
11048                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11049                     <context link="owner" field="home_ou"/>
11050                 </create>
11051                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11052                     <context link="owner" field="home_ou"/>
11053                 </retrieve>
11054                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11055                     <context link="owner" field="home_ou"/>
11056                 </update>
11057                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11058                     <context link="owner" field="home_ou"/>
11059                 </delete>
11060             </actions>
11061         </permacrud>
11062         </class>
11063         <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">
11064                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
11065                         <field name="id" reporter:datatype="id" />
11066                         <field name="owner" reporter:datatype="link"/>
11067                         <field name="create_time" reporter:datatype="timestamp"/>
11068                         <field name="name" reporter:datatype="text"/>
11069                         <field name="data" reporter:datatype="text"/>
11070                         <field name="folder" reporter:datatype="link"/>
11071                         <field name="description" reporter:datatype="text"/>
11072                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11073                 </fields>
11074                 <links>
11075                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11076                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
11077                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
11078                 </links>
11079         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11080             <actions>
11081                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11082                     <context link="owner" field="home_ou"/>
11083                 </create>
11084                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11085                     <context link="owner" field="home_ou"/>
11086                 </retrieve>
11087                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11088                     <context link="owner" field="home_ou"/>
11089                 </update>
11090                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11091                     <context link="owner" field="home_ou"/>
11092                 </delete>
11093             </actions>
11094         </permacrud>
11095         </class>
11096         <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">
11097                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11098                         <field name="id" reporter:datatype="id" />
11099                         <field name="owner" reporter:datatype="link"/>
11100                         <field name="create_time" reporter:datatype="timestamp"/>
11101                         <field name="template" reporter:datatype="link"/>
11102                         <field name="data" reporter:datatype="text"/>
11103                         <field name="folder" reporter:datatype="link"/>
11104                         <field name="recur" reporter:datatype="bool"/>
11105                         <field name="recurrence" reporter:datatype="interval"/>
11106                         <field name="name" reporter:datatype="text"/>
11107                         <field name="description" reporter:datatype="text"/>
11108                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11109                 </fields>
11110                 <links>
11111                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11112                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11113                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11114                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11115                 </links>
11116         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11117             <actions>
11118                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11119                     <context link="owner" field="home_ou"/>
11120                 </create>
11121                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11122                     <context link="owner" field="home_ou"/>
11123                 </retrieve>
11124                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11125                     <context link="owner" field="home_ou"/>
11126                 </update>
11127                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11128                     <context link="owner" field="home_ou"/>
11129                 </delete>
11130             </actions>
11131         </permacrud>
11132         </class>
11133         <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">
11134                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11135                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11136                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11137                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11138                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11139                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11140                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11141                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11142                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11143                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11144                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11145                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11146                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11147                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11148                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11149                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11150                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11151                 </fields>
11152                 <links>
11153                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11154                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11155                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11156                 </links>
11157         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11158             <actions>
11159                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11160                     <context link="runner" field="home_ou"/>
11161                 </create>
11162                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11163                     <context link="runner" field="home_ou"/>
11164                 </retrieve>
11165                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11166                     <context link="runner" field="home_ou"/>
11167                 </update>
11168                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11169                     <context link="runner" field="home_ou"/>
11170                 </delete>
11171             </actions>
11172         </permacrud>
11173         </class>
11174     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11175            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11176            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11177                 <fields oils_persist:primary="run">
11178             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11179             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11180             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11181             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11182             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11183             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11184             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11185             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11186             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11187             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11188             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11189             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11190             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11191             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11192             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11193             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11194                 </fields>
11195                 <links>
11196             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11197             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11198             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11199             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11200             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11201             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11202             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11203             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11204             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11205                 </links>
11206         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11207             <actions>
11208                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11209                     <context link="runner" field="home_ou"/>
11210                 </retrieve>
11211             </actions>
11212         </permacrud>
11213     </class>
11214         <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">
11215                 <fields oils_persist:primary="id">
11216                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11217                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11218                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11219                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11220                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11221                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11222                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11223                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11224                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11225                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11226                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11227                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11228                 </fields>
11229                 <links>
11230                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11231                 </links>
11232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11233                         <actions>
11234                                 <retrieve />
11235                         </actions>
11236                 </permacrud>
11237         </class>
11238         <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">
11239                 <fields oils_persist:primary="id">
11240                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11241                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11242                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11243                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11244                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11245                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11246                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11247                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11248                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11249                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11250                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11251                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11252                 </fields>
11253                 <links>
11254                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11255                 </links>
11256         </class>
11257         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11258                 <fields oils_persist:primary="id">
11259                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11260                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11261                         <field reporter:label="Fingerprint" name="fingerprint" />
11262                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11263                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11264                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11265                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11266                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11267                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11268                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11269                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11270                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11271                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11272                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11273                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11274                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11275                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11276                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11277                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11278                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11279                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11280                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11281                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11282                 </fields>
11283                 <links>
11284                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11285                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11286                 </links>
11287         </class>
11288         <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">
11289                 <fields oils_persist:primary="id">
11290                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11291                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11292                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11293                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11294                 </fields>
11295                 <links>
11296                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11297                 </links>
11298         </class>
11299         <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">
11300                 <fields oils_persist:primary="id">
11301                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11302                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11303                 </fields>
11304                 <links>
11305                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11306                 </links>
11307         </class>
11308         <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">
11309                 <fields oils_persist:primary="id">
11310                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11311                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11312                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11313                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11314                 </fields>
11315                 <links>
11316                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11317                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11318                 </links>
11319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11320                         <actions>
11321                                 <retrieve permission="VIEW_HOLD">
11322                                         <context link="id" field="pickup_lib"/>
11323                                 </retrieve>
11324                         </actions>
11325                 </permacrud>
11326         </class>
11327         <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">
11328                 <fields oils_persist:primary="xact">
11329                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11330                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11331                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11332                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11333                 </fields>
11334                 <links>
11335                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11336                 </links>
11337         </class>
11338         <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">
11339                 <fields oils_persist:primary="xact">
11340                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11341                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11342                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11343                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11344                 </fields>
11345                 <links>
11346                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11347                 </links>
11348         </class>
11349         <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)">
11350                 <fields oils_persist:primary="id">
11351                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11352                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11353                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11354                 </fields>
11355                 <links>
11356                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11357                 </links>
11358         </class>
11359         <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">
11360                 <fields oils_persist:primary="id">
11361                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11362                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11363                 </fields>
11364                 <links>
11365                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11366                 </links>
11367                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11368                         <actions>
11369                                 <retrieve permission="STAFF_LOGIN">
11370                                         <context link="id" field="circ_lib"/>
11371                                 </retrieve>
11372                         </actions>
11373                 </permacrud>
11374         </class>
11375         <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">
11376                 <fields oils_persist:primary="bibid">
11377                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11378                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11379                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11380                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11381                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11382                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11383                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11384                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11385                 </fields>
11386                 <links>
11387                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11388                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11389                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11390                 </links>
11391         </class>
11392         <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">
11393                 <fields oils_persist:primary="copy_id">
11394                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11395                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11396                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11397                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11398                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11399                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11400                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11401                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11402                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11403                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11404                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11405                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11406                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11407                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11408                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11409                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11410                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11411                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11412                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11413                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11414                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11415                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11416                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11417                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11418                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11419                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11420                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11421                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11422                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11423                 </fields>
11424                 <links>
11425                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11426                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11427                 </links>
11428         </class>
11429         <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">
11430                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11431                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11432                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11433                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11434                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11435                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11436                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11437                 </fields>
11438                 <links>
11439                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11440                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11441                 </links>
11442                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11443                         <actions>
11444                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11445                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11446                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11447                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11448                         </actions>
11449                 </permacrud>
11450         </class>
11451         <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">
11452                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11453                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11454                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11455                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11456                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11457                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11458                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11459                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11460                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11461                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11462                 </fields>
11463                 <links>
11464                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11465                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11466                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11467                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11468                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11469                 </links>
11470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11471                         <actions>
11472                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11473                                         <context link="formula" field="owner"/>
11474                                 </create>
11475                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11476                                         <context link="formula" field="owner"/>
11477                                 </retrieve>
11478                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11479                                         <context link="formula" field="owner"/>
11480                                 </update>
11481                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11482                                         <context link="formula" field="owner"/>
11483                                 </delete>
11484                         </actions>
11485                 </permacrud>
11486         </class>
11487
11488         <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">
11489                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11490                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11491                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11492                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11493                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11494                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11495                 </fields>
11496                 <links>
11497                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11498                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11499                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11500                 </links>
11501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11502                         <actions>
11503                                 <create permission="CREATE_PURCHASE_ORDER">
11504                                         <context link="formula" field="owner"/>
11505                 </create>
11506                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11507                                         <context link="formula" field="owner"/>
11508                 </retrieve>
11509                                 <update permission="CREATE_PURCHASE_ORDER">
11510                                         <context link="formula" field="owner"/>
11511                 </update>
11512                                 <delete permission="CREATE_PURCHASE_ORDER">
11513                                         <context link="formula" field="owner"/>
11514                 </delete>
11515                         </actions>
11516                 </permacrud>
11517         </class>
11518
11519         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11520                 <fields oils_persist:primary="id">
11521                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11522                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11523                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11524                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11525                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11526                 </fields>
11527                 <links>
11528                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11529                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11530                 </links>
11531         </class>
11532
11533         <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">
11534                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11535                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11536                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11537                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11538                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11539                 </fields>
11540                 <links>
11541                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11542                 </links>
11543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11544                         <actions>
11545                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11546                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11547                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11548                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11549                         </actions>
11550                 </permacrud>
11551         </class>
11552
11553         <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">
11554                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11555                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11556                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11557                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11558                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11559                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11560                 </fields>
11561                 <links>
11562                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11563                 </links>
11564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11565                         <actions>
11566                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11567                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11568                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11569                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11570                         </actions>
11571                 </permacrud>
11572         </class>
11573
11574         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11575                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11576                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11577                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11578                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11579                 </fields>
11580                 <links>
11581                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11582                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11583                 </links>
11584         </class>
11585
11586         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11587                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11588                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11589                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11590                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11591                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11592                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11593                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11594                 </fields>
11595                 <links>
11596                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11597                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11598                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11599                 </links>
11600         </class>
11601
11602         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11603                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11604                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11605                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11606                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11607                 </fields>
11608                 <links>
11609                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11610                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11611                 </links>
11612         </class>
11613
11614         <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">
11615                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11616                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11617                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11618                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11619                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11620                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11621                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11622                 </fields>
11623                 <links>
11624                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11625                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11626                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11627                 </links>
11628         </class>
11629
11630         <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">
11631                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11632                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11633                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11634                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11635                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11636                 </fields>
11637                 <links>
11638                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11639                 </links>
11640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11641             <actions>
11642                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11643                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11644                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11645                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11646             </actions>
11647                 </permacrud>
11648         </class>
11649
11650         <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">
11651                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11652                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11653                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11654                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11655                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11656                 </fields>
11657                 <links>
11658                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11659                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11660                 </links>
11661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11662                         <actions>
11663                                 <create permission="ADMIN_CLAIM_POLICY">
11664                                         <context link="claim_policy" field="org_unit"/>
11665                 </create>
11666                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11667                                         <context link="claim_policy" field="org_unit"/>
11668                 </retrieve>
11669                                 <update permission="ADMIN_CLAIM_POLICY">
11670                                         <context link="claim_policy" field="org_unit"/>
11671                 </update>
11672                                 <delete permission="ADMIN_CLAIM_POLICY">
11673                                         <context link="claim_policy" field="org_unit"/>
11674                 </delete>
11675                         </actions>
11676                 </permacrud>
11677         </class>
11678
11679     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11680         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11681             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11682             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11683             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11684             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11685             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11686             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11687             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11688             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11689             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11690             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11691             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11692             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11693             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11694             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11695             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11696             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11697                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11698                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11699                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11700         </fields>
11701         <links>
11702             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11703             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11704         </links>
11705     </class>
11706
11707     <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">
11708         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11709             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11710             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11711             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11712             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11713             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11714         </fields>
11715     </class>
11716
11717     <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">
11718         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11719             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11720             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11721             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11722             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11723             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11724             <field reporter:label="City" name="city" reporter:datatype="text"/>
11725             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11726             <field reporter:label="State" name="state" reporter:datatype="text"/>
11727             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11728             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11729             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11730         </fields>
11731     </class>
11732
11733     <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">
11734         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11735             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11736             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11737             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11738             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11739             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11740             <field reporter:label="City" name="city" reporter:datatype="text"/>
11741             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11742             <field reporter:label="State" name="state" reporter:datatype="text"/>
11743             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11744             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11745             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11746         </fields>
11747     </class>
11748
11749     <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">
11750         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11751             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11752             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11753             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11754             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11755             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11756             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11757         </fields>
11758     </class>
11759
11760     <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">
11761         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11762             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11763             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11764             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11765             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11766             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11767             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11768         </fields>
11769     </class>
11770
11771         <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">
11772                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11773                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11774                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11775                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11776                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11777                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11778                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11779                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11780                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11781                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11782                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11783                 </fields>
11784                 <links>
11785                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11786                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11787                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11788                 </links>
11789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11790                         <actions>
11791                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11792                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11793                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11794                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11795                         </actions>
11796                 </permacrud>
11797         </class>
11798
11799         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11800                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11801                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11802                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11803                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11804                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11805                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11806                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11807                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11808                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11809                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11810                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11811                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11812                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11813                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11814                 </fields>
11815                 <links>
11816                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11817                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11818                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11819                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11820                 </links>
11821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11822                         <actions>
11823                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11824                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11825                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11826                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11827                         </actions>
11828                 </permacrud>
11829         </class>
11830
11831         <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">
11832                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11833                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11834                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11835                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11836                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11837                 </fields>
11838                 <links>
11839                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11840                 </links>
11841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11842                         <actions>
11843                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11844                     <context link="fieldset" field="owning_lib"/>
11845                 </create>
11846                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11847                     <context link="fieldset" field="owning_lib"/>
11848                 </retrieve>
11849                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11850                     <context link="fieldset" field="owning_lib"/>
11851                 </update>
11852                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11853                     <context link="fieldset" field="owning_lib"/>
11854                 </delete>
11855                         </actions>
11856                 </permacrud>
11857         </class>
11858
11859     <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">
11860         <fields>
11861             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11862             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11863             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11864         </fields>
11865                 <links>
11866                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11867                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11868                 </links>
11869     </class>
11870
11871     <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">
11872         <fields>
11873             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11874             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11875         </fields>
11876                 <links>
11877                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11878                 </links>
11879     </class>
11880
11881     <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">
11882         <fields>
11883             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11884             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11885             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11886         </fields>
11887                 <links>
11888                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11889                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11890                 </links>
11891     </class>
11892
11893     <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">
11894         <fields>
11895             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11896             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11897         </fields>
11898                 <links>
11899                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11900                 </links>
11901     </class>
11902
11903     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11904                 <oils_persist:source_definition><![CDATA[
11905
11906             SELECT  DISTINCT l.*
11907               FROM  action.unfulfilled_hold_loops l
11908                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11909               WHERE l.count = m.max
11910
11911                 ]]></oils_persist:source_definition>
11912         <fields>
11913             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11914             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11915             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11916         </fields>
11917                 <links>
11918                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11919                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11920                 </links>
11921     </class>
11922
11923         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11924                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11925                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11926                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11927                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11928                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11929                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11930                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11931                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11932                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11933                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11934                 </fields>
11935                 <links>
11936                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11937                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11938                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11939                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11940                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11941                 </links>
11942         </class>
11943
11944         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11945                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11946                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11947                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11948                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11949                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11950                 </fields>
11951                 <links>
11952                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11953                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11954                 </links>
11955         </class>
11956
11957         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11958                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11959                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11960                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11961                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11962                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11963                 </fields>
11964                 <links>
11965                 </links>
11966         </class>
11967
11968         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11969                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11970                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11971                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11972                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11973                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11974                 </fields>
11975                 <links>
11976                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11977                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11978                 </links>
11979         </class>
11980         
11981         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11982                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11983                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11984                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11985                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11986                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11987                 </fields>
11988                 <links>
11989                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11990                 </links>
11991         </class>
11992         
11993         <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">
11994                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11995                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11996                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11997                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11998                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11999                 </fields>
12000                 <links>
12001                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12002                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
12003                 </links>
12004         </class>
12005
12006         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
12007                 <fields oils_persist:primary="name">
12008                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
12009                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
12010                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
12011                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12012                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
12013                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
12014                 </fields>
12015                 <links>
12016                 </links>
12017         </class>
12018
12019         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
12020                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12021                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12022                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
12023                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12024                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12025                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12026                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12027                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12028                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12029                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12030                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12031                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12032                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12033                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12034                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12035                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12036                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12037                 </fields>
12038                 <links>
12039                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12040                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12041                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12042                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12043                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12044                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12045                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12046                 </links>
12047         </class>
12048
12049         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
12050                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
12051                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
12052                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12053                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12054                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
12055                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
12056                 </fields>
12057                 <links>
12058                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12059                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
12060                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
12061                 </links>
12062         </class>
12063
12064         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
12065                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
12066                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
12067                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
12068                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
12069                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
12070                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
12071                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
12072                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12073                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
12074                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12075                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
12076                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
12077                 </fields>
12078                 <links>
12079                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12080                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
12081                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
12082                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
12083                 </links>
12084         </class>
12085
12086         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12087                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12088                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12089                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
12090                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12091                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12092                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
12093                 </fields>
12094                 <links>
12095                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12096                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12097                 </links>
12098         </class>
12099
12100         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12101                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12102                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12103                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12104                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12105                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12106                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12107                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12108                 </fields>
12109                 <links>
12110                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12111                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12112                 </links>
12113         </class>
12114
12115         <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">
12116                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12117                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12118                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12119                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12120                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12121                 </fields>
12122                 <links>
12123                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12124                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12125                 </links>
12126         </class>
12127
12128         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12129                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12130                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12131                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12132                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12133                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12134                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12135                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12136                 </fields>
12137                 <links>
12138                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12139                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12140                 </links>
12141         </class>
12142
12143         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12144                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12145                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12146                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12147                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12148                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12149                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12150                 </fields>
12151                 <links>
12152                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12153                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12154                 </links>
12155         </class>
12156
12157         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12158                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12159                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12160                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12161                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12162                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12163                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12164                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12165                 </fields>
12166                 <links>
12167                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12168                 </links>
12169         </class>
12170
12171         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12172                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12173                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12174                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12175                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12176                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12177                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12178                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12179                 </fields>
12180                 <links>
12181                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12182                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12183                 </links>
12184         </class>
12185
12186         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12187                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12188                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12189                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12190                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12191                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12192                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12193                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12194                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12195                 </fields>
12196                 <links>
12197                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12198                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12199                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12200                 </links>
12201         </class>
12202
12203         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12204                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12205                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12206                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12207                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12208                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12209                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12210                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12211                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12212                 </fields>
12213                 <links>
12214                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12215                 </links>
12216         </class>
12217
12218         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12219                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12220                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12221                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12222                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12223                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12224                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12225                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12226                 </fields>
12227                 <links>
12228                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12229                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12230                 </links>
12231         </class>
12232
12233         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12234                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12235                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12236                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12237                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12238                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12239                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12240                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12241                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12242                 </fields>
12243                 <links>
12244                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12245                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12246                 </links>
12247         </class>
12248
12249         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12250                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12251                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12252                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12253                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12254                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12255                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12256                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12257                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12258                 </fields>
12259                 <links>
12260                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12261                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12262                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12263                 </links>
12264         </class>
12265
12266         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12267                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12268                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12269                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12270                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12271                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12272                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12273                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12274                 </fields>
12275                 <links>
12276                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12277                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12278                 </links>
12279         </class>
12280
12281         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12282                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12283                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12284                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12285                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12286                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12287                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12288                 </fields>
12289                 <links>
12290                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12291                 </links>
12292         </class>
12293
12294         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12295                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12296                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12297                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12298                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12299                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12300                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12301                 </fields>
12302                 <links>
12303                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12304                 </links>
12305         </class>
12306
12307         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12308                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12309                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12310                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12311                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12312                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12313                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12314                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12315                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12316                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12317                 </fields>
12318                 <links>
12319                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12320                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12321                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12322                 </links>
12323         </class>
12324
12325         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12326                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12327                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12328                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12329                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12330                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12331                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12332                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12333                 </fields>
12334                 <links>
12335                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12336                 </links>
12337         </class>
12338
12339         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12340                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12341                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12342                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12343                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12344                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12345                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12346                 </fields>
12347                 <links>
12348                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12349                 </links>
12350         </class>
12351
12352         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12353                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12354                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12355                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12356                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12357                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12358                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12359                 </fields>
12360                 <links>
12361                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12362                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12363                 </links>
12364         </class>
12365
12366         <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">
12367                 <fields oils_persist:primary="id">
12368                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12369                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12370                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12371                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12372                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12373                 </fields>
12374                 <links>
12375                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12376                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12377                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12378                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12379                 </links>
12380         </class>
12381
12382         <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">
12383                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12384                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12385                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12386                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12387                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12388                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12389                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12390                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12391                 </fields>
12392                 <links/>
12393                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12394                         <actions>
12395                                 <retrieve/>
12396                         </actions>
12397                 </permacrud>
12398         </class>
12399
12400         <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">
12401                 <fields oils_persist:primary="ptype_key">
12402                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12403                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12404                 </fields>
12405                 <links/>
12406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12407                         <actions>
12408                                 <retrieve/>
12409                         </actions>
12410                 </permacrud>
12411         </class>
12412
12413         <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">
12414                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12415                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12416                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12417                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12418                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12419                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12420                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12421                 </fields>
12422                 <links>
12423                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12424                 </links>
12425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12426                         <actions>
12427                                 <retrieve/>
12428                         </actions>
12429                 </permacrud>
12430         </class>
12431
12432         <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">
12433                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12434                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12435                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12436                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12437                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12438                 </fields>
12439                 <links>
12440                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12441                 </links>
12442                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12443                         <actions>
12444                                 <retrieve/>
12445                         </actions>
12446                 </permacrud>
12447         </class>
12448
12449     <class
12450         id="uvs"
12451         controller="open-ils.cstore open-ils.pcrud"
12452         oils_obj:fieldmapper="url_verify::session"
12453         oils_persist:tablename="url_verify.session"
12454         reporter:label="URL Verification Session"
12455     >
12456         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12457             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12458             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12459                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12460             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12461             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12462             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12463             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12464             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12465             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12466         </fields>
12467
12468         <links>
12469             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12470             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12471             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12472             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12473             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12474         </links>
12475
12476         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12477             <actions>
12478                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12479             </actions>
12480         </permacrud>
12481
12482     </class>
12483
12484     <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">
12485         <oils_persist:source_definition><![CDATA[
12486             SELECT
12487                 cbrebi.id AS id,  -- so we can have a pkey in our view
12488                 uvs.id AS session,
12489                 uvs.owning_lib,
12490                 cbrebi.target_biblio_record_entry
12491             FROM url_verify.session uvs
12492             JOIN container.biblio_record_entry_bucket cbreb
12493                 ON (uvs.container = cbreb.id)
12494             JOIN container.biblio_record_entry_bucket_item cbrebi
12495                 ON (cbrebi.bucket = cbreb.id)
12496         ]]></oils_persist:source_definition>
12497         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12498             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12499             <field reporter:label="Session" name="session" reporter:datatype="link" />
12500             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12501             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12502         </fields>
12503         <links>
12504             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12505             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12506             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12507         </links>
12508         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12509             <actions>
12510                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12511             </actions>
12512         </permacrud>
12513     </class>
12514
12515     <class
12516         id="uvus"
12517         controller="open-ils.cstore open-ils.pcrud"
12518         oils_obj:fieldmapper="url_verify::url_selector"
12519         oils_persist:tablename="url_verify.url_selector"
12520         reporter:label="URL Verification URL Selector"
12521     >
12522         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12523             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12524             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12525                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12526             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12527         </fields>
12528
12529         <links>
12530             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12531             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12532         </links>
12533
12534         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12535             <actions>
12536                 <create permission="URL_VERIFY">
12537                     <context link="session" field="owning_lib"/>
12538                 </create>
12539                 <retrieve permission="URL_VERIFY">
12540                     <context link="session" field="owning_lib"/>
12541                 </retrieve>
12542                 <update permission="URL_VERIFY">
12543                     <context link="session" field="owning_lib"/>
12544                 </update>
12545                 <delete permission="URL_VERIFY">
12546                     <context link="session" field="owning_lib"/>
12547                 </delete>
12548             </actions>
12549         </permacrud>
12550
12551     </class>
12552
12553     <class
12554         id="uvu"
12555         controller="open-ils.cstore open-ils.pcrud"
12556         oils_obj:fieldmapper="url_verify::url"
12557         oils_persist:tablename="url_verify.url"
12558         reporter:label="URL Verification URL"
12559     >
12560         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12561             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12562                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12563                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12564                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12565                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12566             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12567             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12568             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12569             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12570             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12571             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12572             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12573             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12574             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12575             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12576             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12577             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12578             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12579         </fields>
12580
12581         <links>
12582             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12583             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12584             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12585             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12586             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12587         </links>
12588
12589         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12590             <actions>
12591                 <create permission="URL_VERIFY">
12592                     <context link="session" field="owning_lib"/>
12593                 </create>
12594                 <retrieve permission="URL_VERIFY">
12595                     <context link="session" field="owning_lib"/>
12596                 </retrieve>
12597                 <update permission="URL_VERIFY">
12598                     <context link="session" field="owning_lib"/>
12599                 </update>
12600                 <delete permission="URL_VERIFY">
12601                     <context link="session" field="owning_lib"/>
12602                 </delete>
12603             </actions>
12604         </permacrud>
12605
12606     </class>
12607
12608     <class
12609         id="uvva"
12610         controller="open-ils.cstore open-ils.pcrud"
12611         oils_obj:fieldmapper="url_verify::verification_attempt"
12612         oils_persist:tablename="url_verify.verification_attempt"
12613         reporter:label="URL Verification Attempt"
12614     >
12615         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12616             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12617                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12618                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12619             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12620             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12621         </fields>
12622
12623         <links>
12624             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12625             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12626         </links>
12627
12628         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12629             <actions>
12630                 <create permission="URL_VERIFY">
12631                     <context link="session" field="owning_lib"/>
12632                 </create>
12633                 <retrieve permission="URL_VERIFY">
12634                     <context link="session" field="owning_lib"/>
12635                 </retrieve>
12636                 <update permission="URL_VERIFY">
12637                     <context link="session" field="owning_lib"/>
12638                 </update>
12639                 <delete permission="URL_VERIFY">
12640                     <context link="session" field="owning_lib"/>
12641                 </delete>
12642             </actions>
12643         </permacrud>
12644
12645     </class>
12646
12647     <class
12648         id="uvuv"
12649         controller="open-ils.cstore open-ils.pcrud"
12650         oils_obj:fieldmapper="url_verify::url_verification"
12651         oils_persist:tablename="url_verify.url_verification"
12652         reporter:label="URL Verification"
12653     >
12654         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12655             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12656                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12657                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12658             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12659             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12660             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12661             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12662                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12663         </fields>
12664
12665         <links>
12666             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12667             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12668             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12669         </links>
12670
12671         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12672             <actions>
12673                 <create permission="URL_VERIFY">
12674                     <context link="attempt" jump="session" field="owning_lib"/>
12675                 </create>
12676                 <retrieve permission="URL_VERIFY">
12677                     <context link="attempt" jump="session" field="owning_lib"/>
12678                 </retrieve>
12679                 <update permission="URL_VERIFY">
12680                     <context link="attempt" jump="session" field="owning_lib"/>
12681                 </update>
12682                 <delete permission="URL_VERIFY">
12683                     <context link="attempt" jump="session" field="owning_lib"/>
12684                 </delete>
12685             </actions>
12686         </permacrud>
12687
12688     </class>
12689
12690         <class
12691                 id="cfdi"
12692                 controller="open-ils.cstore open-ils.pcrud"
12693                 oils_obj:fieldmapper="config::filter_dialog_interface"
12694                 oils_persist:tablename="config.filter_dialog_interface"
12695                 reporter:label="FilterDialog Interface">
12696                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12697                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12698                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12699                 </fields>
12700                 <links>
12701                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12702                 </links>
12703                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12704                         <actions>
12705                                 <retrieve />
12706                         </actions>
12707                 </permacrud>
12708         </class>
12709
12710         <class
12711                 id="cfdfs"
12712                 controller="open-ils.cstore open-ils.pcrud"
12713                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12714                 oils_persist:tablename="config.filter_dialog_filter_set"
12715                 reporter:label="FilterDialog Filter Set">
12716                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12717                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12718                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12719                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12720                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12721                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12722                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12723                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12724                 </fields>
12725                 <links>
12726                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12727                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12728                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12729                 </links>
12730                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12731                         <actions>
12732                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12733                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12734                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12735                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12736                         </actions>
12737                 </permacrud>
12738
12739         </class>
12740
12741         <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">
12742                 <fields oils_persist:primary="code">
12743                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12744                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12745                         <field reporter:label="BLvl Value" name="blvl_val" 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="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">
12756                 <oils_persist:source_definition><![CDATA[
12757
12758             SELECT  b.id,
12759                     MAX(dcp.edit_date) AS last_delete_date
12760              FROM   biblio.record_entry b
12761                     JOIN asset.call_number cn ON (cn.record = b.id)
12762                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12763              WHERE  NOT b.deleted
12764              GROUP BY b.id
12765              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12766
12767                 ]]></oils_persist:source_definition>
12768                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12769                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12770                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12771                 </fields>
12772                 <links>
12773                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12774                 </links>
12775                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12776                         <actions>
12777                                 <retrieve/>
12778                         </actions>
12779                 </permacrud>
12780         </class>
12781
12782         <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">
12783                 <fields oils_persist:primary="id">
12784                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12785                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12786                 </fields>
12787                 <links/>
12788                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12789                         <actions>
12790                                 <retrieve/>
12791                         </actions>
12792                 </permacrud>
12793         </class>
12794
12795         <class id="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">
12796                 <fields oils_persist:primary="id">
12797                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12798                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12799                 </fields>
12800                 <links/>
12801                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12802                         <actions>
12803                                 <retrieve/>
12804                         </actions>
12805                 </permacrud>
12806         </class>
12807
12808
12809         <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">
12810                 <oils_persist:source_definition><![CDATA[
12811                 SELECT
12812                     x.id,
12813                     COALESCE( y.copy_count, 0 ) AS copy_count,
12814                     x.hold_count AS hold_count,
12815                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12816                 FROM
12817                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12818                         FROM
12819                             action.hold_request ahr
12820                             JOIN reporter.hold_request_record rhrr USING (id)
12821                         WHERE
12822                             ahr.cancel_time IS NULL
12823                             AND ahr.fulfillment_time IS NULL
12824                         GROUP BY bib_record
12825                     )x
12826                     JOIN
12827                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12828                         FROM
12829                             action.hold_request ahr
12830                             JOIN reporter.hold_request_record rhrr USING (id)
12831                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12832                         WHERE
12833                             ahr.cancel_time IS NULL
12834                             AND ahr.fulfillment_time IS NULL
12835                             AND ahr.capture_time IS NULL
12836                             AND ahr.frozen IS FALSE
12837                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12838                             AND ahr.hold_type != 'M'
12839                            GROUP BY bib_record
12840                     )y
12841                     USING (id)
12842                 ]]></oils_persist:source_definition>
12843                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12844                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12845                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12846                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12847                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12848                 </fields>
12849                 <links>
12850                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12851                 </links>
12852                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12853                         <actions>
12854                                 <retrieve/>
12855                         </actions>
12856                 </permacrud>
12857         </class>
12858
12859         <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">
12860                 <oils_persist:source_definition><![CDATA[
12861             SELECT *,
12862                 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,
12863                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12864             FROM
12865                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
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                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12871                     WHERE
12872                         ahr.cancel_time IS NULL
12873                         AND ahr.fulfillment_time IS NULL
12874                     GROUP BY bib_record, pickup_lib
12875                 )x
12876                 JOIN
12877                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12878                     FROM
12879                         action.hold_request ahr
12880                         JOIN reporter.hold_request_record rhrr USING (id)
12881                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12882                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12883                     WHERE
12884                         ahr.cancel_time IS NULL
12885                         AND ahr.fulfillment_time IS NULL
12886                         AND ahr.capture_time IS NULL
12887                         AND ahr.frozen IS FALSE
12888                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12889                         AND ahr.hold_type != 'M'
12890                     GROUP BY bib_record, pickup_lib
12891                 )y
12892                 USING(id,pickup_lib)
12893                 JOIN
12894                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12895                     FROM
12896                         action.hold_request ahr
12897                         JOIN reporter.hold_request_record rhrr USING (id)
12898                     WHERE
12899                         ahr.cancel_time IS NULL
12900                         AND ahr.fulfillment_time IS NULL
12901                     GROUP BY bib_record
12902                 )z
12903                 USING (id)
12904                 JOIN
12905                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12906                     FROM
12907                         action.hold_request ahr
12908                         JOIN reporter.hold_request_record rhrr USING (id)
12909                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12910                     WHERE
12911                         ahr.cancel_time IS NULL
12912                         AND ahr.fulfillment_time IS NULL
12913                         AND ahr.capture_time IS NULL
12914                         AND ahr.frozen IS FALSE
12915                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12916                         AND ahr.hold_type != 'M'
12917                         GROUP BY bib_record
12918                 )u
12919                 USING (id)
12920                 ]]></oils_persist:source_definition>
12921                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12922                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12923                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12924                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12925                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12926                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12927                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12928                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12929                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12930                 </fields>
12931                 <links>
12932                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12933                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12934                 </links>
12935                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12936                         <actions>
12937                                 <retrieve/>
12938                         </actions>
12939                 </permacrud>
12940         </class>
12941
12942         <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">
12943                 <oils_persist:source_definition><![CDATA[
12944             SELECT *,
12945                 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,
12946                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12947             FROM
12948                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12949                     FROM
12950                         action.hold_request ahr
12951                         JOIN actor.usr au ON (ahr.usr = au.id)
12952                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12953                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12954                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12955                     WHERE
12956                         ahr.cancel_time IS NULL
12957                         AND ahr.fulfillment_time IS NULL
12958                     GROUP BY bib_record, home_ou
12959                 )x
12960                 JOIN
12961                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12962                     FROM
12963                         action.hold_request ahr
12964                         JOIN actor.usr au ON (ahr.usr = au.id)
12965                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12966                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12967                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12968                     WHERE
12969                         ahr.cancel_time IS NULL
12970                         AND ahr.fulfillment_time IS NULL
12971                         AND ahr.capture_time IS NULL
12972                         AND ahr.frozen IS FALSE
12973                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12974                         AND ahr.hold_type != 'M'
12975                     GROUP BY bib_record, home_ou
12976                 )y
12977                 USING (id,home_ou)
12978                 JOIN
12979                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12980                     FROM
12981                         action.hold_request ahr
12982                         JOIN reporter.hold_request_record rhrr USING (id)
12983                     WHERE
12984                         ahr.cancel_time IS NULL
12985                         AND ahr.fulfillment_time IS NULL
12986                     GROUP BY bib_record
12987                 )z
12988                 USING (id)
12989                 JOIN
12990                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12991                     FROM
12992                         action.hold_request ahr
12993                         JOIN reporter.hold_request_record rhrr USING (id)
12994                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12995                     WHERE
12996                         ahr.cancel_time IS NULL
12997                         AND ahr.fulfillment_time IS NULL
12998                         AND ahr.capture_time IS NULL
12999                         AND ahr.frozen IS FALSE
13000                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13001                         AND ahr.hold_type != 'M'
13002                     GROUP BY bib_record
13003                 )u
13004                 USING (id)
13005         ]]></oils_persist:source_definition>
13006         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13007                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13008                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13009                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
13010                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
13011                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13012                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13013                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
13014                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13015         </fields>
13016         <links>
13017                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13018                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13019         </links>
13020         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13021                 <actions>
13022                         <retrieve/>
13023                 </actions>
13024         </permacrud>
13025 </class>
13026
13027         <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) ">
13028                 <oils_persist:source_definition><![CDATA[
13029                 WITH counts_at_ou AS (
13030                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
13031                 FROM
13032                     (SELECT rhrr.bib_record AS id,
13033                             aou.id AS pickup_lib_or_desc,
13034                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
13035                        FROM actor.org_unit aou
13036                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13037                             action.hold_request ahr
13038                             JOIN reporter.hold_request_record rhrr USING (id)
13039                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13040                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13041                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
13042                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13043                             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
13044                       GROUP BY 1, 2
13045                 ) a
13046                 JOIN
13047                     (SELECT rhrr.bib_record AS id,
13048                             aou.id AS pickup_lib_or_desc,
13049                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
13050                        FROM actor.org_unit aou
13051                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13052                             action.hold_request ahr
13053                             JOIN reporter.hold_request_record rhrr USING (id)
13054                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13055                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13056                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
13057                             -- Comment out the next line to count copies included from other bibs by metarecord holds
13058                             AND ahr.hold_type != 'M'
13059                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13060                             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
13061                       GROUP BY 1, 2
13062                 ) b
13063                 USING (id,pickup_lib_or_desc)
13064             )
13065             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13066                    y.holds_everywhere, z.copy_count_everywhere,
13067                 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,
13068                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13069             FROM counts_at_ou x
13070                 JOIN
13071                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13072                     FROM
13073                         action.hold_request ahr
13074                         JOIN reporter.hold_request_record rhrr USING (id)
13075                     WHERE
13076                         ahr.cancel_time IS NULL
13077                         AND ahr.fulfillment_time IS NULL
13078                     GROUP BY bib_record
13079                 )y
13080                 USING (id)
13081                 JOIN
13082                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13083                     FROM
13084                         action.hold_request ahr
13085                         JOIN reporter.hold_request_record rhrr USING (id)
13086                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13087                     WHERE
13088                         ahr.cancel_time IS NULL
13089                         AND ahr.fulfillment_time IS NULL
13090                         AND ahr.capture_time IS NULL
13091                         AND ahr.frozen IS FALSE
13092                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13093                         AND ahr.hold_type != 'M'
13094                         GROUP BY bib_record
13095                 )z
13096                 USING (id)
13097                 ]]></oils_persist:source_definition>
13098                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13099                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13100                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13101                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13102                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13103                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13104                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13105                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13106                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13107                 </fields>
13108                 <links>
13109                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13110                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13111                 </links>
13112                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13113                         <actions>
13114                                 <retrieve/>
13115                         </actions>
13116                 </permacrud>
13117         </class>
13118
13119         <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">
13120                 <oils_persist:source_definition><![CDATA[
13121             SELECT
13122                 ac.id,
13123                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13124                 MAX(actac.xact_start) AS last_circ
13125             FROM asset.copy ac
13126                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13127             GROUP BY ac.id
13128
13129             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13130             --SELECT
13131             --    ac.id,
13132             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13133             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13134             --FROM asset.copy ac
13135             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13136             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13137             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13138                 ]]></oils_persist:source_definition>
13139                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13140                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13141                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13142                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13143                 </fields>
13144                 <links>
13145                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13146                 </links>
13147                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13148                         <actions>
13149                                 <retrieve/>
13150                         </actions>
13151                 </permacrud>
13152         </class>
13153
13154         <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">
13155                 <fields oils_persist:primary="id">
13156                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13157                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13158                 </fields>
13159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13160                         <actions>
13161                                 <retrieve/>
13162                         </actions>
13163                 </permacrud>
13164         </class>
13165
13166         <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">
13167                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13168                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13169                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13170                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13171                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13172                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13173                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13174                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13175                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13176                 </fields>
13177                 <links>
13178                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13179                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13180                 </links>
13181                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13182                         <actions>
13183                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13184                                 <retrieve/>
13185                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13186                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13187                         </actions>
13188                 </permacrud>
13189         </class>
13190
13191         <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">
13192                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13193                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13194                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13195                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13196                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13197                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13198                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13199                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13200                 </fields>
13201                 <links>
13202                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13203                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13204                 </links>
13205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13206                         <actions>
13207                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13208                                 <retrieve/>
13209                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13210                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13211                         </actions>
13212                 </permacrud>
13213         </class>
13214
13215
13216         <!-- ********************************************************************************************************************* -->
13217         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13218         <!-- ********************************************************************************************************************* -->
13219         <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">
13220                 <fields oils_persist:primary="id">
13221                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13222                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13223                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13224                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13225                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13226                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13227                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13228                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13229                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13230                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13231                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13232                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13233                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13234                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13235                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13236                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13237                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13238                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13239                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13240                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13241                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13242                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13243                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13244                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13245                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13246                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13247                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13248                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13249                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13250                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13251                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13252                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13253                 </fields>
13254                 <links>
13255                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13256                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13257                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13258                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13259                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13260                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13261                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13262                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13263                 </links>
13264         </class>
13265
13266         <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">
13267                 <fields oils_persist:primary="id">
13268                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13269                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13270                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13271                 </fields>
13272                 <links>
13273                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13274                 </links>
13275         </class>
13276
13277         <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">
13278                 <fields oils_persist:primary="id">
13279                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13280                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13281                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13282                 </fields>
13283                 <links>
13284                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13285                 </links>
13286         </class>
13287
13288         <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">
13289                 <fields oils_persist:primary="id">
13290                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13291
13292                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13293                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13294                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13295
13296                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13297                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13298                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13299
13300                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13301                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13302
13303                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13304                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13305                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13306
13307                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13308                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13309
13310                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13311                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13312                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13313
13314                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13315                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13316                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13317
13318                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13319                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13320                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13321                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13322
13323                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13324                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13325
13326                 </fields>
13327                 <links>
13328                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13329                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13330                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13331                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13332                 </links>
13333         </class>
13334
13335         <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">
13336                 <oils_persist:source_definition><![CDATA[
13337
13338             SELECT
13339                 po.ordering_agency AS ordering_agency,
13340                 po.id AS purchase_order,
13341                 li.id AS lineitem,
13342                 lid.id AS lineitem_detail,
13343                 cpa.id AS claim_policy_action
13344             FROM
13345                 acq.lineitem_detail lid
13346                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13347                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13348                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13349                 JOIN acq.claim_policy_action cpa ON (
13350                     cpa.claim_policy = cp.id
13351
13352                     -- we only care about claim policy actions whose claim
13353                     -- interval we'd reached or exceeded
13354                     AND (NOW() - cpa.action_interval) > po.order_date
13355
13356                     -- filter out all claim policy actions where claim events
13357                     -- have occurred on or after the action's action_interval
13358                     AND NOT EXISTS (
13359                         SELECT 1
13360                         FROM
13361                             acq.claim_event evt
13362                             JOIN acq.claim claim ON (
13363                                 claim.id = evt.claim
13364                                 AND claim.lineitem_detail = lid.id
13365                             )
13366                         WHERE
13367                             evt.event_date >= (po.order_date + cpa.action_interval)
13368                     )
13369                 )
13370             WHERE
13371                 lid.cancel_reason IS NULL
13372                 AND li.cancel_reason IS NULL -- belt/suspenders
13373                 AND po.cancel_reason IS NULL -- belt/suspenders
13374                 AND lid.recv_time IS NULL
13375                 AND po.state = 'on-order'
13376             ORDER BY 1, 2, 3, 4, 5
13377
13378                 ]]></oils_persist:source_definition>
13379                 <fields>
13380                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13381                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13382                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13383                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13384                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13385                 </fields>
13386                 <links>
13387                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13388                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13389                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13390                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13391                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13392                 </links>
13393         </class>
13394         <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">
13395                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13396                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13397                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13398                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13399                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13400                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13401                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13402                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13403                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13404                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13405                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13406                 </fields>
13407                 <links>
13408                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13409                 </links>
13410     </class>
13411         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13412                 <oils_persist:source_definition><![CDATA[
13413             SELECT * FROM acq.lineitem_summary 
13414                                 WHERE item_count > (invoice_count + cancel_count)
13415         ]]></oils_persist:source_definition>
13416                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13417                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13418                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13419                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13420                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13421                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13422                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13423                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13424                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13425                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13426                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13427                 </fields>
13428                 <links>
13429                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13430                 </links>
13431     </class>
13432         <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">
13433                 <oils_persist:source_definition><![CDATA[
13434
13435                         SELECT  t.*
13436                           FROM  action.transit_copy t
13437                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13438                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13439                           WHERE s.parent_ou <> d.parent_ou
13440
13441                 ]]></oils_persist:source_definition>
13442                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13443                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13444                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13445                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13446                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13447                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13448                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13449                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13450                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13451                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13452                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13453                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13454                 </fields>
13455                 <links>
13456                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13457                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13458                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13459                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13460                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13461                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13462                 </links>
13463         </class>
13464
13465     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13466                 <oils_persist:source_definition><![CDATA[
13467
13468         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13469                 SELECT
13470                         cp.id as copy,
13471                         COUNT(circ.id),
13472                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13473                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13474                 FROM
13475                         asset.copy cp
13476                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13477                 GROUP BY 1, 3, 4
13478                 UNION ALL
13479                 SELECT
13480                         cp.id as copy,
13481                         COUNT(circ.id),
13482                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13483                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13484                 FROM
13485                         asset.copy cp
13486                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13487                 GROUP BY 1, 3, 4
13488                 UNION ALL
13489                 SELECT
13490                         id as copy,
13491                         circ_count,
13492                         -1 AS year,
13493                         false as is_renewal
13494                 FROM
13495                         extend_reporter.legacy_circ_count
13496         )x GROUP BY 1, 3, 4
13497
13498                 ]]></oils_persist:source_definition>
13499         <fields>
13500             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13501             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13502             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13503             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13504         </fields>
13505                 <links>
13506                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13507                 </links>
13508                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13509                         <actions>
13510                                 <retrieve/>
13511                         </actions>
13512                 </permacrud>
13513     </class>
13514
13515         <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">
13516                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13517                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13518                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13519                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13520                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13521                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13522                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13523                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13524                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13525                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13526                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13527                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13528                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13529                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13530                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13531                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13532                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13533                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13534                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13535                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13536                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13537                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13538                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13539                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13540                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13541                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13542                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13543                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13544                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13545                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13546                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13547                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13548                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13549                 </fields>
13550                 <links>
13551                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13552                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13553                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13554                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13555                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13556                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13557                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13558                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13559                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13560                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13561                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13562                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13563                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13564                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13565                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13566                 </links>
13567         </class>
13568
13569     <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">
13570         <fields oils_persist:primary="id">
13571             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13572             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13573             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13574             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13575             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13576             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13577             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13578             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13579             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13580             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13581             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13582             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13583             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13584             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13585             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13586             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13587             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13588             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13589             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13590             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13591             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13592             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13593             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13594             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13595             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13596             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13597             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13598             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13599             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13600             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13601             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13602             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13603             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13604             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13605         </fields>
13606         <links>
13607             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13608             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13609             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13610             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13611             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13612             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13613             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13614             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13615         </links>
13616     </class>
13617
13618     <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">
13619         <fields oils_persist:primary="id">
13620             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13621             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13622             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13623             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13624         </fields>
13625         <links>
13626             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13627             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13628         </links>
13629     </class>
13630
13631     <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">
13632         <fields oils_persist:primary="owning_lib">
13633             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13634             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13635             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13636         </fields>
13637         <links>
13638             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13639         </links>
13640     </class>
13641
13642     <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">
13643         <fields oils_persist:primary="id">
13644             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13645             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13646             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13647             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13648             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13649         </fields>
13650         <links>
13651             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13652             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13653             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13654         </links>
13655     </class>
13656
13657     <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">
13658         <fields oils_persist:primary="circ_lib">
13659             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13660             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13661             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13662             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13663         </fields>
13664         <links>
13665             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13666             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13667         </links>
13668     </class>
13669
13670     <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">
13671         <fields oils_persist:primary="id">
13672             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13673             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13674             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13675             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13676             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13677         </fields>
13678         <links>
13679             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13680             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13681             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13682         </links>
13683     </class>
13684
13685     <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">
13686         <fields oils_persist:primary="home_ou">
13687             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13688             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13689             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13690             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13691         </fields>
13692         <links>
13693             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13694             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13695         </links>
13696     </class>
13697         <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">
13698                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13699                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13700                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13701                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13702                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13703                 </fields>
13704                 <links>
13705                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13706                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13707                 </links>
13708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13709                         <actions>
13710                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13711                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13712                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13713                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13714                         </actions>
13715                 </permacrud>
13716         </class>
13717         <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">
13718                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13719                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13720                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13721                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13722                 </fields>
13723                 <links>
13724                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13725                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13726                         </links>
13727                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13728                 <actions>
13729                                 <create permission="ADMIN_ACQ_FUND_TAG">
13730                                         <context link="tag" field="owner"/>
13731                                 </create>
13732                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13733                                         <context link="tag" field="owner"/>
13734                                 </retrieve>
13735                                 <update permission="ADMIN_ACQ_FUND_TAG">
13736                                         <context link="tag" field="owner"/>
13737                                 </update>
13738                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13739                                         <context link="tag" field="owner"/>
13740                                 </delete>
13741                         </actions>
13742                 </permacrud>
13743         </class>
13744         <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">
13745                 <oils_persist:source_definition><![CDATA[
13746                 SELECT
13747                         poi.purchase_order AS purchase_order,
13748                         ii.invoice AS invoice,
13749                         NULL AS lineitem,
13750                         poi.id AS po_item,
13751                         NULL AS picklist
13752                 FROM
13753                         acq.po_item poi
13754                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13755                 UNION SELECT
13756                         jub.purchase_order AS purchase_order,
13757                         ie.invoice AS invoice,
13758                         jub.id AS lineitem,
13759                         NULL AS po_item,
13760                         jub.picklist AS picklist
13761                 FROM
13762                         acq.lineitem jub
13763                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13764                 UNION SELECT
13765                         ii.purchase_order AS purchase_order,
13766                         ii.invoice AS invoice,
13767                         NULL AS lineitem,
13768                         NULL AS po_item,
13769                         NULL AS picklist
13770                 FROM
13771                         acq.invoice_item ii
13772                 WHERE ii.po_item IS NULL
13773                 UNION SELECT
13774                         ie.purchase_order AS purchase_order,
13775                         ie.invoice AS invoice,
13776                         NULL AS lineitem,
13777                         NULL AS po_item,
13778                         NULL AS picklist
13779                 FROM
13780                         acq.invoice_entry ie
13781                 WHERE ie.lineitem IS NULL
13782                 UNION SELECT
13783                         NULL AS purchase_order,
13784                         NULL AS invoice,
13785                         jub.id AS lineitem,
13786                         NULL AS po_item,
13787                         jub.picklist AS picklist
13788                 FROM
13789                         acq.lineitem jub
13790                 WHERE jub.purchase_order IS NULL
13791                 ]]></oils_persist:source_definition>
13792                 <fields>
13793                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13794                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13795                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13796                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13797                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13798                 </fields>
13799                 <links>
13800                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13801                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13802                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13803                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13804                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13805                 </links>
13806         </class>
13807         <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">
13808                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13809                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13810                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13811                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13812                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13813                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13814                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13815                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13816                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13817                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13818                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13819                 </fields>
13820                 <links>
13821                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13822                 </links>
13823                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13824                         <actions>
13825                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13826                                 <retrieve/>
13827                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13828                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13829                         </actions>
13830                 </permacrud>
13831         </class>
13832
13833         <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">
13834                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13835                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13836                         <field name="date_applied" reporter:datatype="timestamp"/>
13837                         <field name="org" reporter:datatype="org_unit"/>
13838                         <field name="original_value" reporter:datatype="text"/>
13839                         <field name="new_value" reporter:datatype="text"/>
13840                         <field name="field_name" reporter:datatype="link"/>
13841                 </fields>
13842                 <links>
13843                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13844                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13845                 </links>
13846         </class>
13847         <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">
13848                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13849                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13850                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13851                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13852                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13853                 </fields>
13854                 <links>
13855                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13856                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13857                 </links>
13858         </class>
13859         <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">
13860                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13861                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13862                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13863                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13864                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13865                 </fields>
13866                 <links>
13867                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13868                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13869                 </links>
13870         </class>
13871         <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">
13872                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13873                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13874                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13875                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13876                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13877                 </fields>
13878                 <links>
13879                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13880                 </links>
13881                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13882                         <actions>
13883                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13884                                 <retrieve/>
13885                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13886                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13887                         </actions>
13888                 </permacrud>
13889         </class>
13890         <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">
13891                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13892                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13893                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13894                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13895                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13896                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13897                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13898                 </fields>
13899                 <links>
13900                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13901                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13902                 </links>
13903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13904                         <actions>
13905                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13906                                 <retrieve/>
13907                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13908                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13909                         </actions>
13910                 </permacrud>
13911         </class>
13912         <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">
13913                 <fields oils_persist:primary="code">
13914                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13915                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13916                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13917                 </fields>
13918                 <links>
13919                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13920                 </links>
13921                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13922                         <actions>
13923                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13924                                 <retrieve/>
13925                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13926                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13927                         </actions>
13928                 </permacrud>
13929         </class>
13930         <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">
13931                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13932                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13933                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13934                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13935                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13936                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13937                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13938                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13939                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13940                 </fields>
13941                 <links>
13942                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13943                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13944                 </links>
13945                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13946                         <actions>
13947                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13948                                 <retrieve/>
13949                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13950                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13951                         </actions>
13952                 </permacrud>
13953         </class>
13954         <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">
13955                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13956                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13957                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13958                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13959                 </fields>
13960                 <links>
13961                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13962                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13963                 </links>
13964                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13965                         <actions>
13966                                 <create permission="UPDATE_COPY">
13967                     <context link="copy" field="circ_lib"/>
13968                 </create>
13969                                 <retrieve/>
13970                                 <update permission="UPDATE_COPY">
13971                     <context link="copy" field="circ_lib"/>
13972                 </update>
13973                                 <delete permission="UPDATE_COPY">
13974                     <context link="copy" field="circ_lib"/>
13975                 </delete>
13976                         </actions>
13977                 </permacrud>
13978         </class>
13979         <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">
13980         <oils_persist:source_definition><![CDATA[
13981         SELECT ahcm.target_copy AS id,count(*) AS count
13982          FROM
13983          action.hold_request ahr,
13984          action.hold_copy_map ahcm
13985          WHERE
13986          ahr.cancel_time IS NULL AND
13987          ahr.fulfillment_time IS NULL AND
13988          ahr.capture_time IS NULL AND
13989          ahr.id = ahcm.hold
13990          GROUP BY ahcm.target_copy
13991         ]]></oils_persist:source_definition>
13992         <fields oils_persist:primary="id">
13993             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13994             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13995         </fields>
13996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13997             <actions>
13998                <retrieve/>
13999             </actions>
14000         </permacrud>
14001         </class>
14002
14003         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
14004                 oils_obj:fieldmapper="config::workstation_setting_type" 
14005                 oils_persist:tablename="config.workstation_setting_type" 
14006                 reporter:label="Workstation Setting Type">
14007                 <fields oils_persist:primary="name">
14008                         <field name="name" reporter:datatype="text"/>
14009                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
14010                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
14011                         <field name="datatype" reporter:datatype="text"/>
14012                         <field name="fm_class" reporter:datatype="text"/>
14013                         <field name="grp" reporter:datatype="link"/>
14014                 </fields>
14015                 <links>
14016                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
14017                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
14018                 </links>
14019                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14020                         <actions>
14021                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14022                                 <retrieve/>
14023                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14024                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14025                         </actions>
14026                 </permacrud>
14027         </class>
14028
14029         <!-- no pcrud access is granted for now, because it's assumed these
14030                          setting values will be applied and retrived via the API. -->
14031         <class id="awss" 
14032                 controller="open-ils.cstore"
14033                 oils_obj:fieldmapper="actor::workstation_setting" 
14034                 oils_persist:tablename="actor.workstation_setting" 
14035                 reporter:label="Workstation Setting">
14036                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
14037                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
14038                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
14039                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
14040                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
14041                 </fields>
14042                 <links>
14043                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
14044                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
14045                 </links>
14046         </class>
14047
14048         <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">
14049         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
14050                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
14051                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
14052                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
14053         </fields>
14054         </class>
14055
14056         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
14057                 oils_obj:fieldmapper="config::print_template" 
14058                 oils_persist:tablename="config.print_template" 
14059                 reporter:label="Print Templates">
14060                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
14061                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
14062                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
14063                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14064                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
14065                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
14066                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
14067                         <field name="content_type" reporter:datatype="text"/>
14068                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
14069                 </fields>
14070                 <links>
14071                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14072                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14073                 </links>
14074                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14075                         <actions>
14076                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14077                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14078                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14079                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14080                         </actions>
14081                 </permacrud>
14082         </class>
14083
14084         <class id="cct" 
14085                 controller="open-ils.cstore open-ils.pcrud"
14086                 oils_obj:fieldmapper="config::carousel_type" 
14087                 oils_persist:tablename="config.carousel_type" 
14088                 reporter:label="Carousel Types">
14089                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14090                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
14091                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14092                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14093                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14094                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14095                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14096                 </fields>
14097                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14098                         <actions>
14099                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14100                                 <retrieve/>
14101                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14102                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14103                         </actions>
14104                 </permacrud>
14105         </class>
14106
14107         <class id="cc" 
14108                 controller="open-ils.cstore open-ils.pcrud"
14109                 oils_obj:fieldmapper="container::carousel" 
14110                 oils_persist:tablename="container.carousel" 
14111                 reporter:label="Carousels">
14112                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14113                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14114                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14115                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14116                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14117                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14118                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14119                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14120                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14121                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14122                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14123                         <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 -->
14124                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14125                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14126                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14127                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14128                 </fields>
14129                 <links>
14130                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14131                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14132                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14133                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14134                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14135                 </links>
14136                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14137                         <actions>
14138                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14139                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14140                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14141                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14142                         </actions>
14143                 </permacrud>
14144         </class>
14145
14146         <class id="ccou" 
14147                 controller="open-ils.cstore open-ils.pcrud"
14148                 oils_obj:fieldmapper="container::carousel_org_unit" 
14149                 oils_persist:tablename="container.carousel_org_unit" 
14150                 reporter:label="Carousels Visible at Library">
14151                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14152                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14153                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14154                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14155                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14156                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14157                 </fields>
14158                 <links>
14159                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14160                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14161                 </links>
14162                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14163                         <actions>
14164                                 <create permission="ADMIN_CAROUSEL">
14165                                     <context link="carousel" field="owner" />
14166                                 </create>
14167                                 <retrieve permission="ADMIN_CAROUSEL">
14168                                     <context link="carousel" field="owner" />
14169                                 </retrieve>
14170                                 <update permission="ADMIN_CAROUSEL">
14171                                     <context link="carousel" field="owner" />
14172                                 </update>
14173                                 <delete permission="ADMIN_CAROUSEL">
14174                                     <context link="carousel" field="owner" />
14175                                 </delete>
14176                         </actions>
14177                 </permacrud>
14178         </class>
14179
14180         <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">
14181                 <fields oils_persist:primary="name">
14182                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14183                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14184                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14185                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14186                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14187                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14188                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14189                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14190                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14191                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14192                 </fields>
14193                 <links>
14194                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14195                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14196                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14197                 </links>
14198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14199                         <actions>
14200                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14201                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14202                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14203                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14204                         </actions>
14205                 </permacrud>
14206         </class>
14207         <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">
14208                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14209                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14210                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14211                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14212                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14213                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14214                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14215                 </fields>
14216                 <links>
14217                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14218                 </links>
14219                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14220                         <actions>
14221                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14222                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14223                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14224                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14225                         </actions>
14226                 </permacrud>
14227         </class>
14228
14229     <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">
14230         <fields oils_persist:primary="code">
14231             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14232             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14233         </fields>
14234                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14235                         <actions>
14236                                 <retrieve/>
14237                         </actions>
14238                 </permacrud>
14239         </class>
14240
14241     <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">
14242         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14243             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14244             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14245             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14246             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14247             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14248             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14249             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14250             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14251                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14252         </fields>
14253                 <links>
14254                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14255                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14256                 </links>
14257         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14258             <actions>
14259                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14260                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14261                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14262                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14263             </actions>
14264         </permacrud>
14265     </class>
14266
14267         <!-- Simple Reporter classes are currently used only by the SR UI -->
14268     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14269         <oils_persist:source_definition><![CDATA[
14270             SELECT
14271               -- Circ id; just for counting
14272               combcirc.id AS circ_id,
14273
14274               -- User info, currently limiting to what's available from action.all_circulation
14275               combcirc.usr_post_code AS usr_post_code,
14276               combcirc.usr_birth_year AS usr_bith_year,
14277               combcirc.usr_profile AS usr_profile_id,
14278               pgtu.name AS usr_profile,
14279               combcirc.usr_home_ou AS usr_home_ou_id,
14280               aouuh.shortname AS usr_home_ou_shortname,
14281               aouuh.name AS usr_home_ou_name,
14282               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14283               aouus.shortname AS usr_sys_shortname,
14284               aouus.name AS usr_sys_name,
14285
14286               -- Circ info
14287               -- Checkout
14288               combcirc.xact_start AS xact_start,
14289               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14290               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14291               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14292               combcirc.circ_lib AS circ_lib_id,
14293               aouco.shortname AS circ_lib_shortname,
14294               aouco.name AS circ_lib_name,
14295               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14296               aoucos.shortname AS circ_sys_shortname,
14297               aoucos.name AS circ_sys_name,
14298               auco.usrname AS circ_staff,
14299               awso.name AS checkout_workstation,
14300
14301               combcirc.due_date AS due_date,
14302               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14303               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14304               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14305
14306               -- Checkin
14307               combcirc.xact_finish AS xact_finish,
14308               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14309               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14310               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14311               aouci.shortname AS checkin_lib_shortname,
14312               aouci.name AS checkin_lib_name,
14313               auci.usrname AS checkin_staff,
14314               awsi.name AS checkin_workstation,
14315               aoucis.shortname AS checkin_sys_shortname,
14316               aoucis.name AS checkin_sys_name,
14317
14318               combcirc.checkin_time AS checkin_time,
14319
14320               -- Misc circ info
14321               combcirc.renewal_remaining AS renewal_remaining,
14322               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14323               combcirc.grace_period AS grace_period,
14324
14325               combcirc.stop_fines AS stop_fines,
14326               combcirc.stop_fines_time AS stop_fines_time,
14327
14328               combcirc.duration AS duration,
14329               combcirc.fine_interval AS fine_interval,
14330               combcirc.recurring_fine AS recurring_fine,
14331               combcirc.max_fine AS max_fine,
14332               combcirc.duration_rule AS duration_rule,
14333               combcirc.recurring_fine_rule AS recurring_fine_rule,
14334               combcirc.max_fine_rule AS max_fine_rule,
14335               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14336               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,
14337               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14338
14339               -- Copy info
14340               acp.barcode AS copy_barcode,
14341               acp.circ_modifier AS copy_circ_modifier_code,
14342               ccm.name AS copy_circ_modifier_name,
14343               acp.circ_lib AS copy_circ_lib_id,
14344               acp.location AS location_id,
14345               acpl.name AS location_name,
14346               aoucp.shortname AS copy_circ_lib_shortname,
14347               aoucp.name AS copy_circ_lib_name,
14348               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14349               aoucps.shortname AS copy_sys_shortname,
14350               aoucps.name AS copy_sys_name,
14351               combcirc.copy_owning_lib AS copy_owning_lib_id,
14352               aoucpo.shortname AS copy_owning_lib_shortname,
14353               aoucpo.name AS copy_owning_lib_name,
14354               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14355               acnp.label AS copy_call_number_prefix,
14356               acn.label AS copy_call_number_label,
14357               acns.label AS copy_call_number_suffix,
14358               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14359               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14360               acn.label_sortkey AS copy_call_number_label_sortkey,
14361               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14362               COALESCE(rmsr.title, acp.dummy_title) AS title,
14363               COALESCE(rmsr.author, acp.dummy_author) AS author,
14364               rmsr.publisher AS publisher,
14365               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14366               array_to_string(rmsr.isbn, ', ') AS isbn,
14367               array_to_string(rmsr.issn, ', ') AS issn,
14368               part.label AS part_label,
14369               part.label_sortkey AS part_label_sortkey,
14370               acn.record AS bib_id,
14371               rmsr.tcn_value AS tcn_value
14372
14373             FROM
14374               action.all_circulation combcirc
14375
14376               -- User
14377               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14378               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14379               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14380
14381               -- Circ
14382               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14383               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14384               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14385               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14386               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14387               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14388               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14389               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14390
14391               -- Copy / call / title
14392               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14393                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14394               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14395               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14396               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14397               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14398               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14399               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14400               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14401               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14402               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14403               LEFT JOIN (
14404                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14405                 FROM biblio.monograph_part bmp
14406                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14407                 WHERE NOT bmp.deleted
14408               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14409         ]]></oils_persist:source_definition>
14410         <field_groups>
14411             <group name="common" reporter:label="Common Fields"/>
14412             <group name="item" reporter:label="Item Fields"/>
14413             <group name="user" reporter:label="Patron Fields"/>
14414             <group name="title" reporter:label="Call Number and Title Fields"/>
14415             <group name="org" reporter:label="Libraries"/>
14416         </field_groups>
14417         <fields oils_persist:primary="circ_id">
14418             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14419             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14420             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14421             <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"/>
14422             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14423             <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"/>
14424             <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"/>
14425             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14426             <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"/>
14427             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14428             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14429             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14430             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14431             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14432             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14433             <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"/>
14434             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14435             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14436             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14437             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14438             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14439             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14440             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14441             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14442             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14443             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14444             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14445             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14446             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14447             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14448             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14449             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14450             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14451             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14452             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14453             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14454             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14455             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14456             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14457             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14458             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14459             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14460             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14461             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14462             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14463             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14464             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14465             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14466             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14467             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14468             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14469             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14470             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14471             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14472             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14473             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14474             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14475             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14476             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14477             <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"/>
14478             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14479             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14480             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14481             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14482             <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"/>
14483             <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"/>
14484             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14485             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14486             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14487             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14488             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14489             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14490             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14491             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14492             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14493             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14494             <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"/>
14495             <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"/>
14496             <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"/>
14497             <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"/>
14498             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14499             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14500             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14501             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14502             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14503             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14504             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14505             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14506             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14507             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14508         </fields>
14509         <links>
14510             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14511             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14512             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14513         </links>
14514     </class>
14515
14516     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14517         <oils_persist:source_definition><![CDATA[
14518             SELECT
14519               au.home_ou AS home_ou_filter,
14520               au.id AS user_id,
14521               cardp.barcode AS barcode_primary,
14522               au.usrname AS usrname,
14523               au.email AS email,
14524               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14525               au.prefix AS prefix,
14526               au.first_given_name AS first_given_name,
14527               au.second_given_name AS second_given_name,
14528               au.family_name AS family_name,
14529               au.suffix AS suffix,
14530               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14531               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14532               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14533               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14534               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14535               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14536               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14537               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14538               au.profile AS profile_id,
14539               pgt.name AS profile,
14540               au.alias AS alias,
14541               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14542               au.day_phone AS day_phone,
14543               au.evening_phone AS evening_phone,
14544               au.other_phone AS other_phone,
14545               au.dob AS dob,
14546               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14547               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14548               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14549               au.active AS active,
14550               au.barred AS barred,
14551               au.deleted AS deleted,
14552               au.juvenile AS juvenile,
14553               au.claims_returned_count AS claims_returned_count,
14554               au.credit_forward_balance AS credit_forward_balance,
14555               au.create_date AS create_date,
14556               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14557               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14558               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14559               au.expire_date AS expire_date,
14560               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14561               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14562               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14563               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14564               au.last_update_time AS last_update_time,
14565               au.home_ou AS home_ou_id,
14566               aouh.shortname AS home_ou_shortname,
14567               aouh.name AS home_ou_name,
14568               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14569               aous.shortname AS home_sys_shortname,
14570               aous.name AS home_sys_name,
14571               auam.valid AS mailing_valid,
14572               auam.address_type AS mailing_address_type,
14573               auam.street1 AS mailing_street1,
14574               auam.street2 AS mailing_street2,
14575               auam.city AS mailing_city,
14576               auam.state AS mailing_state,
14577               auam.country AS mailing_country,
14578               auam.post_code AS mailing_post_code,
14579               auam.county AS mailing_county,
14580               auam.within_city_limits AS mailing_within_city_limits,
14581               auam.pending AS mailing_pending,
14582               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14583               auap.valid AS physical_valid,
14584               auap.address_type AS physical_address_type,
14585               auap.street1 AS physical_street1,
14586               auap.street2 AS physical_street2,
14587               auap.city AS physical_city,
14588               auap.state AS physical_state,
14589               auap.country AS physical_country,
14590               auap.post_code AS physical_post_code,
14591               auap.county AS physical_county,
14592               auap.within_city_limits AS physical_within_city_limits,
14593               auap.pending AS physical_pending,
14594               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14595               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14596               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14597               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14598               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14599               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14600               asceum1.stat_cat_entry AS legacy_stat_cat1,
14601               asceum2.stat_cat_entry AS legacy_stat_cat2,
14602
14603               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14604               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14605               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14606               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14607               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,
14608               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14609
14610             FROM
14611               actor.usr au
14612               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14613               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14614               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14615               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14616               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14617               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14618               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14619               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14620               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14621               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14622               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14623               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14624               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14625               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14626               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14627               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14628
14629             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14630               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14631               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14632               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14633               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14634               76,77,78,79,80,81
14635         ]]></oils_persist:source_definition>
14636         <field_groups>
14637             <group name="common" reporter:label="Common Fields"/>
14638             <group name="name" reporter:label="Name Fields"/>
14639             <group name="contact" reporter:label="Contact Fields"/>
14640             <group name="address" reporter:label="Address Related Fields"/>
14641             <group name="org" reporter:label="Libraries"/>
14642         </field_groups>
14643         <fields oils_persist:primary="user_id">
14644             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14645                 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"/>
14646             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14647             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14648             <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14649             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14650             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14651             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14652             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14653             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14654             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14655             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14656             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14657             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14658             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14659             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14660             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14661             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14662             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14663             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14664             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14665             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14666             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14667             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14668             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14669             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14670             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14671             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14672             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14673             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14674             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14675             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14676             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14677             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14678             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14679             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14680             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14681             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14682             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14683             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14684             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14685             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14686             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14687             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14688             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14689             <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"/>
14690             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14691             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14692             <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"/>
14693             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14694             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14695             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14696             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14697             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14698             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14699             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14700             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14701             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14702             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14703             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14704             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14705             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14706             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14707             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14708             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14709             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14710             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14711             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14712             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14713             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14714             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14715             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14716             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14717             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14718             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14719             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14720             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14721             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14722             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14723             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14724             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14725             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14726             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14727             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14728             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14729             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14730             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14731         </fields>
14732         <links>
14733             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14734         </links>
14735     </class>
14736
14737     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14738         <oils_persist:source_definition><![CDATA[
14739             SELECT
14740               -- ids
14741               acp.id AS copy_id,
14742               acp.floating AS floating_id,
14743               acn.id AS acn_id,
14744               acp.circ_lib AS circ_lib_id,
14745               acp.status AS status_id,
14746               acp.location AS location_id,
14747               acp.age_protect AS age_protect_id,
14748               aous.id AS circ_sys_id,
14749               acn.owning_lib AS owning_lib_id,
14750               aouos.id AS owning_sys_id,
14751               awsi.id AS inv_workstation_id,
14752
14753               -- OUs
14754               aou.shortname AS circ_lib_shortname,
14755               aou.name AS circ_lib_name,
14756               aous.shortname AS circ_sys_shortname,
14757               aous.name AS circ_sys_name,
14758               aouo.shortname AS owning_lib_shortname,
14759               aouo.name AS owning_lib_name,
14760               aouos.shortname AS owning_sys_shortname,
14761               aouos.name AS owning_sys_name,
14762
14763               -- dates
14764               acp.create_date AS create_date_time,
14765               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14766               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14767               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14768               acp.active_date AS active_date_time,
14769               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14770               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14771               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14772               acp.edit_date AS edit_date_time,
14773               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14774               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14775               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14776               acp.status_changed_time AS status_changed_time_time,
14777               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14778               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14779               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14780               ali.inventory_date AS latest_inv_date,
14781               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14782               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14783               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14784
14785               -- acp
14786               acp.barcode AS barcode,
14787               ccs.name AS status,
14788               acpl.name AS location_name,
14789                                                         acp.circ_modifier AS copy_circ_modifier_code,
14790                                                         ccm.name AS copy_circ_modifier_name,
14791               acp.price AS price,
14792               acp.cost AS acq_price,
14793               acp.deleted AS copy_deleted,
14794               acp.ref AS reference,
14795               acp.circulate AS copy_circulate,
14796               (acp.circulate AND acpl.circulate) AS circulate,
14797               acp.holdable AS copy_holdable,
14798               acp.deposit AS deposit,
14799               acp.deposit_amount AS deposit_amount,
14800               acp.alert_message AS alert_message,
14801               acp.opac_visible AS copy_opac_visible,
14802               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14803               crahp.name AS age_protect,
14804               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14805               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14806               acp.copy_number AS copy_number,
14807               acp.circ_as_type AS circ_as_type,
14808               acp.loan_duration AS loan_duration_int,
14809               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14810               acp.fine_level AS fine_level_int,
14811               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14812
14813               -- Call Number
14814               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14815               acnp.label AS copy_call_number_prefix,
14816               acn.label AS copy_call_number_label,
14817               acns.label AS copy_call_number_suffix,
14818               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14819               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14820               acn.label_sortkey AS copy_call_number_label_sortkey,
14821               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14822               racnd.dewey AS call_number_dewey,
14823               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14824               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14825               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14826               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14827
14828               -- Misc
14829               COALESCE(rmsr.title, acp.dummy_title) AS title,
14830               COALESCE(rmsr.author, acp.dummy_author) AS author,
14831               rmsr.publisher AS publisher,
14832               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14833               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14834               array_to_string(rmsr.issn, ', ') AS issn,
14835               part.label AS part_label,
14836               part.label_sortkey AS part_label_sortkey,
14837               acn.record AS bib_id,
14838               rmsr.tcn_value AS tcn_value,
14839               acn.deleted AS call_deleted,
14840               bre.deleted AS bib_deleted,
14841               ccs.holdable AS status_holdable,
14842               acpl.holdable AS location_holdable,
14843               acp.circulate AS location_circulate,
14844               awsi.name AS inventory_workstation,
14845               aucr.usrname AS creating_user,
14846               aued.usrname AS editing_user,
14847
14848               -- Aggregates
14849               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14850               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,
14851               COUNT(DISTINCT combcirc.id) AS circ_total,
14852               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14853
14854             FROM
14855               asset.copy acp
14856               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14857               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14858               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14859               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14860               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14861               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14862               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14863               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14864               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14865               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14866               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14867               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14868               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14869               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14870               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14871               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14872               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14873               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14874               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14875               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14876               LEFT JOIN (
14877                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14878                 FROM biblio.monograph_part bmp
14879                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14880                 WHERE NOT bmp.deleted
14881               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14882
14883             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14884               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14885               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14886               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14887               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14888               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14889               91,92,93,94,95,96
14890
14891         ]]></oils_persist:source_definition>
14892         <field_groups>
14893             <group name="common" reporter:label="Common Fields"/>
14894             <group name="dates" reporter:label="Date Fields"/>
14895             <group name="title" reporter:label="Call Number and Title Fields"/>
14896             <group name="org" reporter:label="Libraries"/>
14897         </field_groups>
14898         <fields oils_persist:primary="copy_id">
14899             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14900             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14901             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14902             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14903             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14904             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14905             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14906             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14907             <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"/>
14908             <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"/>
14909             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14910             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14911             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14912             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14913             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14914             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14915             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14916             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14917             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14918             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14919             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14920             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14921             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14922             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14923             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14924             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14925             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14926             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14927             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14928             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14929             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14930             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14931             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14932             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14933             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14934             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14935             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14936             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14937             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14938             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14939             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14940             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14941             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14942             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14943             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14944             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14945             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14946             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14947             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14948             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14949             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14950             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14951             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14952             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14953             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14954             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14955             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14956             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14957             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14958             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14959             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14960             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14961             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14962             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14963             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14964             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14965             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14966             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14967             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14968             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14969             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14970             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14971             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14972             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14973             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14974             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14975             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14976             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14977             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14978             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14979             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14980             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14981             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14982             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14983             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14984             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14985             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14986             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14987             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14988             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14989             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14990             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14991             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14992             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14993         </fields>
14994         <links>
14995             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14996             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14997             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14998             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14999             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15000             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15001         </links>
15002     </class>
15003
15004     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
15005         <oils_persist:source_definition><![CDATA[
15006
15007             SELECT
15008               -- ids
15009               acp.id AS copy_id,
15010               acn.id AS acn_id,
15011               acp.circ_lib AS circ_lib_id,
15012               acp.status AS status_id,
15013               acp.location AS location_id,
15014               acp.age_protect AS age_protect_id,
15015               aous.id AS circ_sys_id,
15016               acn.owning_lib AS owning_lib_id,
15017               aouos.id AS owning_sys_id,
15018               awsi.id AS inv_workstation_id,
15019
15020               -- OUs
15021               aou.shortname AS circ_lib_shortname,
15022               aou.name AS circ_lib_name,
15023               aous.shortname AS circ_sys_shortname,
15024               aous.name AS circ_sys_name,
15025               aouo.shortname AS owning_lib_shortname,
15026               aouo.name AS owning_lib_name,
15027               aouos.shortname AS owning_sys_shortname,
15028               aouos.name AS owning_sys_name,
15029
15030               -- dates
15031               acp.create_date AS create_date_time,
15032               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
15033               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
15034               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
15035               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
15036               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
15037               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
15038               acp.active_date AS active_date_time,
15039               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
15040               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
15041               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
15042               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
15043               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
15044               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
15045               acp.edit_date AS edit_date_time,
15046               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
15047               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
15048               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
15049               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
15050               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
15051               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
15052               acp.status_changed_time AS status_changed_time_time,
15053               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
15054               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
15055               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
15056               ali.inventory_date AS latest_inv_date,
15057               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
15058               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
15059               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
15060               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
15061               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
15062               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
15063
15064               -- acp
15065               acp.barcode AS barcode,
15066               ccs.name AS status,
15067               acpl.name AS location_name,
15068               acp.circ_modifier AS circ_modifier_code,
15069               ccm.name AS circ_modifier_name,
15070               acp.price AS price,
15071               acp.cost AS acq_price,
15072               acp.deleted AS copy_deleted,
15073               acp.ref AS reference,
15074               acp.circulate AS copy_circulate,
15075               (acp.circulate AND acpl.circulate) AS circulate,
15076               acp.holdable AS copy_holdable,
15077               acp.deposit AS deposit,
15078               acp.deposit_amount AS deposit_amount,
15079               acp.alert_message AS alert_message,
15080               acp.opac_visible AS copy_opac_visible,
15081               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
15082               crahp.name AS age_protect,
15083               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15084               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15085               acp.copy_number AS copy_number,
15086               acp.circ_as_type AS circ_as_type,
15087               acp.loan_duration AS loan_duration_int,
15088               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15089               acp.fine_level AS fine_level_int,
15090               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15091
15092               -- Call Number
15093               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15094               acnp.label AS copy_call_number_prefix,
15095               acn.label AS copy_call_number_label,
15096               acns.label AS copy_call_number_suffix,
15097               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15098               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15099               acn.label_sortkey AS copy_call_number_label_sortkey,
15100               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15101               racnd.dewey AS call_number_dewey,
15102               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15103               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15104               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15105               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15106
15107               -- Misc
15108               COALESCE(rmsr.title, acp.dummy_title) AS title,
15109               COALESCE(rmsr.author, acp.dummy_author) AS author,
15110               rmsr.publisher AS publisher,
15111               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15112               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15113               array_to_string(rmsr.issn, ', ') AS issn,
15114               part.label AS part_label,
15115               part.label_sortkey AS part_label_sortkey,
15116               acn.record AS bib_id,
15117               rmsr.tcn_value AS tcn_value,
15118               acn.deleted AS call_deleted,
15119               bre.deleted AS bib_deleted,
15120               ccs.holdable AS status_holdable,
15121               acpl.holdable AS location_holdable,
15122               acp.circulate AS location_circulate,
15123               awsi.name AS inventory_workstation,
15124
15125               -- Aggregates
15126               -- may decide these price games aren't worth it, but estimated collection value is useful
15127               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,
15128               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15129               MAX(combcirc.xact_start) AS last_circ_datetime,
15130               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15131               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15132               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15133               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15134               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15135               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15136               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15137               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15138               (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,
15139               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15140               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15141               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15142               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15143               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15144               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15145               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,
15146               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,
15147               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,
15148               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
15149
15150             FROM
15151               asset.copy acp
15152               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15153               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15154               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15155               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15156               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15157               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15158               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15159               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15160               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15161               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15162               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15163               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15164               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15165               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15166               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15167               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15168               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15169               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15170               LEFT JOIN (
15171                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15172                 FROM biblio.monograph_part bmp
15173                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15174                 WHERE NOT bmp.deleted
15175               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15176
15177             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15178               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15179               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15180               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15181               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15182               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15183               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15184
15185         ]]></oils_persist:source_definition>
15186         <field_groups>
15187             <group name="common" reporter:label="Common Fields"/>
15188             <group name="dates" reporter:label="Date Fields"/>
15189             <group name="inv" reporter:label="Inventory Fields"/>
15190             <group name="title" reporter:label="Call Number and Title Fields"/>
15191             <group name="org" reporter:label="Libraries"/>
15192         </field_groups>
15193         <fields oils_persist:primary="copy_id">
15194              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15195              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15196              <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"/>
15197              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15198              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15199              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15200              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15201              <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"/>
15202              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15203              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15204              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15205              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15206              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15207              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15208              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15209              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15210              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15211              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15212              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15213              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15214              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15215              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15216              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15217              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15218              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15219              <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"/>
15220              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15221              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15222              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15223              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15224              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15225              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15226              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15227              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15228              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15229              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15230              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15231              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15232              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15233              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15234              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15235              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15236              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15237              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15238              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15239              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15240              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15241              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15242              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15243              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15244              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15245              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15246              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15247              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15248              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15249              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15250              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15251              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15252              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15253              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15254              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15255              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15256              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15257              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15258              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15259              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15260              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15261              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15262              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15263              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15264              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15265              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15266              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15267              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15268              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15269              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15270              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15271              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15272              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15273              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15274              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15275              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15276              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15277              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15278              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15279              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15280              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15281              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15282              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15283              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15284              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15285              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15286              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15287              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15288              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15289              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15290              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15291              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15292              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15293              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15294              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15295              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15296              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15297              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15298              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15299              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15300              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15301              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15302              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15303              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15304              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15305              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15306              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15307              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15308              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15309              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15310              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15311              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15312              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15313              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15314              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15315              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15316              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15317              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15318              <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"/>
15319              <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"/>
15320              <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"/>
15321         </fields>
15322         <links>
15323             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15324             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15325             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15326             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15327             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15328         </links>
15329     </class>
15330
15331     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15332         <oils_persist:source_definition><![CDATA[
15333
15334             SELECT
15335               -- ids
15336               xact.id AS xact_id,
15337               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15338               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15339
15340               -- OUs
15341               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15342               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15343               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15344               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15345
15346               -- billings
15347               billings.total_amount AS billing_grand_total,
15348               billings.total_unvoided_amount AS billing_total,
15349
15350               billings.voided_billing_count AS billing_voided_count,
15351               billings.all_billing_types AS all_billing_types,
15352               billings.billing_types AS billing_types,
15353
15354               billings.total_voided_amount AS billing_total_voided,
15355               billings.total_overdue_amount AS billing_overdue_amount,
15356               billings.total_lost_amount AS billing_lost_amount,
15357               billings.total_long_od_amount AS billing_long_od_amount,
15358               billings.total_damaged_amount AS billing_damaged_amount,
15359               billings.total_deposit_amount AS billing_deposit_amount,
15360               billings.total_rental_amount AS billing_rental_amount,
15361
15362               -- payments
15363               payments.total_amount AS payment_grand_total,
15364               payments.total_unvoided_amount AS payment_total,
15365
15366               payments.voided_payment_count AS payment_voided_count,
15367               payments.all_payment_types AS all_payment_types,
15368               payments.payment_types AS payment_types,
15369
15370               payments.total_voided_amount AS payment_total_voided,
15371               payments.total_account_adjustment AS payment_account_adjustment_amount,
15372               payments.total_cash_payment AS payment_cash_amount,
15373               payments.total_check_payment AS payment_check_amount,
15374               payments.total_credit_card_payment AS payment_credit_card_amount,
15375               payments.total_debit_card_payment AS payment_debit_card_amount,
15376               payments.total_credit_payment AS payment_credit_amount,
15377               payments.total_forgive_payment AS payment_forgive_amount,
15378               payments.total_work_payment AS payment_work_amount,
15379               payments.total_goods_payment AS payment_goods_amount,
15380               payments.total_currency_payment AS payment_currency_amount,
15381               payments.total_non_currency_payment AS payment_non_currency_amount,
15382
15383               -- dates
15384               xact.xact_start AS xact_start,
15385               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15386               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15387               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15388               xact.xact_finish AS xact_finish,
15389               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15390               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15391               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15392               billings.earliest_billing_ts AS earliest_billing_ts,
15393               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15394               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15395               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15396               billings.latest_billing_ts AS latest_billing_ts,
15397               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15398               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15399               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15400               payments.earliest_payment_ts AS earliest_payment_ts,
15401               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15402               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15403               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15404               payments.latest_payment_ts AS latest_payment_ts,
15405               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15406               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15407               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15408
15409               -- Misc
15410               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15411               (xact.xact_finish IS NOT NULL) AS xact_closed
15412
15413             FROM
15414               money.billable_xact xact
15415               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15416               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15417               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15418               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15419               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15420               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15421
15422               -- oohh nooo.... If not done this way you encounter situations
15423               -- like multiplying billing totals x number of payments and
15424               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15425               LEFT JOIN (
15426                 SELECT
15427                   xact,
15428                   MIN(billing_ts) AS earliest_billing_ts,
15429                   MAX(billing_ts) AS latest_billing_ts,
15430
15431                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15432                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15433                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15434
15435                   SUM(amount) AS total_amount,
15436                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15437                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15438                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15439                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15440                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15441                   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.
15442                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15443                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15444
15445                 FROM
15446                   money.all_billings
15447                 GROUP BY 1
15448               ) billings ON (xact.id = billings.xact)
15449               -- Can't include accepting user or cash_drawer because that will "duplicate"
15450               -- rows if multiple staff accept payments on a single xact...
15451               LEFT JOIN (
15452                 SELECT
15453                   xact,
15454                   MIN(payment_ts) AS earliest_payment_ts,
15455                   MAX(payment_ts) AS latest_payment_ts,
15456
15457                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15458                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15459                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15460
15461                   SUM(amount) AS total_amount,
15462                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15463                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15464                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15465                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15466                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15467                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15468                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15469                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15470                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15471                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15472                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15473                   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,
15474                   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
15475
15476                 FROM
15477                   money.all_payments
15478                 GROUP BY 1
15479               ) payments ON (xact.id = payments.xact)
15480
15481         ]]></oils_persist:source_definition>
15482         <field_groups>
15483             <group name="common" reporter:label="Common Fields"/>
15484             <group name="bill" reporter:label="Billing Fields"/>
15485             <group name="pay" reporter:label="Payment Fields"/>
15486             <group name="dates" reporter:label="Date Fields"/>
15487             <group name="org" reporter:label="Libraries"/>
15488         </field_groups>
15489         <fields oils_persist:primary="xact_id">
15490              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15491              <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"/>
15492              <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"/>
15493              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15494              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15495              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15496              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15497              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15498              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15499              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15500              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15501              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15502              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15503              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15504              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15505              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15506              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15507              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15508              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15509              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15510              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15511              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15512              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15513              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15514              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15515              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15516              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15517              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15518              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15519              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15520              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15521              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15522              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15523              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15524              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15525              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15526              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15527              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15528              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15529              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15530              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15531              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15532              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15533              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15534              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15535              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15536              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15537              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15538              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15539              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15540              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15541              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15542              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15543              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15544              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15545              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15546              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15547              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15548              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15549              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15550              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15551              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15552         </fields>
15553     </class>
15554
15555         <class id="coauf" 
15556                 controller="open-ils.cstore open-ils.pcrud"
15557                 oils_obj:fieldmapper="config::openathens_uid_field" 
15558                 oils_persist:tablename="config.openathens_uid_field" 
15559                 reporter:label="OpenAthens unique identifiers">
15560                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15561                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15562                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15563                 </fields>
15564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15565                         <actions>
15566                                 <retrieve/>
15567                         </actions>
15568                 </permacrud>
15569         </class>
15570
15571         <class id="coanf" 
15572                 controller="open-ils.cstore open-ils.pcrud"
15573                 oils_obj:fieldmapper="config::openathens_name_field" 
15574                 oils_persist:tablename="config.openathens_name_field" 
15575                 reporter:label="OpenAthens name fields">
15576                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15577                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15578                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15579                 </fields>
15580                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15581                         <actions>
15582                                 <retrieve/>
15583                         </actions>
15584                 </permacrud>
15585         </class>
15586
15587         <class id="coai" 
15588                 controller="open-ils.cstore open-ils.pcrud"
15589                 oils_obj:fieldmapper="config::openathens_identity" 
15590                 oils_persist:tablename="config.openathens_identity" 
15591                 reporter:label="Sign-on to OpenAthens">
15592                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15593                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15594                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15595                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15596                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15597                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15598                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15599                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15600                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15601                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15602                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15603                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15604                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15605                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15606                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15607                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15608                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15609                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15610                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15611                 </fields>
15612                 <links>
15613                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15614                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15615                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15616                 </links>
15617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15618                         <actions>
15619                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15620                                 <retrieve/>
15621                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15622                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15623                         </actions>
15624                 </permacrud>
15625         </class>
15626
15627         <class id="acqr_inv_totals"
15628                 controller="open-ils.reporter"
15629                 oils_persist:virtual="true"
15630                 reporter:label="Invoice Totals">
15631                 <oils_persist:source_definition><![CDATA[
15632                         WITH invoice_entry_totals AS (
15633                                 SELECT acqinv.id,
15634                                         SUM(COALESCE(acqie.cost_billed, 0.00)) AS total_invoice_entry_cost_billed,
15635                                         SUM(COALESCE(acqie.amount_paid, 0.00)) AS total_invoice_entry_amount_paid
15636                                 FROM acq.invoice acqinv
15637                                 LEFT JOIN acq.invoice_entry acqie ON (acqinv.id = acqie.invoice)
15638                                 GROUP BY 1
15639                         ), invoice_item_totals AS (
15640                                 SELECT acqinv.id,
15641                                         SUM(COALESCE(acqii.cost_billed, 0.00)) AS total_invoice_item_cost_billed,
15642                                         SUM(COALESCE(acqii.amount_paid, 0.00)) AS total_invoice_item_amount_paid
15643                                 FROM acq.invoice acqinv
15644                                 LEFT JOIN acq.invoice_item  acqii ON (acqinv.id = acqii.invoice)
15645                                 GROUP BY 1
15646                         )
15647                         SELECT id,
15648                                 total_invoice_entry_cost_billed, total_invoice_entry_amount_paid,
15649                                 total_invoice_item_cost_billed, total_invoice_item_amount_paid,
15650                                 total_invoice_entry_cost_billed + total_invoice_item_cost_billed AS total_cost_billed,
15651                                 total_invoice_entry_amount_paid + total_invoice_item_amount_paid AS total_amount_paid
15652                         FROM invoice_entry_totals
15653                         JOIN invoice_item_totals USING (id)
15654                 ]]></oils_persist:source_definition>
15655                 <fields oils_persist:primary="id">
15656                         <field reporter:label="Invoice" name="id" reporter:datatype="link" />
15657                         <field reporter:label="Total Billed for Line Items" name="total_invoice_entry_cost_billed" reporter:datatype="money" />
15658                         <field reporter:label="Total Paid for Line Items" name="total_invoice_entry_amount_paid" reporter:datatype="money" />
15659                         <field reporter:label="Total Billed for Direct Charges" name="total_invoice_item_cost_billed" reporter:datatype="money" />
15660                         <field reporter:label="Total Paid for Direct Charges" name="total_invoice_item_amount_paid" reporter:datatype="money" />
15661                         <field reporter:label="Total Billed" name="total_cost_billed" reporter:datatype="money" />
15662                         <field reporter:label="Total Paid" name="total_amount_paid" reporter:datatype="money" />
15663                 </fields>
15664         <links>
15665             <link field="id" reltype="has_a" key="id" map="" class="acqinv"/>
15666         </links>
15667         </class>
15668
15669         <class id="acqr_debit_by_fund"
15670                 controller="open-ils.reporter"
15671                 oils_persist:virtual="true"
15672                 reporter:label="Invoice Debits by Fund">
15673                 <oils_persist:source_definition><![CDATA[
15674                         WITH invoice_funds AS (
15675                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15676                                 FROM acq.invoice_entry acqie
15677                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15678                                 UNION ALL
15679                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15680                                 FROM acq.invoice_item acqii
15681                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15682                         )
15683                         SELECT invoice, fund, encumbrance, SUM (amount) AS total_amount
15684                         FROM invoice_funds
15685                         GROUP BY 1, 2, 3
15686                 ]]></oils_persist:source_definition>
15687                 <fields>
15688                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
15689                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
15690                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool" />
15691                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money" />
15692                 </fields>
15693         <links>
15694             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15695             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
15696         </links>
15697         </class>
15698
15699         <class id="acqr_debit_by_fund_tag"
15700                 controller="open-ils.reporter"
15701                 oils_persist:virtual="true"
15702                 reporter:label="Invoice Debits by Fund Tag">
15703                 <oils_persist:source_definition><![CDATA[
15704                         WITH invoice_funds AS (
15705                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15706                                 FROM acq.invoice_entry acqie
15707                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15708                                 UNION ALL
15709                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15710                                 FROM acq.invoice_item acqii
15711                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15712                         )
15713                         SELECT invoice, tag, encumbrance, SUM(amount) AS total_amount
15714                         FROM invoice_funds
15715                         LEFT JOIN acq.fund_tag_map acqftm ON (invoice_funds.fund = acqftm.fund)
15716                         GROUP BY 1, 2, 3
15717                 ]]></oils_persist:source_definition>
15718                 <fields>
15719                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
15720                         <field reporter:label="Fund Tag" name="tag" reporter:datatype="link" />
15721                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool" />
15722                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money" />
15723                 </fields>
15724         <links>
15725             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15726             <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
15727         </links>
15728         </class>
15729
15730         <!-- ********************************************************************************************************************* -->
15731 </IDL>
15732
15733 <!-- Local Variables: -->
15734 <!-- indent-tabs-mode: t -->
15735 <!-- tab-width: 4 -->
15736 <!-- nxml-child-indent: 4 -->
15737 <!-- End: -->
15738 <!--
15739         vim:noet:ts=4:sw=4:
15740 -->