]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
lp1993824: linkchecker; IDL
[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" reporter:selector="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.deleted IS FALSE AND
6966                         acp.status IN (SELECT id FROM config.copy_status WHERE holdable IS TRUE AND is_available IS TRUE)
6967                 ]]></oils_persist:source_definition>
6968                 <fields oils_persist:primary="id">
6969                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6970                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6971                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6972                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6973                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6974                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6975                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6976                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6977                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6978                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6979                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6980                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6981                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6982                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6983                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6984                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6985                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6986                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6987                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6988                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6989                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6990                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6991                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6992                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6993                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6994                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6995                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6996                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6997                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6998                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6999                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7000                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7001                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7002                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7003                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7004                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7005                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7006                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7007                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7008                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7009                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7010                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
7011                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
7012                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
7013                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
7014                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
7015                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
7016                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
7017                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
7018                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
7019                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
7020                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
7021                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
7022                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7023                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7024                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7025                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7026                 </fields>
7027                 <links>
7028                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7029                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7030                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7031                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7032                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7033                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7034                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7035                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7036                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7037                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7038                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7039                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7040                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7041                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7042                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7043                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7044                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7045                 </links>
7046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7047                         <actions>
7048                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7049                         </actions>
7050                 </permacrud>
7051         </class>
7052         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7053                 <oils_persist:source_definition><![CDATA[
7054                         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)
7055                 ]]></oils_persist:source_definition>
7056                 <fields oils_persist:primary="id">
7057                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7058                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7059                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7060                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7061                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7062                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7063                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7064                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7065                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7066                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7067                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7068                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7069                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7070                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7071                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7072                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7073                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7074                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7075                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7076                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7077                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7078                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7079                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7080                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7081                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7082                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7083                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7084                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7085                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7086                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7087                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7088                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7089                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7090                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7091                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7092                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7093                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7094                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7095                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7096                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7097                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7098                 </fields>
7099                 <links>
7100                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7101                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7102                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7103                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7104                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7105                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7106                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7107                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7108                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7109                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7110                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7111                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7112                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7113                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7114                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7115                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7116                 </links>
7117         </class>
7118
7119         <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">
7120                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7121                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7122                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7123                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7124                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7125                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7126                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7127                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7128                 </fields>
7129                 <links>
7130                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7131                 </links>
7132                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7133                         <actions>
7134                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7135                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7136                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7137                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7138                         </actions>
7139                 </permacrud>
7140         </class>
7141         <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">
7142                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7143                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7144                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7145                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7146                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7147                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7148                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7149                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7150                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7151                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7152                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7153                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7154                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7155                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7156                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7157                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7158                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7159                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7160                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7161                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7162                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7163                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7164                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7165                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7166                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7167                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7168                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7169                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7170                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7171                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7172                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7173                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7174                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7175                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7176                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7177                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7178                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7179                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7180                 </fields>
7181                 <links>
7182                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7183                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7184                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7185                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7186                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7187                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7188                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7189                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7190                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7191                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7192                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7193                 </links>
7194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7195                         <actions>
7196                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7197                         </actions>
7198                 </permacrud>
7199         </class>
7200         <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">
7201                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7202                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7203                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7204                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7205                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7206                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7207                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7208                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7209                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7210                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7211                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7212                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7213                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7214                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7215                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7216                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7217                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7218                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7219                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7220                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7221                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7222                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7223                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7224                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7225                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7226                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7227                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7228                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7229                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7230                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7231                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7232                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7233                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7234                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7235                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7236                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7237                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7238                 </fields>
7239                 <links>
7240                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7241                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7242                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7243                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7244                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7245                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7246                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7247                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7248                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7249                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7250                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7251                 </links>
7252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7253                         <actions>
7254                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7255                         </actions>
7256                 </permacrud>
7257         </class>
7258
7259         <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">
7260                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7261                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7262                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7263                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7264                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7265                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7266                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7267                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7268                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7269                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7270                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7271                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7272                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7273                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7274                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7275                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7276                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7277                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7278                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7279                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7280                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7281                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7282                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7283                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7284                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7285                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7286                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7287                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7288                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7289                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7290                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7291                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7292                 </fields>
7293                 <links>
7294                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7295                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7296                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7297                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7298                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7299                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7300                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7301                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7302                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7303                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7304                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7305                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7306                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7307                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7308                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7309                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7310                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7311                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7312                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7313                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7314                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7315                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7316                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7317                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7318                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7319                 </links>
7320         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7321             <actions>
7322                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7323                 <retrieve />
7324                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7325                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7326             </actions>
7327         </permacrud>
7328         </class>
7329         <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">
7330                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7331                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7332                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7333                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7334                 </fields>
7335                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7336                         <actions>
7337                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7338                                 <retrieve/>
7339                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7340                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7341                         </actions>
7342                 </permacrud>
7343         </class>
7344         <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">
7345                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7346                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7347                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7348                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7349                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7350                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7351                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7352                 </fields>
7353                 <links>
7354                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7355                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7356                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7357                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7358                 </links>
7359                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7360                         <actions>
7361                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7362                                 <retrieve/>
7363                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7364                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7365                         </actions>
7366                 </permacrud>
7367         </class>
7368         <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">
7369                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7370                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7371                         <field name="btype" reporter:datatype="text"/>
7372                         <field name="id" reporter:datatype="id" />
7373                         <field name="name"  reporter:datatype="text"/>
7374                         <field name="description" reporter:datatype="text"/>
7375                         <field name="owner" reporter:datatype="link"/>
7376                         <field name="pub" reporter:datatype="bool"/>
7377                         <field name="create_time" reporter:datatype="timestamp" />
7378                         <field name="owning_lib" reporter:datatype="org_unit" />
7379                 </fields>
7380                 <links>
7381                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7382                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7383                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7384                 </links>
7385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7386                         <actions>
7387                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7388                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7389                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7390                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7391                         </actions>
7392                 </permacrud>
7393         </class>
7394         <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">
7395                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7396                         <field name="id" reporter:datatype="id" />
7397                         <field name="bucket" reporter:datatype="link"/>
7398                         <field name="note" reporter:datatype="text" />
7399                 </fields>
7400                 <links>
7401                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7402                 </links>
7403         </class>
7404         <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">
7405                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7406                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7407                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7408                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7409                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7410                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7411                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7412                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7413                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7414                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7415                 </fields>
7416                 <links>
7417                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7418                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7419                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7420                 </links>
7421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7422                         <actions>
7423                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7424                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7425                 <retrieve />
7426                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7427                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7428             </actions>
7429                 </permacrud>
7430         </class>
7431         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7432                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7433                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7434                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7435                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7436                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7437                 </fields>
7438                 <links>
7439                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7440                 </links>
7441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7442                         <actions>
7443                                 <retrieve permission="VIEW_USER user_request.view">
7444                                         <context link="usr" field="home_ou" />
7445                                 </retrieve>
7446                         </actions>
7447                 </permacrud>
7448         </class>
7449     <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">
7450         <fields oils_persist:primary="field">
7451             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7452             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7453             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7454         </fields>
7455         <links/>
7456         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7457             <actions>
7458                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7459                 <retrieve />
7460                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7461                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7462             </actions>
7463         </permacrud>
7464     </class>
7465         <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">
7466                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7467                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7468                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7469                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7470                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7471                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7472                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7473                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7474                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7475                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7476                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7477                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7478                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7479                 </fields>
7480                 <links>
7481                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7482                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7483                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7484                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7485                 </links>
7486         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7487             <actions>
7488                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7489                 <retrieve />
7490                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7491                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7492             </actions>
7493         </permacrud>
7494         </class>
7495         <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">
7496                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7497                         <field name="field" reporter:datatype="link"/>
7498                         <field name="id" reporter:datatype="id" />
7499                         <field name="source" reporter:datatype="link"/>
7500                         <field name="value"  reporter:datatype="text"/>
7501                 </fields>
7502                 <links>
7503                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7504                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7505                 </links>
7506         </class>
7507         <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">
7508                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7509                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7510                         <field name="btype" reporter:datatype="text"/>
7511                         <field name="id" reporter:datatype="id" />
7512                         <field name="name"  reporter:datatype="text"/>
7513                         <field name="description" reporter:datatype="text"/>
7514                         <field name="owner" reporter:datatype="link"/>
7515                         <field name="pub" reporter:datatype="bool"/>
7516                         <field name="create_time" reporter:datatype="timestamp" />
7517                         <field name="owning_lib" reporter:datatype="org_unit" />
7518                 </fields>
7519                 <links>
7520                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7521                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7522                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7523                 </links>
7524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7525                         <actions>
7526                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7527                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7528                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7529                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7530                         </actions>
7531                 </permacrud>
7532         </class>
7533         <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">
7534                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7535                         <field name="id" reporter:datatype="id" />
7536                         <field name="bucket" reporter:datatype="link"/>
7537                         <field name="note" reporter:datatype="text" />
7538                 </fields>
7539                 <links>
7540                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7541                 </links>
7542         </class>
7543         <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">
7544                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7545                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7546                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7547                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7548                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7549                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7550                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7551                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7552                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7553                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7554                 </fields>
7555                 <links>
7556                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7557                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7558                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7559                 </links>
7560         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7561             <actions>
7562                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7563                     <context link="xact" jump="usr" field="home_ou"/>
7564                 </retrieve>
7565                         </actions>
7566                 </permacrud>
7567         </class>
7568         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7569                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7570                         <field name="id" reporter:datatype="id" />
7571                         <field name="ind1" />
7572                         <field name="ind2" />
7573                         <field name="record" />
7574                         <field name="subfield" />
7575                         <field name="tag" />
7576                         <field name="value" />
7577                 </fields>
7578                 <links>
7579                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7580                 </links>
7581         </class>
7582         <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">
7583                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7584                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7585                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7586                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7587                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7588                 </fields>
7589                 <links>
7590                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7591                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7592                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7593                 </links>
7594         </class>
7595         <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">
7596                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7597                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7598                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7599                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7600                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7601                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7602                 </fields>
7603                 <links>
7604                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7605                 </links>
7606         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7607             <actions>
7608                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7609                 <retrieve/>
7610                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7611                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7612             </actions>
7613         </permacrud>
7614
7615         </class>
7616         <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">
7617                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7618                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7619                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7620                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7621                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7622                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7623                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7624                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7625                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7626                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7627                 </fields>
7628                 <links>
7629                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7630                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7631                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7632                 </links>
7633         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7634             <actions>
7635                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7636                 <retrieve/>
7637                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7638                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7639             </actions>
7640         </permacrud>
7641         </class>
7642         <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">
7643                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7644                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7645                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7646                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7647                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7648                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7649                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7650                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7651                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7652                 </fields>
7653                 <links>
7654                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7655                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7656                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7657                 </links>
7658                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7659                 <actions>
7660                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7661                     <retrieve/>
7662                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7663                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7664                 </actions>
7665              </permacrud>
7666         </class>
7667         <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">
7668                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7669                         <field name="balance_owed" reporter:datatype="money" />
7670                         <field name="total_owed" reporter:datatype="money" />
7671                         <field name="total_paid" reporter:datatype="money" />
7672                         <field name="usr" reporter:datatype="link"/>
7673                 </fields>
7674                 <links>
7675                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7676                 </links>
7677         </class>
7678     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7679                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7680                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7681                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7682                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7683                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7684                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7685                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7686                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7687                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7688                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7689                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7690                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7691                 </fields>
7692                 <links>
7693                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7694                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7695                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7696                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7697                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7698                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7699                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7700                 </links>
7701         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7702             <actions>
7703                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7704             </actions>
7705         </permacrud>
7706         </class>
7707         <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">
7708                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7709                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7710                         <field name="quality" reporter:datatype="int" />
7711                         <field name="source" reporter:datatype="text"/>
7712                         <field name="transcendant" reporter:datatype="bool"/>
7713                         <field name="can_have_copies" reporter:datatype="bool"/>
7714                 </fields>
7715                 <links/>
7716         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7717             <actions>
7718                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7719                 <retrieve/>
7720                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7721                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7722             </actions>
7723         </permacrud>
7724         </class>
7725         <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">
7726                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7727                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7728                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7729                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7730                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7731                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7732                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7733                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7734                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7735                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7736                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7737                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7738                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7739                 </fields>
7740                 <links>
7741                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7742                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7743                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7744                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7745                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7746                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7747                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7748                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7749                 </links>
7750                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7751                         <actions>
7752                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7753                                         <context link="usr" field="home_ou" />
7754                                 </retrieve>
7755                         </actions>
7756                 </permacrud>
7757         </class>
7758         <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">
7759                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7760                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7761                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7762                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7763                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7764                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7765                 </fields>
7766                 <links>
7767                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7768                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7769                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7770                 </links>
7771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7772                         <actions>
7773                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7774                     <context link="stat_cat" field="owner"/>
7775                 </create>
7776                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7777                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7778                     <context link="stat_cat" field="owner"/>
7779                 </update>
7780                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7781                     <context link="stat_cat" field="owner"/>
7782                 </delete>
7783                         </actions>
7784                 </permacrud>
7785         </class>
7786         <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">
7787                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7788                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7789                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7790                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7791                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7792                 </fields>
7793                 <links>
7794                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7795                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7796                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7797                 </links>
7798         </class>
7799         <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">
7800                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7801                         <field name="bucket" reporter:datatype="link"/>
7802                         <field name="id" reporter:datatype="id" />
7803                         <field name="target_user" reporter:datatype="link"/>
7804                         <field name="create_time" reporter:datatype="timestamp" />
7805                         <field name="pos" reporter:datatype="int" />
7806                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7807                 </fields>
7808                 <links>
7809                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7810                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7811             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7812                 </links>
7813                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7814                         <actions>
7815                                 <retrieve permission="ADMIN_USER_BUCKET">
7816                     <context link="bucket" field="owning_lib"/>
7817                 </retrieve>
7818             </actions>
7819         </permacrud>
7820         </class>
7821         <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">
7822                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7823                         <field name="id" reporter:datatype="id" />
7824                         <field name="staff" reporter:datatype="link"/>
7825                         <field name="bucket" reporter:datatype="link"/>
7826                         <field name="target" reporter:datatype="int" />
7827                         <field name="hold_type" reporter:datatype="text" />
7828                         <field name="run_date" reporter:datatype="timestamp" />
7829                         <field name="cancelled" reporter:datatype="timestamp" />
7830                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7831                 </fields>
7832                 <links>
7833                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7834                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7835                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7836                 </links>
7837                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7838                         <actions>
7839                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7840                 <retrieve/>
7841                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7842                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7843             </actions>
7844         </permacrud>
7845         </class>
7846         <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">
7847                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7848                         <field name="id" reporter:datatype="id" />
7849                         <field name="batch_hold_event" reporter:datatype="link"/>
7850                         <field name="hold" reporter:datatype="link"/>
7851                 </fields>
7852                 <links>
7853                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7854                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7855                 </links>
7856                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7857                         <actions>
7858                 <retrieve/>
7859             </actions>
7860         </permacrud>
7861         </class>
7862         <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">
7863                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7864                         <field name="id" reporter:datatype="id" />
7865                         <field name="item" reporter:datatype="link"/>
7866                         <field name="note" reporter:datatype="text" />
7867                 </fields>
7868                 <links>
7869                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7870                 </links>
7871         </class>
7872         <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">
7873                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7874                         <field name="balance_owed" reporter:datatype="money" />
7875                         <field name="total_owed" reporter:datatype="money" />
7876                         <field name="total_paid" reporter:datatype="money" />
7877                         <field name="usr" reporter:datatype="link"/>
7878                 </fields>
7879                 <links>
7880                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7881                 </links>
7882                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7883                         <actions>
7884                                 <retrieve permission="VIEW_USER">
7885                                         <context link="usr" field="home_ou"/>
7886                                 </retrieve>
7887                         </actions>
7888                 </permacrud>
7889         </class>
7890         <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">
7891                 <fields oils_persist:primary="code" oils_persist:sequence="">
7892                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7893                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7894                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7895                 </fields>
7896                 <links/>
7897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7898             <actions>
7899                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7900                 <retrieve/>
7901                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7902                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7903             </actions>
7904         </permacrud>
7905         </class>
7906         <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">
7907                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7908                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7909                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7910                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7911                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7912                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7913                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7914                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7915                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7916                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7917                 </fields>
7918                 <links>
7919                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7920                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7921                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7922                 </links>
7923         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7924             <actions>
7925                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7926                     <context link="xact" jump="usr" field="home_ou"/>
7927                 </retrieve>
7928                         </actions>
7929                 </permacrud>
7930         </class>
7931         <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">
7932                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7933                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7934                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7935                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7936                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7937                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7938                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7939                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7940                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7941                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7942                 </fields>
7943                 <links>
7944                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7945                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7946                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7947                 </links>
7948         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7949             <actions>
7950                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7951                     <context link="xact" jump="usr" field="home_ou"/>
7952                 </retrieve>
7953                         </actions>
7954                 </permacrud>
7955         </class>
7956         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7957                 <fields oils_persist:primary="id" oils_persist:sequence="">
7958                         <field name="checkin_lib" reporter:datatype="link"/>
7959                         <field name="checkin_staff" reporter:datatype="link"/>
7960                         <field name="checkin_time" reporter:datatype="timestamp"/>
7961                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7962                         <field name="circ_staff" reporter:datatype="link"/>
7963                         <field name="desk_renewal" reporter:datatype="bool"/>
7964                         <field name="due_date" reporter:datatype="timestamp"/>
7965                         <field name="duration" reporter:datatype="interval"/>
7966                         <field name="duration_rule" reporter:datatype="link"/>
7967                         <field name="fine_interval" reporter:datatype="interval"/>
7968                         <field name="id" reporter:datatype="id" />
7969                         <field name="max_fine" reporter:datatype="money" />
7970                         <field name="max_fine_rule" reporter:datatype="link"/>
7971                         <field name="opac_renewal" reporter:datatype="bool"/>
7972                         <field name="phone_renewal" reporter:datatype="bool"/>
7973                         <field name="recurring_fine" reporter:datatype="money" />
7974                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7975                         <field name="renewal_remaining" reporter:datatype="int" />
7976             <field name="grace_period" reporter:datatype="interval" />
7977                         <field name="stop_fines" reporter:datatype="text"/>
7978                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7979                         <field name="target_copy" reporter:datatype="link"/>
7980                         <field name="usr" reporter:datatype="link"/>
7981                         <field name="xact_finish" reporter:datatype="timestamp" />
7982                         <field name="xact_start" reporter:datatype="timestamp" />
7983                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7984                         <field name="auto_renewal" reporter:datatype="bool"/>
7985                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7986                 </fields>
7987                 <links>
7988                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7989                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7990                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7991                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7992                 </links>
7993         </class>
7994         <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">
7995                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7996                         <field name="field" reporter:datatype="link"/>
7997                         <field name="id" reporter:datatype="id" />
7998                         <field name="source" reporter:datatype="link"/>
7999                         <field name="value" reporter:datatype="text"/>
8000                 </fields>
8001                 <links>
8002                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8003                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8004                 </links>
8005         </class>
8006         <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">
8007                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
8008                         <field name="high" reporter:datatype="money" />
8009                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
8010                         <field name="low" reporter:datatype="money" />
8011                         <field name="name" reporter:datatype="text"/>
8012                         <field name="normal" reporter:datatype="money" />
8013                         <field name="recurrence_interval" reporter:datatype="interval"/>
8014             <field name="grace_period" reporter:datatype="interval" />
8015                 </fields>
8016                 <links/>
8017         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8018             <actions>
8019                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8020                 <retrieve/>
8021                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8022                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8023             </actions>
8024         </permacrud>
8025         </class>
8026         <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">
8027                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8028                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8029                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8030                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8031                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8032                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
8033                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8034                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8035                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8036                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8037                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8038                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8039                 </fields>
8040                 <links>
8041                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8042                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8043                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8044                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8045                 </links>
8046         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8047             <actions>
8048                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8049                     <context link="xact" jump="usr" field="home_ou"/>
8050                 </retrieve>
8051                         </actions>
8052                 </permacrud>
8053         </class>
8054         <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">
8055                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8056                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8057                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8058                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8059                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8060                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8061                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8062                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8063                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8064                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8065                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8066                 </fields>
8067                 <links>
8068                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8069                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8070                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8071                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8072                 </links>
8073         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8074             <actions>
8075                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8076                     <context link="xact" jump="usr" field="home_ou"/>
8077                 </retrieve>
8078                         </actions>
8079                 </permacrud>
8080         </class>
8081         <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">
8082                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8083                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8084                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8085                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8086                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8087                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8088                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8089                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8090                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8091                         <field reporter:label="Item Number on Volume" name="copy_number" reporter:datatype="text"/>
8092                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8093                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8094                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8095                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8096                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8097                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8098                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8099                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8100                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8101                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8102                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8103                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8104                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8105                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8106                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8107                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8108                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8109                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8110                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8111                         <field reporter:label="Item Status" name="status" reporter:datatype="link"/>
8112                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8113                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8114                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8115                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8116                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8117                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8118                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8119                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8120                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8121                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8122                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8123                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8124                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8125                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8126                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8127                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8128                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8129                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8130                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8131                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8132                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8133                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8134                 </fields>
8135                 <links>
8136                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8137                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8138                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8139                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8140                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8141                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8142                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8143                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8144                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8145                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8146                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8147                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8148                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8149                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8150                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8151                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8152                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8153                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8154                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8155                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8156                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8157                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8158                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8159                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8160                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8161                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8162                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8163                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8164                 </links>
8165         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8166             <actions>
8167                 <create permission="CREATE_COPY">
8168                     <context link="call_number" field="owning_lib"/>
8169                 </create>
8170                 <retrieve/>
8171                 <update permission="UPDATE_COPY">
8172                     <context link="call_number" field="owning_lib"/>
8173                 </update>
8174                 <delete permission="DELETE_COPY">
8175                     <context link="call_number" field="owning_lib"/>
8176                 </delete>
8177             </actions>
8178         </permacrud>
8179         </class>
8180
8181         <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">
8182                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8183                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8184                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8185                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8186                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8187                 </fields>
8188                 <links>
8189                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8190                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8191                 </links>
8192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8193                         <actions>
8194                 <create permission="STAFF_LOGIN"/>
8195                 <retrieve/>
8196                 <update permission="STAFF_LOGIN"/>
8197                 <delete permission="STAFF_LOGIN"/>
8198                         </actions>
8199                 </permacrud>
8200         </class>
8201
8202         <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">
8203                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8204             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8205                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8206                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8207                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8208                 </fields>
8209                 <links>
8210                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8211                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8212                 </links>
8213         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8214             <actions>
8215                                 <retrieve/>
8216             </actions>
8217         </permacrud>
8218         </class>
8219
8220         <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">
8221                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8222                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8223                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8224                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8225                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8226                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8227                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8228                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8229                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8230                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8231                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8232                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8233                 </fields>
8234                 <links>
8235                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8236                 </links>
8237         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8238             <actions>
8239                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8240                 <retrieve/>
8241                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8242                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8243             </actions>
8244         </permacrud>
8245         </class>
8246
8247         <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">
8248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8249                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8250                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8251                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8252                 </fields>
8253                 <links>
8254                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8255                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8256                 </links>
8257         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8258             <actions>
8259                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8260                 <retrieve/>
8261                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8262                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8263             </actions>
8264         </permacrud>
8265         </class>
8266
8267         <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">
8268                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8269                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8270                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8271                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8272                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8273                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8274                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8275                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8276                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8277                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8278                 </fields>
8279                 <links>
8280                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8281                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8282                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8283                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8284                 </links>
8285         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8286             <actions>
8287                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8288                     <context link="copy" field="circ_lib"/>
8289                 </create>
8290                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8291                     <context link="copy" field="circ_lib"/>
8292                                 </retrieve>
8293                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8294                     <context link="copy" field="circ_lib"/>
8295                                 </update>
8296                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8297                     <context link="copy" field="circ_lib"/>
8298                                 </delete>
8299             </actions>
8300         </permacrud>
8301         </class>
8302
8303         <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">
8304                 <fields oils_persist:primary="id">
8305                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8306                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8307                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8308                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8309                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8310                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8311                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8312                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8313                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8314                 </fields>
8315                 <links>
8316                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8317                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8318                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8319                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8320                 </links>
8321         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8322             <actions>
8323                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8324                     <context link="copy" field="circ_lib"/>
8325                 </create>
8326                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8327                     <context link="copy" field="circ_lib"/>
8328                                 </retrieve>
8329                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8330                     <context link="copy" field="circ_lib"/>
8331                                 </update>
8332                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8333                     <context link="copy" field="circ_lib"/>
8334                                 </delete>
8335             </actions>
8336         </permacrud>
8337         </class>
8338
8339         <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">
8340                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8341                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8342                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8343                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8344                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8345                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8346                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8347                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8348                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8349                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8350                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8351                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8352                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8353                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8354                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8355                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8356                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8357                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8358                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8359                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8360                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8361                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8362                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8363                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8364                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8365                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8366                 </fields>
8367                 <links>
8368                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8369                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8370                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8371                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8372                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8373                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8374                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8375                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8376                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8377                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8378                 </links>
8379                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8380                         <actions>
8381                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8382                                 <retrieve />
8383                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8384                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8385                         </actions>
8386                 </permacrud>
8387         </class>
8388
8389         <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">
8390                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8391                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8392                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8393                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8394                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8395                 </fields>
8396                 <links/>
8397         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8398             <actions>
8399                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8400                 <retrieve/>
8401                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8402                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8403             </actions>
8404         </permacrud>
8405         </class>
8406         <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">
8407                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8408                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8409                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8410                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8411                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8412                 </fields>
8413                 <links/>
8414         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8415             <actions>
8416                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8417                 <retrieve/>
8418                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8419                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8420             </actions>
8421         </permacrud>
8422         </class>
8423         <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">
8424                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8425                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8426                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8427                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8428                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8429                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8430                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8431                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8432                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8433                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8434                 </fields>
8435                 <links>
8436                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8437                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8438                 </links>
8439         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8440             <actions>
8441                 <create permission="CREATE_PERM" global_required="true"/>
8442                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8443                 <update permission="UPDATE_PERM" global_required="true"/>
8444                 <delete permission="DELETE_PERM" global_required="true"/>
8445             </actions>
8446         </permacrud>
8447         </class>
8448         <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">
8449                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8450                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8451                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8452                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8453                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8454                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8455                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8456                 </fields>
8457                 <links>
8458                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8459                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8460                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8461                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8462                 </links>
8463                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8464                         <actions>
8465                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8466                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8467                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8468                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8469                         </actions>
8470                 </permacrud>
8471         </class>
8472         <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">
8473                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8474                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8475                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8476                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8477                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8478                 </fields>
8479                 <links>
8480                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8481                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8482                 </links>
8483         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8484             <actions>
8485                 <create permission="ADMIN_SURVEY">
8486                     <context link="question" jump="survey" field="owner"/>
8487                 </create>
8488                 <retrieve/>
8489                 <update permission="ADMIN_SURVEY">
8490                     <context link="question" jump="survey" field="owner"/>
8491                 </update>
8492                 <delete permission="ADMIN_SURVEY">
8493                     <context link="question" jump="survey" field="owner"/>
8494                 </delete>
8495             </actions>
8496         </permacrud>
8497         </class>
8498         <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">
8499                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8500                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8501                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8502                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8503                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8504                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8505                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8506                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8507                 </fields>
8508                 <links>
8509                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8510                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8511                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8512                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8513                 </links>
8514                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8515                         <actions>
8516                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8517                         </actions>
8518                 </permacrud>
8519         </class>
8520         <class id="aoncc" controller="open-ils.cstore open-ils.pcrud" 
8521                 oils_obj:fieldmapper="action::open_non_cataloged_circulation" 
8522                 oils_persist:tablename="action.open_non_cataloged_circulation" 
8523                 oils_persist:readonly="true" reporter:core="true" 
8524                 reporter:label="Open Non-cataloged Circulation">
8525                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8526                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8527                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8528                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8529                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8530                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8531                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8532                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8533                 </fields>
8534                 <links>
8535                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8536                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8537                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8538                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8539                 </links>
8540                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8541                         <actions>
8542                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8543                         </actions>
8544                 </permacrud>
8545         </class>
8546         <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">
8547                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8548                         <field name="balance_owed" reporter:datatype="money" />
8549                         <field name="total_owed" reporter:datatype="money" />
8550                         <field name="total_paid" reporter:datatype="money" />
8551                         <field name="usr" reporter:datatype="link"/>
8552                 </fields>
8553                 <links>
8554                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8555                 </links>
8556         </class>
8557         <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">
8558                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8559                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8560                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8561                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8562                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8563                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8564                 </fields>
8565                 <links>
8566                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8567                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8568                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8569                 </links>
8570         </class>
8571         <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">
8572                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8573                         <field name="field" reporter:datatype="link"/>
8574                         <field name="id" reporter:datatype="id" />
8575                         <field name="source" reporter:datatype="link"/>
8576                         <field name="value" reporter:datatype="text"/>
8577                 </fields>
8578                 <links>
8579                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8580                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8581                 </links>
8582         </class>
8583         <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">
8584                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8585                         <field name="field" reporter:datatype="link"/>
8586                         <field name="id" reporter:datatype="id" />
8587                         <field name="source" reporter:datatype="link"/>
8588                         <field name="value" reporter:datatype="text"/>
8589                 </fields>
8590                 <links>
8591                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8592                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8593                 </links>
8594         </class>
8595         <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">
8596                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8597                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8598                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8599                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8600                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8601                 </fields>
8602                 <links>
8603                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8604                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8605                 </links>
8606         </class>
8607         <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">
8608                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8609                         <field name="depth" reporter:datatype="int" />
8610                         <field name="grantable" reporter:datatype="bool"/>
8611                         <field name="grp" reporter:datatype="link"/>
8612                         <field name="id" reporter:datatype="id" />
8613                         <field name="perm" reporter:datatype="link"/>
8614                 </fields>
8615                 <links>
8616                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8617                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8618                 </links>
8619         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8620             <actions>
8621                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8622                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8623                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8624                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8625             </actions>
8626         </permacrud>
8627         </class>
8628         <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">
8629                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8630                         <field name="items" oils_persist:virtual="true" />
8631                         <field name="btype" reporter:datatype="text"/>
8632                         <field name="id" reporter:datatype="id" />
8633                         <field name="name" reporter:datatype="text"/>
8634                         <field name="description" reporter:datatype="text"/>
8635                         <field name="owner" reporter:datatype="link"/>
8636                         <field name="pub" reporter:datatype="bool"/>
8637                         <field name="create_time" reporter:datatype="timestamp" />
8638                         <field name="owning_lib" reporter:datatype="org_unit" />
8639                 </fields>
8640                 <links>
8641                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8642                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8643                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8644                 </links>
8645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8646                         <actions>
8647                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8648                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8649                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8650                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8651                         </actions>
8652                 </permacrud>
8653         </class>
8654         <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">
8655                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8656                         <field name="id" reporter:datatype="id" />
8657                         <field name="bucket" reporter:datatype="link"/>
8658                         <field name="note" reporter:datatype="text" />
8659                 </fields>
8660                 <links>
8661                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8662                 </links>
8663         </class>
8664         <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">
8665                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8666                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8667                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8668                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8669                 </fields>
8670                 <links>
8671                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8672                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8673                 </links>
8674         </class>
8675         <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">
8676                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8677                         <field name="depth" reporter:datatype="int"/>
8678                         <field name="grantable" reporter:datatype="bool"/>
8679                         <field name="id" reporter:datatype="id" />
8680                         <field name="perm" reporter:datatype="link"/>
8681                         <field name="usr" reporter:datatype="link"/>
8682                 </fields>
8683                 <links>
8684                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8685                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8686                 </links>
8687         </class>
8688         <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">
8689                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8690                         <field name="object_id" reporter:datatype="text"/>
8691                         <field name="grantable" reporter:datatype="bool"/>
8692                         <field name="id" reporter:datatype="id" />
8693                         <field name="perm" reporter:datatype="link"/>
8694                         <field name="usr" reporter:datatype="link"/>
8695                         <field name="object_type" reporter:datatype="text"/>
8696                 </fields>
8697                 <links>
8698                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8699                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8700                 </links>
8701         </class>
8702         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8703                 <fields oils_persist:primary="id" oils_persist:sequence="">
8704                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8705                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8706                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8707                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8708                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8709                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8710                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8711                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8712                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8713                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8714                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8715                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8716                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8717                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8718                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8719                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8720                 </fields>
8721                 <links>
8722                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8723                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8724                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8725                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8726                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8727                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8728                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8729                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8730                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8731                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8732                 </links>
8733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8734             <actions>
8735                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8736                     <context link="xact" jump="usr" field="home_ou"/>
8737                 </retrieve>
8738                         </actions>
8739                 </permacrud>
8740         </class>
8741         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8742                 oils_obj:fieldmapper="money::aged_payment" 
8743                 oils_persist:tablename="money.aged_payment" 
8744                 reporter:label="Payments: Aged">
8745                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8746                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8747                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8748                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8749                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8750                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8751                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8752                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8753                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8754                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8755                         <field name="billing" reporter:datatype="link"/>
8756                 </fields>
8757                 <links>
8758                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8759                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8760                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8761                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8762                 </links>
8763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8764                         <actions>
8765                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8766                                         <context link="xact" field="usr_home_ou"/>
8767                                 </retrieve>
8768                         </actions>
8769                 </permacrud>
8770         </class>
8771         <class id="mallp" controller="open-ils.cstore" 
8772                 oils_obj:fieldmapper="money::all_payments" 
8773                 oils_persist:tablename="money.all_payments" 
8774                 oils_persist:readonly="true" reporter:core="true"
8775                 reporter:label="Payments: All">
8776                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8777                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8778                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8779                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8780                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8781                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8782                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8783                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8784                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8785                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8786                         <field name="billing" reporter:datatype="link"/>
8787                 </fields>
8788                 <links>
8789                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8790                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8791                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8792                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8793                 </links>
8794         </class>
8795
8796         <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">
8797                 <fields oils_persist:primary="id" oils_persist:sequence="">
8798                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8799                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8800                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8801                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8802                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8803                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8804                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8805                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8806                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8807                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8808                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8809                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8810                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8811                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8812                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8813                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8814                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8815                 </fields>
8816                 <links>
8817                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8818                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8819                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8820                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8821                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8822                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8823                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8824                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8825                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8826                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8827                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8828                 </links>
8829                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8830                         <actions>
8831                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8832                                         <context link="xact" jump="usr" field="home_ou"/>
8833                                 </retrieve>
8834                         </actions>
8835                 </permacrud>
8836         </class>
8837         <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">
8838                 <fields oils_persist:primary="id" oils_persist:sequence="">
8839                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8840                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8841                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8842                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8843                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8844                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8845                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8846                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8847                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8848                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8849                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8850                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8851                 </fields>
8852                 <links>
8853                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8854                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8855                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8856                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8857                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8858                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8859                 </links>
8860         </class>
8861         <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">
8862                 <fields oils_persist:primary="id" oils_persist:sequence="">
8863                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8864                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8865                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8866                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8867                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8868                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8869                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8870                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8871                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8872                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8873                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8874                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8875                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8876                 </fields>
8877                 <links>
8878                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8879                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8880                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8881                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8882                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8883                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8884                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8885                 </links>
8886         </class>
8887         <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">
8888                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8889                         <field name="bucket" reporter:datatype="link"/>
8890                         <field name="id" reporter:datatype="id" />
8891                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8892                         <field name="create_time" reporter:datatype="timestamp" />
8893                         <field name="pos" reporter:datatype="int" />
8894                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8895                 </fields>
8896                 <links>
8897                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8898                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8899             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8900                 </links>
8901                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8902                         <actions>
8903                                 <retrieve permission="ADMIN_COPY_BUCKET">
8904                     <context link="bucket" field="owning_lib"/>
8905                 </retrieve>
8906             </actions>
8907         </permacrud>
8908         </class>
8909         <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">
8910                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8911                         <field name="id" reporter:datatype="id" />
8912                         <field name="item" reporter:datatype="link"/>
8913                         <field name="note" reporter:datatype="text" />
8914                 </fields>
8915                 <links>
8916                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8917                 </links>
8918         </class>
8919         <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">
8920                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8921                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8922                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8923                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8924                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8925                 </fields>
8926                 <links>
8927                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8928                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8929                 </links>
8930                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8931                         <actions>
8932                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8933                     <context link="stat_cat" field="owner"/>
8934                 </create>
8935                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8936                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8937                     <context link="stat_cat" field="owner"/>
8938                 </update>
8939                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8940                     <context link="stat_cat" field="owner"/>
8941                 </delete>
8942                         </actions>
8943                 </permacrud>
8944         </class>
8945     <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">
8946         <fields oils_persist:primary="field">
8947             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8948             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8949             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8950         </fields>
8951         <links/>
8952         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8953             <actions>
8954                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8955                 <retrieve />
8956                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8957                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8958             </actions>
8959         </permacrud>
8960     </class>
8961         <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">
8962                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8963                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8964                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8965                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool" />
8966                 </fields>
8967                 <links/>
8968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8969             <actions>
8970                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8971                 <retrieve/>
8972                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8973                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8974             </actions>
8975         </permacrud>
8976         </class>
8977
8978
8979         <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">
8980                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8981                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8982                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8983                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8984                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8985                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8986                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8987                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8988                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8989                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8990                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8991                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8992                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8993                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8994                 </fields>
8995                 <links>
8996                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8997                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8998                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8999                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
9000                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
9001                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
9002                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
9003                 </links>
9004         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9005             <actions>
9006                 <create permission="TRANSIT_COPY">
9007                     <context link="target_copy" field="owner"/>
9008                 </create>
9009                 <retrieve/>
9010                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
9011                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
9012             </actions>
9013         </permacrud>
9014         </class>
9015         <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">
9016                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
9017                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
9018                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
9019                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
9020                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
9021                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
9022                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
9023                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
9024                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
9025                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
9026                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
9027                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
9028                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
9029                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9030                 </fields>
9031                 <links>
9032                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
9033                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
9034                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
9035                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
9036                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
9037                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
9038                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9039                 </links>
9040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9041             <actions>
9042                 <create permission="TRANSIT_COPY" context_field="owner">
9043                     <context link="target_copy" field="circ_lib"/>
9044                 </create>
9045                 <retrieve/>
9046                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
9047                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
9048             </actions>
9049         </permacrud>
9050         </class>
9051         <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">
9052                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9053                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9054                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9055                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9056                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9057                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9058                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9059                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9060                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9061                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9062                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9063                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9064                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9065                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9066                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
9067                 </fields>
9068                 <links>
9069                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9070                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9071                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9072                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
9073                 </links>
9074         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9075             <actions>
9076                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9077                     <context link="xact" jump="usr" field="home_ou"/>
9078                 </retrieve>
9079                         </actions>
9080                 </permacrud>
9081         </class>
9082         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9083                 oils_obj:fieldmapper="money::aged_billing" 
9084                 oils_persist:tablename="money.aged_billing" 
9085                 reporter:label="Aged Billing Line Item">
9086                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9087                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9088                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9089                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9090                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9091                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9092                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9093                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9094                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9095                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9096                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9097                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9098                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9099                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9100                 </fields>
9101                 <links>
9102                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9103                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9104                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9105                 </links>
9106                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9107                         <actions>
9108                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9109                                         <context link="xact" field="usr_home_ou"/>
9110                                 </retrieve>
9111                         </actions>
9112                 </permacrud>
9113         </class>
9114         <class id="mallb" controller="open-ils.cstore" 
9115                 oils_obj:fieldmapper="money::all_billings" 
9116                 oils_persist:tablename="money.all_billings" 
9117                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9118                 <fields oils_persist:primary="id" oils_persist:sequence="">
9119                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9120                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9121                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9122                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9123                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9124                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9125                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9126                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9127                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9128                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9129                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9130                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9131                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9132                 </fields>
9133                 <links>
9134                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9135                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9136                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9137                 </links>
9138         </class>
9139         <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">
9140                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9141                         <field name="grp" />
9142                         <field name="id" reporter:datatype="id" />
9143                         <field name="usr" />
9144                 </fields>
9145                 <links>
9146                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9147                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9148                 </links>
9149         </class>
9150         <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">
9151                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9152                         <field name="id" reporter:datatype="id" />
9153                         <field name="fq_field" reporter:datatype="text"/>
9154                         <field name="identity_value" reporter:datatype="text"/>
9155                         <field name="translation" reporter:datatype="text"/>
9156                         <field name="string" reporter:datatype="text"/>
9157                 </fields>
9158                 <links>
9159                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9160                 </links>
9161         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9162             <actions>
9163                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9164                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9165                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9166                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9167             </actions>
9168         </permacrud>
9169         </class>
9170         <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">
9171                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9172                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9173                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9174                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9175                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9176                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9177                 </fields>
9178                 <links>
9179                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9180                 </links>
9181         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9182             <actions>
9183                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9184                 <retrieve/>
9185                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9186                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9187             </actions>
9188         </permacrud>
9189         </class>
9190         <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">
9191                 <fields oils_persist:primary="code">
9192                         <field name="code" reporter:datatype="id" />
9193                         <field name="marc_code" reporter:datatype="text"/>
9194                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9195                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9196                         <field name="rtl" reporter:datatype="bool"/>
9197                 </fields>
9198                 <links/>
9199         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9200             <actions>
9201                 <create permission="CREATE_LOCALE" global_required="true"/>
9202                 <retrieve/>
9203                 <update permission="UPDATE_LOCALE" global_required="true"/>
9204                 <delete permission="DELETE_LOCALE" global_required="true"/>
9205             </actions>
9206         </permacrud>
9207         </class>
9208         <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">
9209                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9210                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9211                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9212                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9213                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9214                 </fields>
9215                 <links>
9216                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9217                 </links>
9218         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9219             <actions>
9220                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9221                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9222                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9223                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9224             </actions>
9225         </permacrud>
9226         </class>
9227
9228         <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">
9229                 <fields oils_persist:primary="id">
9230                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9231                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9232                 </fields>
9233                 <links/>
9234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9235             <actions>
9236                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9237                 <retrieve/>
9238                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9239                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9240             </actions>
9241         </permacrud>
9242         </class>
9243
9244         <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">
9245                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9246                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9247                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9248                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9249                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9250                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9251                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9252                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9253                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9254                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9255                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9256                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9257                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9258                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9259                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9260                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9261                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9262                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9263                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9264                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9265                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9266                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9267                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9268                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9269                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9270                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9271                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9272                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9273                 </fields>
9274                 <links>
9275                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9276                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9277                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9278                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9279                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9280                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9281                 </links>
9282         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9283             <actions>
9284                 <create permission="user_request.create">
9285                     <context link="usr" field="home_ou"/>
9286                                 </create>
9287                 <retrieve permission="user_request.view">
9288                     <context link="usr" field="home_ou"/>
9289                                 </retrieve>
9290                 <update permission="user_request.update">
9291                     <context link="usr" field="home_ou"/>
9292                                 </update>
9293                 <delete permission="user_request.delete">
9294                     <context link="usr" field="home_ou"/>
9295                                 </delete>
9296             </actions>
9297         </permacrud>
9298         </class>
9299
9300         <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">
9301         <oils_persist:source_definition><![CDATA[
9302             SELECT r.*, CASE
9303                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9304                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9305                         WHEN l.state = 'received' THEN 5 -- Received
9306                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9307                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9308                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9309                         WHEN l.id IS NULL THEN 1 -- New
9310                         ELSE 0 -- Error
9311                     END AS request_status
9312                     ,u.home_ou
9313             FROM      acq.user_request r
9314             JOIN actor.usr u ON (r.usr = u.id)
9315             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9316             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9317             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9318         ]]></oils_persist:source_definition>
9319                 <fields oils_persist:primary="id">
9320                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9321                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9322                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9323                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9324                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9325                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9326                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9327                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9328                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9329                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9330                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9331                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9332                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9333                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9334                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9335                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9336                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9337                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9338                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9339                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9340                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9341                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9342                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9343                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9344                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9345                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9346                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9347                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9348                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9349                 </fields>
9350                 <links>
9351                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9352                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9353                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9354                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9355                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9356                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9357                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9358                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9359                 </links>
9360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9361             <actions>
9362                 <retrieve permission="user_request.view">
9363                     <context link="usr" field="home_ou"/>
9364                                 </retrieve>
9365             </actions>
9366         </permacrud>
9367         </class>
9368
9369         <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">
9370                 <fields oils_persist:primary="id">
9371                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9372                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9373                 </fields>
9374                 <links/>
9375         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9376             <actions>
9377                 <retrieve/>
9378             </actions>
9379         </permacrud>
9380         </class>
9381
9382         <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">
9383                 <fields oils_persist:primary="code">
9384                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9385                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9386                 </fields>
9387                 <links/>
9388         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9389             <actions>
9390                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9391                 <retrieve/>
9392                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9393                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9394             </actions>
9395         </permacrud>
9396         </class>
9397
9398         <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">
9399                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9400                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9401                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9402                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9403                         <field reporter:label="Ratio" name="ratio" />
9404                 </fields>
9405                 <links>
9406                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9407                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9408                 </links>
9409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9410                         <actions>
9411                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9412                                 <retrieve/>
9413                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9414                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9415                         </actions>
9416                 </permacrud>
9417         </class>
9418
9419         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9420                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9421                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9422                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9423                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9424                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9425                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9426                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9427                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9428                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9429                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9430                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9431                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9432                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9433                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9434                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9435                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9436                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9437                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9438                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9439                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9440                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9441                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9442                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9443                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9444                         <field reporter:label="Buyer SAN" name="buyer_san" reporter:datatype="text" />
9445                 </fields>
9446                 <links>
9447                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9449                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9450                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9451                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9452                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9453                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9454                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9455                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9456                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9457                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9458                 </links>
9459         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9460             <actions>
9461                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9462                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9463                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9464                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9465             </actions>
9466         </permacrud>
9467         </class>
9468
9469         <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">
9470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9471                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9472                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9473                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9474                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9475                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9476                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9477                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9478                 </fields>
9479                 <links>
9480                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9481                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9482                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9483                 </links>
9484         </class>
9485
9486         <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">
9487                 <fields oils_persist:primary="code">
9488                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9489                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9490                 </fields>
9491                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9492             <actions>
9493                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9494                 <retrieve/>
9495                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9496                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9497             </actions>
9498                 </permacrud>
9499         </class>
9500
9501         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9502                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9503                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9504                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9505                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9506                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9507                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9508                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9509                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9510                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9511                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9512                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9513                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9514                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9515                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9516                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9517                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9518                 </fields>
9519                 <links>
9520                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9521                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9522                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9523                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9524                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9525                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9526                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9527                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9528                 </links>
9529         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9530             <actions>
9531                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9532                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9533                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9534                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9535             </actions>
9536         </permacrud>
9537         </class>
9538
9539         <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">
9540                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9541                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9542                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9543                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9544                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9545                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9546                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9547                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9548                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9549                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9550                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9551                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9552                 </fields>
9553                 <links>
9554                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9555                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9556                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9557                 </links>
9558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9559             <actions>
9560                 <create   permission="ADMIN_INVOICE">
9561                                         <context link="invoice" field="receiver"/>
9562                                 </create>
9563                 <retrieve permission="ADMIN_INVOICE">
9564                                         <context link="invoice" field="receiver"/>
9565                                 </retrieve>
9566                 <update   permission="ADMIN_INVOICE">
9567                                         <context link="invoice" field="receiver"/>
9568                                 </update>
9569                                 <delete   permission="ADMIN_INVOICE">
9570                                         <context link="invoice" field="receiver"/>
9571                                 </delete>
9572             </actions>
9573         </permacrud>
9574         </class>
9575
9576         <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">
9577                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9578                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9579                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9580                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9581                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9582                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9583                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9584                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9585                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9586                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9587                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9588                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9589                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9590                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9591                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9592                 </fields>
9593                 <links>
9594                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9595                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9596                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9597                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9598                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9599                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9600                 </links>
9601         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9602             <actions>
9603                 <create   permission="ADMIN_INVOICE">
9604                                         <context link="invoice" field="receiver"/>
9605                                 </create>
9606                 <retrieve permission="ADMIN_INVOICE">
9607                                         <context link="invoice" field="receiver"/>
9608                                 </retrieve>
9609                 <update   permission="ADMIN_INVOICE">
9610                                         <context link="invoice" field="receiver"/>
9611                                 </update>
9612                                 <delete   permission="ADMIN_INVOICE">
9613                                         <context link="invoice" field="receiver"/>
9614                                 </delete>
9615             </actions>
9616         </permacrud>
9617         </class>
9618
9619         <class id="acqsn" 
9620                 controller="open-ils.cstore open-ils.pcrud" 
9621                 oils_obj:fieldmapper="acq::shipment_notification" 
9622                 oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9623                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9624                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9625                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9626                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9627                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9628                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp" />
9629                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9630                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp" />
9631                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link" />
9632                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" />
9633                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text" />
9634                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9635                         <field reporter:label="Shipment Notification Entries" name="entries" 
9636                                 reporter:datatype="link" oils_persist:virtual="true"/>
9637                 </fields>
9638                 <links>
9639                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9640                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9641                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9642                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9643                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9644                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9645                 </links>
9646                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9647                         <actions>
9648                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9649                                 <update   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9650                                 <delete   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9651                         </actions>
9652                 </permacrud>
9653         </class>
9654
9655         <class id="acqsne" 
9656                 controller="open-ils.cstore open-ils.pcrud" 
9657                 oils_obj:fieldmapper="acq::shipment_notification_entry" 
9658                 oils_persist:tablename="acq.shipment_notification_entry" 
9659                 reporter:label="Shipment Notification Entry">
9660                 <fields oils_persist:primary="id" 
9661                         oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9662                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9663                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" />
9664                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9665                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" />
9666                 </fields>
9667                 <links>
9668                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9669                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9670                 </links>
9671                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9672                                 <actions>
9673                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9674                                                 <context link="shipment_notification" field="receiver"/>
9675                                         </retrieve>
9676                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9677                                                 <context link="shipment_notification" field="receiver"/>
9678                                         </update>
9679                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9680                                                 <context link="shipment_notification" field="receiver"/>
9681                                         </delete>
9682                                 </actions>
9683                         </permacrud>
9684         </class>
9685
9686         <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">
9687                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9688                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9689                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9690                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9691                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9692                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9693                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9694                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9695                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9696                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9697                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9698                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9699                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9700                 </fields>
9701                 <links>
9702                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9703                 </links>
9704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9705             <actions>
9706                 <create permission="ADMIN_PROVIDER">
9707                     <context link="provider" field="owner"/>
9708                 </create>
9709                 <retrieve permission="ADMIN_PROVIDER">
9710                     <context link="provider" field="owner"/>
9711                 </retrieve>
9712                 <update permission="ADMIN_PROVIDER">
9713                     <context link="provider" field="owner"/>
9714                 </update>
9715                 <delete permission="ADMIN_PROVIDER">
9716                     <context link="provider" field="owner"/>
9717                 </delete>
9718             </actions>
9719         </permacrud>
9720         </class>
9721
9722         <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">
9723                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9724                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9725                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9726                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9727                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9728                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9729                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9730                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9731         </fields>
9732                 <links>
9733                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9734                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9735                 </links>
9736         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9737             <actions>
9738                 <create permission="ADMIN_PROVIDER">
9739                     <context link="provider" field="owner"/>
9740                 </create>
9741                 <retrieve permission="ADMIN_PROVIDER">
9742                     <context link="provider" field="owner"/>
9743                 </retrieve>
9744                 <update permission="ADMIN_PROVIDER">
9745                     <context link="provider" field="owner"/>
9746                 </update>
9747                 <delete permission="ADMIN_PROVIDER">
9748                     <context link="provider" field="owner"/>
9749                 </delete>
9750             </actions>
9751         </permacrud>
9752     </class>
9753         <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">
9754                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9755                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9756                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9757                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9758                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9759                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9760                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9761                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9762                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9763                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9764                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9765                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9766                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9767                 </fields>
9768                 <links>
9769                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9770                 </links>
9771         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9772             <actions>
9773                 <create permission="ADMIN_PROVIDER">
9774                     <context link="contact" jump='provider' field="owner"/>
9775                 </create>
9776                 <retrieve permission="ADMIN_PROVIDER">
9777                     <context link="contact" jump='provider' field="owner"/>
9778                 </retrieve>
9779                 <update permission="ADMIN_PROVIDER">
9780                     <context link="contact" jump='provider' field="owner"/>
9781                 </update>
9782                 <delete permission="ADMIN_PROVIDER">
9783                     <context link="contact" jump='provider' field="owner"/>
9784                 </delete>
9785             </actions>
9786         </permacrud>
9787         </class>
9788
9789         <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">
9790                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9791                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9792                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9793                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9794                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9795                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9796                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9797                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9798                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9799                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9800                 </fields>
9801                 <links>
9802                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9803                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9804                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9805                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9806                 </links>
9807         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9808             <actions>
9809                 <create permission="ADMIN_ACQ_FUND">
9810                     <context link="src_fund" field="org"/>
9811                 </create>
9812                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9813                     <context link="src_fund" field="org"/>
9814                     <context link="dest_fund" field="org"/>
9815                 </retrieve>
9816                 <update permission="ADMIN_ACQ_FUND">
9817                     <context link="src_fund" field="org"/>
9818                 </update>
9819                 <delete permission="ADMIN_ACQ_FUND">
9820                     <context link="src_fund" field="org"/>
9821                 </delete>
9822             </actions>
9823         </permacrud>
9824         </class>
9825
9826         <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">
9827                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9828                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name' oils_obj:required="true"/>
9829                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9830                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9831                 </fields>
9832                 <links>
9833             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9834                 </links>
9835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9836                         <actions>
9837                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9838                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9839                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9840                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9841                         </actions>
9842                 </permacrud>
9843         </class>
9844
9845         <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">
9846                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9847                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year' oils_obj:required="true"/>
9848                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link" oils_obj:required="true"/>
9849                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int" oils_obj:required="true"/>
9850                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp" oils_obj:required="true"/>
9851                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp" oils_obj:required="true"/>
9852                 </fields>
9853                 <links>
9854                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9855                 </links>
9856                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9857                         <actions>
9858                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9859                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9860                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9861                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9862                         </actions>
9863                 </permacrud>
9864         </class>
9865
9866         <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">
9867                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9868                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9869                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9870                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9871                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9872                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9873                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9874                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9875                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9876                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9877                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9878                 </fields>
9879                 <links>
9880                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9881                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9882             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9883             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9884                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9885                 </links>
9886         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9887             <actions>
9888                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9889                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9890                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9891                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9892             </actions>
9893         </permacrud>
9894         </class>
9895
9896         <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">
9897                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9898                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9899                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9900                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9901                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9902                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9903                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9904                 </fields>
9905                 <links>
9906                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9907                 </links>
9908                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9909                         <actions>
9910                                 <create permission="ADMIN_FUNDING_SOURCE">
9911                     <context link="funding_source" field="owner"/>
9912                 </create>
9913                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9914                     <context link="funding_source" field="owner"/>
9915                 </retrieve>
9916                                 <update permission="ADMIN_FUNDING_SOURCE">
9917                     <context link="funding_source" field="owner"/>
9918                 </update>
9919                                 <delete permission="ADMIN_FUNDING_SOURCE">
9920                     <context link="funding_source" field="owner"/>
9921                 </delete>
9922                         </actions>
9923                 </permacrud>
9924         </class>
9925
9926         <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">
9927                 <fields oils_persist:primary="id">
9928                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9929                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9930                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9931                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9932                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9933                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9934                 </fields>
9935                 <links>
9936                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9937                 </links>
9938         </class>
9939
9940         <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">
9941                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9942                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9943                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9944                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9945                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9946                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9947                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9948                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9949                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9950                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9951                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9952                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9953                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9954                 </fields>
9955                 <links>
9956                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9957                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9958                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9959                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9960                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9961                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9962                 </links>
9963                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9964                         <actions>
9965                                 <create permission="ADMIN_ACQ_FUND">
9966                     <context link="fund" field="org"/>
9967                 </create>
9968                                 <retrieve permission="ADMIN_ACQ_FUND">
9969                     <context link="fund" field="org"/>
9970                 </retrieve>
9971                                 <update permission="ADMIN_ACQ_FUND">
9972                     <context link="fund" field="org"/>
9973                 </update>
9974                                 <delete permission="ADMIN_ACQ_FUND">
9975                     <context link="fund" field="org"/>
9976                 </delete>
9977                         </actions>
9978                 </permacrud>
9979         </class>
9980
9981         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9982                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9983                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9984                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9985                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9986                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9987                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9988                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9989                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9990                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9991                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9992                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9993                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9994                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9995                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9996                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9997                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9998                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9999                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
10000                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
10001                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
10002                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
10003                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
10004                 </fields>
10005                 <links>
10006                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10007                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10008             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
10009             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
10010             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
10011             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
10012             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
10013             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
10014             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
10015             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
10016             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
10017                 </links>
10018         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
10019             <actions>
10020                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
10021                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10022                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
10023                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
10024             </actions>
10025         </permacrud>
10026         </class>
10027
10028         <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">
10029                 <fields oils_persist:primary="fund">
10030                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10031                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10032                 </fields>
10033                 <links>
10034                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10035                 </links>
10036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10037             <actions>
10038                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10039                                         <context link="fund" field="org" />
10040                 </retrieve>
10041             </actions>
10042         </permacrud>
10043         </class>
10044
10045         <class id="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">
10046                 <fields oils_persist:primary="fund">
10047                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10048                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
10049                 </fields>
10050                 <links>
10051                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10052                 </links>
10053         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10054             <actions>
10055                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10056                                         <context link="fund" field="org" />
10057                 </retrieve>
10058             </actions>
10059         </permacrud>
10060         </class>
10061
10062         <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">
10063                 <fields oils_persist:primary="fund">
10064                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10065                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
10066                 </fields>
10067                 <links>
10068                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10069                 </links>
10070         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10071             <actions>
10072                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10073                                         <context link="fund" field="org" />
10074                 </retrieve>
10075             </actions>
10076         </permacrud>
10077         </class>
10078
10079         <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">
10080                 <fields oils_persist:primary="fund">
10081                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10082                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10083                 </fields>
10084                 <links>
10085                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10086                 </links>
10087         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10088             <actions>
10089                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10090                                         <context link="fund" field="org" />
10091                 </retrieve>
10092             </actions>
10093         </permacrud>
10094         </class>
10095
10096         <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">
10097                 <fields oils_persist:primary="fund">
10098                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10099                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
10100                 </fields>
10101                 <links>
10102                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10103                 </links>
10104         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10105             <actions>
10106                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10107                                         <context link="fund" field="org" />
10108                 </retrieve>
10109             </actions>
10110         </permacrud>
10111         </class>
10112
10113    <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">
10114         <fields oils_persist:primary="fund">
10115             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10116             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10117         </fields>
10118         <links>
10119             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10120         </links>
10121     </class>
10122
10123    <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">
10124         <fields oils_persist:primary="fund">
10125             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10126             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
10127         </fields>
10128         <links>
10129             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10130         </links>
10131     </class>
10132
10133    <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">
10134         <fields oils_persist:primary="fund">
10135             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10136             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10137         </fields>
10138         <links>
10139             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10140         </links>
10141     </class>
10142
10143    <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">
10144         <fields oils_persist:primary="fund">
10145             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10146             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10147         </fields>
10148         <links>
10149             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10150         </links>
10151     </class>
10152
10153    <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">
10154         <fields oils_persist:primary="fund">
10155             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10156             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10157         </fields>
10158         <links>
10159             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10160         </links>
10161     </class>
10162
10163         <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">
10164                 <fields oils_persist:primary="funding_source">
10165                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10166                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10167                 </fields>
10168                 <links>
10169                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10170                 </links>
10171         </class>
10172
10173         <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">
10174                 <fields oils_persist:primary="funding_source">
10175                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10176                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10177                 </fields>
10178                 <links>
10179                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10180                 </links>
10181         </class>
10182
10183         <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">
10184                 <fields oils_persist:primary="funding_source">
10185                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10186                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10187                 </fields>
10188                 <links>
10189                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10190                 </links>
10191         </class>
10192
10193         <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">
10194                 <fields oils_persist:primary="fund">
10195                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10196                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10197                 </fields>
10198                 <links>
10199                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10200                 </links>
10201         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10202             <actions>
10203                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10204                                         <context link="fund" field="org" />
10205                 </retrieve>
10206             </actions>
10207         </permacrud>
10208     </class>
10209     <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">
10210         <oils_persist:source_definition><![CDATA[
10211             SELECT
10212                 acqf.*,
10213                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10214                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10215                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10216                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10217             FROM
10218                 acq.fund acqf
10219                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10220                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10221                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10222                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10223         ]]></oils_persist:source_definition>
10224         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10225             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10226             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10227             <field reporter:label="Name" name="name" reporter:datatype="text" />
10228             <field reporter:label="Year" name="year" reporter:datatype="int" />
10229             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10230             <field reporter:label="Code" name="code" reporter:datatype="text" />
10231             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10232             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10233             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10234             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10235             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10236
10237             <!-- non fund-native fields -->
10238             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10239             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10240             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10241             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10242         </fields>
10243         <links>
10244             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10245             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10246             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10247         </links>
10248         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10249             <actions>
10250                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10251             </actions>
10252         </permacrud>
10253         </class>
10254         <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">
10255                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10256                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10257                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10258                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10259                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10260                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10261                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10262                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10263                 </fields>
10264                 <links>
10265                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10266                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10267                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10268                 </links>
10269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10270                         <actions>
10271                                 <create permission="ADMIN_ACQ_FUND">
10272                     <context link="fund" field="org"/>
10273                 </create>
10274                                 <retrieve permission="ADMIN_ACQ_FUND">
10275                     <context link="fund" field="org"/>
10276                 </retrieve>
10277                                 <update permission="ADMIN_ACQ_FUND">
10278                     <context link="fund" field="org"/>
10279                 </update>
10280                                 <delete permission="ADMIN_ACQ_FUND">
10281                     <context link="fund" field="org"/>
10282                 </delete>
10283                         </actions>
10284                 </permacrud>
10285         </class>
10286
10287     <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">
10288         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10289             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10290             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10291             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10292             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10293             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10294             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10295             <field reporter:label="Note" name="note" reporter:datatype="text" />
10296             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10297         </fields>
10298         <links>
10299             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10300             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10301             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10302         </links>
10303                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10304                         <actions>
10305                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10306                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10307                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10308                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10309                         </actions>
10310                 </permacrud>
10311     </class>
10312
10313         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10314                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10315                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10316                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10317                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10318                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10319                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10320                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10321                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10322                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10323                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10324                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10325                 </fields>
10326                 <links>
10327                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10328                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10329                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10330                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10331                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10332                 </links>
10333                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10334                         <actions>
10335                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10336                         </actions>
10337                 </permacrud>
10338         </class>
10339
10340         <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">
10341                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10342                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10343                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10344                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10345                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10346                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10347                 </fields>
10348                 <links>
10349                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10350                 </links>
10351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10352                         <actions>
10353                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10354                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10355                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10356                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10357                         </actions>
10358                 </permacrud>
10359         </class>
10360
10361         <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">
10362                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10363                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10364                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10365                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10366                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10367                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10368                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10369                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10370                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10371                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10372                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10373                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10374                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10375                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10376                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10377                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10378                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10379                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10380                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10381                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10382                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10383                 </fields>
10384                 <links>
10385                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10386                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10387                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10388                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10389                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10390                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10391                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10392                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10393                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10394                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10395                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10396                 </links>
10397                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10398                         <actions>
10399                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10400                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10401                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10402                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10403                         </actions>
10404                 </permacrud>
10405         </class>
10406
10407         <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">
10408                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10409                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10410                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10411                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10412                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10413                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10414                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10415                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10416                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10417                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10418                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10419                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10420                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10421                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10422                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10423                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10424                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10425                 </fields>
10426                 <links>
10427                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10428                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10429                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10430                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10431                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10432                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10433                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10434                 </links>
10435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10436             <actions>
10437                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10438             </actions>
10439                 </permacrud>
10440         </class>
10441
10442         <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">
10443                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10444                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10445                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10446                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10447                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10448                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10449                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10450                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10451                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10452                 </fields>
10453                 <links>
10454                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10455                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10456                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10457                 </links>
10458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10459             <actions>
10460                 <create permission="CREATE_PURCHASE_ORDER">
10461                     <context link="purchase_order" field="ordering_agency"/>
10462                 </create>
10463                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10464                     <context link="purchase_order" field="ordering_agency"/>
10465                 </retrieve>
10466                 <update permission="CREATE_PURCHASE_ORDER">
10467                     <context link="purchase_order" field="ordering_agency"/>
10468                 </update>
10469                 <delete permission="CREATE_PURCHASE_ORDER">
10470                     <context link="purchase_order" field="ordering_agency"/>
10471                 </delete>
10472             </actions>
10473                 </permacrud>
10474         </class>
10475
10476         <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">
10477                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10478                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10479                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10480                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10481                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10482                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10483                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10484                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10485                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10486                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10487                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10488                 </fields>
10489                 <links>
10490                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10491                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10492                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10493                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10494                 </links>
10495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10496             <actions>
10497                 <create permission="CREATE_PURCHASE_ORDER">
10498                     <context link="purchase_order" field="ordering_agency"/>
10499                 </create>
10500                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10501                     <context link="purchase_order" field="ordering_agency"/>
10502                 </retrieve>
10503                 <update permission="CREATE_PURCHASE_ORDER">
10504                     <context link="purchase_order" field="ordering_agency"/>
10505                 </update>
10506                 <delete permission="CREATE_PURCHASE_ORDER">
10507                     <context link="purchase_order" field="ordering_agency"/>
10508                 </delete>
10509             </actions>
10510                 </permacrud>
10511         </class>
10512
10513         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10514                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10515                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10516                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10517                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10518                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10519                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10520                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10521                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10522                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10523                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10524                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10525                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10526                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10527                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10528                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10529                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10530                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10531                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10532                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10533                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10534                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10535                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10536                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10537                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10538                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10539                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10540                 </fields>
10541                 <links>
10542                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10543                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10544                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10545                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10546                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10547                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10548                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10549                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10550                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10551                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10552                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10553                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10554                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10555                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10556                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10557                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10558                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10559                 </links>
10560                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10561                         <actions>
10562                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10563                                         <context link="purchase_order" field="ordering_agency"/>
10564                                         <context link="picklist" field="org_unit"/>
10565                                 </retrieve>
10566                         </actions>
10567                 </permacrud>
10568         </class>
10569
10570         <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">
10571                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10572                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10573                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10574                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10575                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10576                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10577                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10578                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10579                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10580                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10581                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10582                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10583                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10584                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10585                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10586                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10587                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10588                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10589                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10590                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10591                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10592                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10593                 </fields>
10594                 <links>
10595                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10596                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10597                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10598                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10599                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10600                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10601                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10602                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10603                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10604                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10605                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10606                 </links>
10607                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10608                         <actions>
10609                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10610                                         <context link="purchase_order" field="ordering_agency"/>
10611                                         <context link="picklist" field="org_unit"/>
10612                                 </retrieve>
10613                         </actions>
10614                 </permacrud>
10615         </class>
10616
10617         <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">
10618                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10619                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10620                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10621                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10622                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10623                 </fields>
10624                 <links>
10625                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10626                 </links>
10627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10628                         <actions>
10629                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10630                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10631                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10632                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10633                         </actions>
10634                 </permacrud>
10635         </class>
10636
10637         <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">
10638                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10639                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10640                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10641                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10642                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10643                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10644                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10645                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10646                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10647                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10648                 </fields>
10649                 <links>
10650                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10651                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10652                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10653                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10654                 </links>
10655         </class>
10656
10657         <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">
10658                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10659                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10660                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10661                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10662                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10663                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10664                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10665                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10666                 </fields>
10667                 <links>
10668                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10669                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10670                 </links>
10671         </class>
10672
10673         <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">
10674                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10675                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10676                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10677                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10678                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10679                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10680                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10681                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10682                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10683                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10684                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10685                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10686                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10687                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10688                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10689                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10690                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10691                 </fields>
10692                 <links>
10693                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10694                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10695                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10696                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10697                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10698                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10699                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10700                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10701                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10702                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10703                 </links>
10704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10705             <actions>
10706                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10707                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10708                     <context link="lineitem" jump="picklist" field="org_unit"/>
10709                 </retrieve>
10710             </actions>
10711         </permacrud>
10712         </class>
10713
10714         <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">
10715                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10716                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10717                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10718                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10719                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10720                 </fields>
10721                 <links/>
10722                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10723                         <actions>
10724                                 <retrieve />
10725                         </actions>
10726                 </permacrud>
10727         </class>
10728
10729         <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">
10730                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10731                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10732                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10733                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10734                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10735                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10736             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10737                 </fields>
10738                 <links/>
10739         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10740             <actions>
10741                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10742                 <retrieve />
10743                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10744                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10745             </actions>
10746         </permacrud>
10747         </class>
10748
10749         <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">
10750                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10751                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10752                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10753                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10754                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10755                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10756                 </fields>
10757                 <links/>
10758         </class>
10759         <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">
10760                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10761                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10762                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10763                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10764                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10765                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10766                 </fields>
10767                 <links>
10768                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10769                 </links>
10770         </class>
10771
10772         <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">
10773             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10774                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10775                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10776                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10777                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10778                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10779                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10780         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10781
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="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">
10805             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10806                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10807                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10808                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10809                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10810             </fields>
10811             <links>
10812                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10813             </links>
10814             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10815                 <actions>
10816                     <create permission="ADMIN_PROVIDER">
10817                         <context link="provider" field="owner"/>
10818                     </create>
10819                     <retrieve permission="ADMIN_PROVIDER">
10820                         <context link="provider" field="owner"/>
10821                     </retrieve>
10822                     <update permission="ADMIN_PROVIDER">
10823                         <context link="provider" field="owner"/>
10824                     </update>
10825                     <delete permission="ADMIN_PROVIDER">
10826                         <context link="provider" field="owner"/>
10827                     </delete>
10828                 </actions>
10829             </permacrud>
10830         </class>
10831         
10832         <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">
10833             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10834                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10835                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10836                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10837                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10838                 </fields>
10839                 <links/>
10840         </class>
10841
10842         <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">
10843                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10844                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10845                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10846                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10847                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10848                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10849                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10850                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10851                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10852                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10853                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10854                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10855                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10856                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10857                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10858                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10859                 </fields>
10860                 <links>
10861                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10862                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10863                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10864                 </links>
10865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10866             <actions>
10867                 <create permission="ADMIN_PROVIDER">
10868                     <context link="provider" field="owner"/>
10869                 </create>
10870                 <retrieve permission="ADMIN_PROVIDER">
10871                     <context link="provider" field="owner"/>
10872                 </retrieve>
10873                 <update permission="ADMIN_PROVIDER">
10874                     <context link="provider" field="owner"/>
10875                 </update>
10876                 <delete permission="ADMIN_PROVIDER">
10877                     <context link="provider" field="owner"/>
10878                 </delete>
10879             </actions>
10880         </permacrud>
10881         </class>
10882
10883         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10884                 oils_obj:fieldmapper="acq::edi_attr" 
10885                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10886                 <fields oils_persist:primary="key">
10887                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10888                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10889                 </fields>
10890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10891             <actions>
10892                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10893                 <retrieve/>
10894                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10895                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10896             </actions>
10897         </permacrud>
10898         </class>
10899         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10900                 oils_obj:fieldmapper="acq::edi_attr_set" 
10901                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10902                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10903                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10904                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10905                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10906                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10907                 </fields>
10908                 <links>
10909                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10910                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10911                 </links>
10912         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10913             <actions>
10914                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10915                 <retrieve/>
10916                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10917                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10918             </actions>
10919         </permacrud>
10920         </class>
10921         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10922                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10923                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10924                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10925                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10926                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10927                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10928                 </fields>
10929                 <links>
10930                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10931                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10932                 </links>
10933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10934             <actions>
10935                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10936                 <retrieve/>
10937                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10938                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10939             </actions>
10940         </permacrud>
10941         </class>
10942
10943
10944         <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">
10945                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10946                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10947                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10948                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10949                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10950                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10951                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10952                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10953                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10954                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10955                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10956                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10957                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10958                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10959                 </fields>
10960                 <links>
10961                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10962                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10963                 </links>
10964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10965             <actions>
10966                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10967                     <context link="account" jump="provider" field="owner"/>
10968                 </retrieve>
10969                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10970                     <context link="account" jump="provider" field="owner"/>
10971                 </update>
10972                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10973                     <context link="account" jump="provider" field="owner"/>
10974                 </delete>
10975             </actions>
10976         </permacrud>
10977         </class>
10978
10979
10980         <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">
10981                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10982                         <field name="id" reporter:datatype="id" />
10983                         <field name="parent" reporter:datatype="link"/>
10984                         <field name="owner" reporter:datatype="link"/>
10985                         <field name="create_time" reporter:datatype="timestamp"/>
10986                         <field name="name" reporter:datatype="text"/>
10987                         <field name="shared" reporter:datatype="bool"/>
10988                         <field name="share_with" reporter:datatype="link"/>
10989                         <field name="simple_reporter" reporter:datatype="bool"/>
10990                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10991                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10992                 </fields>
10993                 <links>
10994                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10995                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10996                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10997                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10998                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10999                 </links>
11000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11001             <actions>
11002                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11003                     <context link="owner" field="home_ou"/>
11004                 </create>
11005                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11006                     <context link="owner" field="home_ou"/>
11007                 </retrieve>
11008                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11009                     <context link="owner" field="home_ou"/>
11010                 </update>
11011                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11012                     <context link="owner" field="home_ou"/>
11013                 </delete>
11014             </actions>
11015         </permacrud>
11016         </class>
11017         <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">
11018                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
11019                         <field name="id" reporter:datatype="id" />
11020                         <field name="parent" reporter:datatype="link"/>
11021                         <field name="owner" reporter:datatype="link"/>
11022                         <field name="create_time" reporter:datatype="timestamp"/>
11023                         <field name="name" reporter:datatype="text"/>
11024                         <field name="shared" reporter:datatype="bool"/>
11025                         <field name="share_with" reporter:datatype="link"/>
11026                         <field name="simple_reporter" reporter:datatype="bool"/>
11027                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
11028                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
11029                 </fields>
11030                 <links>
11031                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11032                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
11033                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
11034                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11035                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
11036                 </links>
11037         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11038             <actions>
11039                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11040                     <context link="owner" field="home_ou"/>
11041                 </create>
11042                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11043                     <context link="owner" field="home_ou"/>
11044                 </retrieve>
11045                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11046                     <context link="owner" field="home_ou"/>
11047                 </update>
11048                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11049                     <context link="owner" field="home_ou"/>
11050                 </delete>
11051             </actions>
11052         </permacrud>
11053         </class>
11054         <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">
11055                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
11056                         <field name="id" reporter:datatype="id" />
11057                         <field name="parent" reporter:datatype="link"/>
11058                         <field name="owner" reporter:datatype="link"/>
11059                         <field name="create_time" reporter:datatype="timestamp"/>
11060                         <field name="name" reporter:datatype="text"/>
11061                         <field name="shared" reporter:datatype="bool"/>
11062                         <field name="share_with" reporter:datatype="link"/>
11063                         <field name="simple_reporter" reporter:datatype="bool"/>
11064                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
11065                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11066                 </fields>
11067                 <links>
11068                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11069                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
11070                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
11071                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11072                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
11073                 </links>
11074         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11075             <actions>
11076                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11077                     <context link="owner" field="home_ou"/>
11078                 </create>
11079                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11080                     <context link="owner" field="home_ou"/>
11081                 </retrieve>
11082                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11083                     <context link="owner" field="home_ou"/>
11084                 </update>
11085                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11086                     <context link="owner" field="home_ou"/>
11087                 </delete>
11088             </actions>
11089         </permacrud>
11090         </class>
11091         <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">
11092                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
11093                         <field name="id" reporter:datatype="id" />
11094                         <field name="owner" reporter:datatype="link"/>
11095                         <field name="create_time" reporter:datatype="timestamp"/>
11096                         <field name="name" reporter:datatype="text"/>
11097                         <field name="data" reporter:datatype="text"/>
11098                         <field name="folder" reporter:datatype="link"/>
11099                         <field name="description" reporter:datatype="text"/>
11100                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11101                 </fields>
11102                 <links>
11103                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11104                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
11105                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
11106                 </links>
11107         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11108             <actions>
11109                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11110                     <context link="owner" field="home_ou"/>
11111                 </create>
11112                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11113                     <context link="owner" field="home_ou"/>
11114                 </retrieve>
11115                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11116                     <context link="owner" field="home_ou"/>
11117                 </update>
11118                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11119                     <context link="owner" field="home_ou"/>
11120                 </delete>
11121             </actions>
11122         </permacrud>
11123         </class>
11124         <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">
11125                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11126                         <field name="id" reporter:datatype="id" />
11127                         <field name="owner" reporter:datatype="link"/>
11128                         <field name="create_time" reporter:datatype="timestamp"/>
11129                         <field name="template" reporter:datatype="link"/>
11130                         <field name="data" reporter:datatype="text"/>
11131                         <field name="folder" reporter:datatype="link"/>
11132                         <field name="recur" reporter:datatype="bool"/>
11133                         <field name="recurrence" reporter:datatype="interval"/>
11134                         <field name="name" reporter:datatype="text"/>
11135                         <field name="description" reporter:datatype="text"/>
11136                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11137                 </fields>
11138                 <links>
11139                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11140                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11141                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11142                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
11143                 </links>
11144         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11145             <actions>
11146                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11147                     <context link="owner" field="home_ou"/>
11148                 </create>
11149                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11150                     <context link="owner" field="home_ou"/>
11151                 </retrieve>
11152                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11153                     <context link="owner" field="home_ou"/>
11154                 </update>
11155                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11156                     <context link="owner" field="home_ou"/>
11157                 </delete>
11158             </actions>
11159         </permacrud>
11160         </class>
11161         <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">
11162                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11163                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11164                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11165                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11166                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11167                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11168                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11169                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11170                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11171                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11172                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11173                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11174                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11175                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11176                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11177                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11178                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11179                 </fields>
11180                 <links>
11181                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11182                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11183                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11184                 </links>
11185         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11186             <actions>
11187                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11188                     <context link="runner" field="home_ou"/>
11189                 </create>
11190                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11191                     <context link="runner" field="home_ou"/>
11192                 </retrieve>
11193                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11194                     <context link="runner" field="home_ou"/>
11195                 </update>
11196                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11197                     <context link="runner" field="home_ou"/>
11198                 </delete>
11199             </actions>
11200         </permacrud>
11201         </class>
11202     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11203            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11204            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11205                 <fields oils_persist:primary="run">
11206             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11207             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11208             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11209             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11210             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11211             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11212             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11213             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11214             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11215             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11216             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11217             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11218             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11219             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11220             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11221             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11222                 </fields>
11223                 <links>
11224             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11225             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11226             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11227             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11228             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11229             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11230             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11231             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11232             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11233                 </links>
11234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11235             <actions>
11236                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11237                     <context link="runner" field="home_ou"/>
11238                 </retrieve>
11239             </actions>
11240         </permacrud>
11241     </class>
11242         <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">
11243                 <fields oils_persist:primary="id">
11244                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11245                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11246                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11247                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11248                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11249                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11250                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11251                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11252                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11253                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11254                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11255                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11256                 </fields>
11257                 <links>
11258                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11259                 </links>
11260                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11261                         <actions>
11262                                 <retrieve />
11263                         </actions>
11264                 </permacrud>
11265         </class>
11266         <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">
11267                 <fields oils_persist:primary="id">
11268                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11269                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11270                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11271                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11272                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11273                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11274                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11275                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11276                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11277                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11278                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11279                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11280                 </fields>
11281                 <links>
11282                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11283                 </links>
11284         </class>
11285         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11286                 <fields oils_persist:primary="id">
11287                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11288                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11289                         <field reporter:label="Fingerprint" name="fingerprint" />
11290                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11291                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11292                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11293                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11294                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11295                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11296                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11297                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11298                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11299                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11300                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11301                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11302                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11303                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11304                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11305                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11306                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11307                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11308                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11309                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11310                 </fields>
11311                 <links>
11312                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11313                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11314                 </links>
11315         </class>
11316         <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">
11317                 <fields oils_persist:primary="id">
11318                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11319                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11320                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11321                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11322                 </fields>
11323                 <links>
11324                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11325                 </links>
11326         </class>
11327         <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">
11328                 <fields oils_persist:primary="id">
11329                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11330                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11331                 </fields>
11332                 <links>
11333                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11334                 </links>
11335         </class>
11336         <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">
11337                 <fields oils_persist:primary="id">
11338                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11339                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11340                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11341                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11342                 </fields>
11343                 <links>
11344                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11345                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11346                 </links>
11347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11348                         <actions>
11349                                 <retrieve permission="VIEW_HOLD">
11350                                         <context link="id" field="pickup_lib"/>
11351                                 </retrieve>
11352                         </actions>
11353                 </permacrud>
11354         </class>
11355         <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">
11356                 <fields oils_persist:primary="xact">
11357                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11358                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11359                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11360                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11361                 </fields>
11362                 <links>
11363                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11364                 </links>
11365         </class>
11366         <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">
11367                 <fields oils_persist:primary="xact">
11368                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11369                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11370                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11371                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11372                 </fields>
11373                 <links>
11374                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11375                 </links>
11376         </class>
11377         <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)">
11378                 <fields oils_persist:primary="id">
11379                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11380                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11381                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11382                 </fields>
11383                 <links>
11384                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11385                 </links>
11386         </class>
11387         <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">
11388                 <fields oils_persist:primary="id">
11389                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11390                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11391                 </fields>
11392                 <links>
11393                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11394                 </links>
11395                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11396                         <actions>
11397                                 <retrieve permission="STAFF_LOGIN">
11398                                         <context link="id" field="circ_lib"/>
11399                                 </retrieve>
11400                         </actions>
11401                 </permacrud>
11402         </class>
11403         <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">
11404                 <fields oils_persist:primary="bibid">
11405                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11406                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11407                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11408                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11409                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11410                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11411                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11412                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11413                 </fields>
11414                 <links>
11415                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11416                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11417                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11418                 </links>
11419         </class>
11420         <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">
11421                 <fields oils_persist:primary="copy_id">
11422                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11423                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11424                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11425                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11426                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11427                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11428                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11429                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11430                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11431                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11432                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11433                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11434                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11435                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11436                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11437                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11438                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11439                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11440                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11441                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11442                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11443                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11444                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11445                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11446                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11447                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11448                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11449                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11450                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11451                 </fields>
11452                 <links>
11453                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11454                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11455                 </links>
11456         </class>
11457         <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">
11458                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11459                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11460                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11461                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11462                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11463                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11464                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11465                 </fields>
11466                 <links>
11467                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11468                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11469                 </links>
11470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11471                         <actions>
11472                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11473                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11474                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11475                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11476                         </actions>
11477                 </permacrud>
11478         </class>
11479         <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">
11480                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11481                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11482                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11483                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11484                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11485                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11486                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11487                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11488                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11489                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11490                 </fields>
11491                 <links>
11492                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11493                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11494                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11495                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11496                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11497                 </links>
11498                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11499                         <actions>
11500                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11501                                         <context link="formula" field="owner"/>
11502                                 </create>
11503                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11504                                         <context link="formula" field="owner"/>
11505                                 </retrieve>
11506                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11507                                         <context link="formula" field="owner"/>
11508                                 </update>
11509                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11510                                         <context link="formula" field="owner"/>
11511                                 </delete>
11512                         </actions>
11513                 </permacrud>
11514         </class>
11515
11516         <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">
11517                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11518                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11519                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11520                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11521                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11522                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11523                 </fields>
11524                 <links>
11525                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11526                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11527                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11528                 </links>
11529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11530                         <actions>
11531                                 <create permission="CREATE_PURCHASE_ORDER">
11532                                         <context link="formula" field="owner"/>
11533                 </create>
11534                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11535                                         <context link="formula" field="owner"/>
11536                 </retrieve>
11537                                 <update permission="CREATE_PURCHASE_ORDER">
11538                                         <context link="formula" field="owner"/>
11539                 </update>
11540                                 <delete permission="CREATE_PURCHASE_ORDER">
11541                                         <context link="formula" field="owner"/>
11542                 </delete>
11543                         </actions>
11544                 </permacrud>
11545         </class>
11546
11547         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11548                 <fields oils_persist:primary="id">
11549                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11550                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11551                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11552                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11553                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11554                 </fields>
11555                 <links>
11556                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11557                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11558                 </links>
11559         </class>
11560
11561         <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">
11562                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11563                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11564                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11565                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11566                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11567                 </fields>
11568                 <links>
11569                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11570                 </links>
11571                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11572                         <actions>
11573                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11574                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11575                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11576                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11577                         </actions>
11578                 </permacrud>
11579         </class>
11580
11581         <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">
11582                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11583                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11584                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11585                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11586                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11587                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11588                 </fields>
11589                 <links>
11590                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11591                 </links>
11592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11593                         <actions>
11594                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11595                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11596                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11597                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11598                         </actions>
11599                 </permacrud>
11600         </class>
11601
11602         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11603                 <fields oils_persist:primary="id" oils_persist:sequence="acq.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="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11607                 </fields>
11608                 <links>
11609                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11610                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11611                 </links>
11612         </class>
11613
11614         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11615                 <fields oils_persist:primary="id" oils_persist:sequence="acq.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="acqcl"/>
11626                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11627                 </links>
11628         </class>
11629
11630         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11631                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11632                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11633                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11634                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11635                 </fields>
11636                 <links>
11637                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11638                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11639                 </links>
11640         </class>
11641
11642         <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">
11643                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11644                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11645                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11646                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11647                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11648                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11649                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11650                 </fields>
11651                 <links>
11652                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11653                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11654                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11655                 </links>
11656         </class>
11657
11658         <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">
11659                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11660                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11661                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11662                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11663                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11664                 </fields>
11665                 <links>
11666                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11667                 </links>
11668                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11669             <actions>
11670                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11671                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11672                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11673                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11674             </actions>
11675                 </permacrud>
11676         </class>
11677
11678         <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">
11679                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11680                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11681                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11682                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11683                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11684                 </fields>
11685                 <links>
11686                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11687                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11688                 </links>
11689                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11690                         <actions>
11691                                 <create permission="ADMIN_CLAIM_POLICY">
11692                                         <context link="claim_policy" field="org_unit"/>
11693                 </create>
11694                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11695                                         <context link="claim_policy" field="org_unit"/>
11696                 </retrieve>
11697                                 <update permission="ADMIN_CLAIM_POLICY">
11698                                         <context link="claim_policy" field="org_unit"/>
11699                 </update>
11700                                 <delete permission="ADMIN_CLAIM_POLICY">
11701                                         <context link="claim_policy" field="org_unit"/>
11702                 </delete>
11703                         </actions>
11704                 </permacrud>
11705         </class>
11706
11707     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11708         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11709             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11710             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11711             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11712             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11713             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11714             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11715             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11716             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11717             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11718             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11719             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11720             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11721             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11722             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11723             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11724             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11725                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11726                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11727                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11728         </fields>
11729         <links>
11730             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11731             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11732         </links>
11733     </class>
11734
11735     <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">
11736         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11737             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11738             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11739             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11740             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11741             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11742         </fields>
11743     </class>
11744
11745     <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">
11746         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11747             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11748             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11749             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11750             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11751             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11752             <field reporter:label="City" name="city" reporter:datatype="text"/>
11753             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11754             <field reporter:label="State" name="state" reporter:datatype="text"/>
11755             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11756             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11757             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11758         </fields>
11759     </class>
11760
11761     <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">
11762         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11763             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11764             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11765             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11766             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11767             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11768             <field reporter:label="City" name="city" reporter:datatype="text"/>
11769             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11770             <field reporter:label="State" name="state" reporter:datatype="text"/>
11771             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11772             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11773             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11774         </fields>
11775     </class>
11776
11777     <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">
11778         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11779             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11780             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11781             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11782             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11783             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11784             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11785         </fields>
11786     </class>
11787
11788     <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">
11789         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11790             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11791             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11792             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11793             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11794             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11795             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11796         </fields>
11797     </class>
11798
11799         <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">
11800                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11801                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11802                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11803                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11804                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11805                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11806                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11807                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11808                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11809                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11810                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11811                 </fields>
11812                 <links>
11813                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11814                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11815                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11816                 </links>
11817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11818                         <actions>
11819                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11820                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11821                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11822                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11823                         </actions>
11824                 </permacrud>
11825         </class>
11826
11827         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11828                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11829                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11830                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11831                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11832                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11833                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11834                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11835                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11836                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11837                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11838                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11839                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11840                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11841                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11842                 </fields>
11843                 <links>
11844                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11845                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11846                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11847                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11848                 </links>
11849                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11850                         <actions>
11851                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11852                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11853                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11854                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11855                         </actions>
11856                 </permacrud>
11857         </class>
11858
11859         <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">
11860                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11861                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11862                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11863                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11864                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11865                 </fields>
11866                 <links>
11867                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11868                 </links>
11869                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11870                         <actions>
11871                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11872                     <context link="fieldset" field="owning_lib"/>
11873                 </create>
11874                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11875                     <context link="fieldset" field="owning_lib"/>
11876                 </retrieve>
11877                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11878                     <context link="fieldset" field="owning_lib"/>
11879                 </update>
11880                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11881                     <context link="fieldset" field="owning_lib"/>
11882                 </delete>
11883                         </actions>
11884                 </permacrud>
11885         </class>
11886
11887     <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">
11888         <fields>
11889             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11890             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11891             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11892         </fields>
11893                 <links>
11894                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11895                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11896                 </links>
11897     </class>
11898
11899     <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">
11900         <fields>
11901             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11902             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11903         </fields>
11904                 <links>
11905                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11906                 </links>
11907     </class>
11908
11909     <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">
11910         <fields>
11911             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11912             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11913             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11914         </fields>
11915                 <links>
11916                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11917                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11918                 </links>
11919     </class>
11920
11921     <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">
11922         <fields>
11923             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11924             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11925         </fields>
11926                 <links>
11927                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11928                 </links>
11929     </class>
11930
11931     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11932                 <oils_persist:source_definition><![CDATA[
11933
11934             SELECT  DISTINCT l.*
11935               FROM  action.unfulfilled_hold_loops l
11936                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11937               WHERE l.count = m.max
11938
11939                 ]]></oils_persist:source_definition>
11940         <fields>
11941             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11942             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11943             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11944         </fields>
11945                 <links>
11946                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11947                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11948                 </links>
11949     </class>
11950
11951         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11952                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11953                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11954                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11955                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11956                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11957                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11958                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11959                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11960                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11961                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11962                 </fields>
11963                 <links>
11964                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11965                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11966                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11967                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11968                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11969                 </links>
11970         </class>
11971
11972         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11973                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11974                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11975                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11976                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11977                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11978                 </fields>
11979                 <links>
11980                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11981                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11982                 </links>
11983         </class>
11984
11985         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11986                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11987                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11988                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11989                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11990                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11991                 </fields>
11992                 <links>
11993                 </links>
11994         </class>
11995
11996         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11997                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11998                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11999                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
12000                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12001                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
12002                 </fields>
12003                 <links>
12004                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
12005                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
12006                 </links>
12007         </class>
12008         
12009         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
12010                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
12011                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
12012                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
12013                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
12014                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
12015                 </fields>
12016                 <links>
12017                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
12018                 </links>
12019         </class>
12020         
12021         <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">
12022                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
12023                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
12024                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12025                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12026                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
12027                 </fields>
12028                 <links>
12029                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12030                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
12031                 </links>
12032         </class>
12033
12034         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
12035                 <fields oils_persist:primary="name">
12036                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
12037                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
12038                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
12039                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12040                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
12041                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
12042                 </fields>
12043                 <links>
12044                 </links>
12045         </class>
12046
12047         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
12048                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12049                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12050                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
12051                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
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="Literal" name="literal" reporter:datatype="text"/>
12055                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12056                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12057                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12058                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12059                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12060                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12061                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12062                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12063                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12064                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12065                 </fields>
12066                 <links>
12067                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12068                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12069                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12070                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12071                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12072                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12073                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12074                 </links>
12075         </class>
12076
12077         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
12078                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
12079                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
12080                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12081                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12082                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
12083                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
12084                 </fields>
12085                 <links>
12086                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12087                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
12088                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
12089                 </links>
12090         </class>
12091
12092         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
12093                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
12094                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
12095                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
12096                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
12097                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
12098                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
12099                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
12100                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12101                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
12102                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12103                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
12104                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
12105                 </fields>
12106                 <links>
12107                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12108                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
12109                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
12110                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
12111                 </links>
12112         </class>
12113
12114         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12115                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12116                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12117                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
12118                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12119                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12120                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
12121                 </fields>
12122                 <links>
12123                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12124                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12125                 </links>
12126         </class>
12127
12128         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12129                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12130                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12131                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12132                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12133                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12134                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12135                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12136                 </fields>
12137                 <links>
12138                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12139                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12140                 </links>
12141         </class>
12142
12143         <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">
12144                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12145                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12146                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12147                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12148                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12149                 </fields>
12150                 <links>
12151                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12152                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12153                 </links>
12154         </class>
12155
12156         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12157                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12158                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12159                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12160                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12161                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12162                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12163                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12164                 </fields>
12165                 <links>
12166                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12167                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12168                 </links>
12169         </class>
12170
12171         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable 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="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12178                 </fields>
12179                 <links>
12180                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12181                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12182                 </links>
12183         </class>
12184
12185         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12186                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12187                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12188                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12189                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12190                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12191                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12192                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12193                 </fields>
12194                 <links>
12195                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12196                 </links>
12197         </class>
12198
12199         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12200                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12201                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12202                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12203                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12204                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12205                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12206                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12207                 </fields>
12208                 <links>
12209                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12210                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12211                 </links>
12212         </class>
12213
12214         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12215                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12216                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12217                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12218                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12219                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12220                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12221                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12222                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12223                 </fields>
12224                 <links>
12225                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12226                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12227                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12228                 </links>
12229         </class>
12230
12231         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12232                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12233                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12234                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12235                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12236                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12237                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12238                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12239                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12240                 </fields>
12241                 <links>
12242                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12243                 </links>
12244         </class>
12245
12246         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12247                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12248                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12249                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12250                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12251                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12252                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12253                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12254                 </fields>
12255                 <links>
12256                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12257                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12258                 </links>
12259         </class>
12260
12261         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12262                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12263                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12264                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12265                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12266                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12267                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12268                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12269                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12270                 </fields>
12271                 <links>
12272                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12273                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12274                 </links>
12275         </class>
12276
12277         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12278                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12279                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12280                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12281                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12282                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12283                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12284                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12285                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12286                 </fields>
12287                 <links>
12288                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12289                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12290                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12291                 </links>
12292         </class>
12293
12294         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL 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="Left Operand" name="left_operand" reporter:datatype="link"/>
12301                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12302                 </fields>
12303                 <links>
12304                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12305                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12306                 </links>
12307         </class>
12308
12309         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12310                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12311                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12312                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12313                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12314                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12315                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12316                 </fields>
12317                 <links>
12318                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12319                 </links>
12320         </class>
12321
12322         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12323                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12324                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12325                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12326                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12327                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12328                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12329                 </fields>
12330                 <links>
12331                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12332                 </links>
12333         </class>
12334
12335         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12336                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12337                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12338                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12339                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12340                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12341                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12342                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12343                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12344                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12345                 </fields>
12346                 <links>
12347                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12348                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12349                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12350                 </links>
12351         </class>
12352
12353         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12354                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12355                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12356                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12357                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12358                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12359                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12360                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12361                 </fields>
12362                 <links>
12363                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12364                 </links>
12365         </class>
12366
12367         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12368                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12369                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12370                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12371                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12372                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12373                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12374                 </fields>
12375                 <links>
12376                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12377                 </links>
12378         </class>
12379
12380         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12381                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12382                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12383                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12384                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12385                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12386                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12387                 </fields>
12388                 <links>
12389                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12390                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12391                 </links>
12392         </class>
12393
12394         <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">
12395                 <fields oils_persist:primary="id">
12396                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12397                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12398                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12399                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12400                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12401                 </fields>
12402                 <links>
12403                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12404                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12405                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12406                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12407                 </links>
12408         </class>
12409
12410         <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">
12411                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12412                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12413                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12414                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12415                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12416                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12417                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12418                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12419                 </fields>
12420                 <links/>
12421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12422                         <actions>
12423                                 <retrieve/>
12424                         </actions>
12425                 </permacrud>
12426         </class>
12427
12428         <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">
12429                 <fields oils_persist:primary="ptype_key">
12430                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12431                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12432                 </fields>
12433                 <links/>
12434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12435                         <actions>
12436                                 <retrieve/>
12437                         </actions>
12438                 </permacrud>
12439         </class>
12440
12441         <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">
12442                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12443                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12444                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12445                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12446                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12447                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12448                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12449                 </fields>
12450                 <links>
12451                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12452                 </links>
12453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12454                         <actions>
12455                                 <retrieve/>
12456                         </actions>
12457                 </permacrud>
12458         </class>
12459
12460         <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">
12461                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12462                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12463                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12464                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12465                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12466                 </fields>
12467                 <links>
12468                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12469                 </links>
12470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12471                         <actions>
12472                                 <retrieve/>
12473                         </actions>
12474                 </permacrud>
12475         </class>
12476
12477         <!-- This is what you see in Catalog -> Link Checker -->
12478         <class id="uvsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::sessions_and_attempts" reporter:label="Combined URL Verify Sessions and Batches View" oils_persist:readonly="true">
12479                 <oils_persist:source_definition><![CDATA[
12480                         SELECT
12481                 coalesce(uvva.id,-uvs.id) as id,
12482                 uvs.id as session_id,
12483                 uvs.name,
12484                 uvs.owning_lib,
12485                 uvs.creator,
12486                 uvs.container,
12487                 uvs.create_time,
12488                 uvs.search,
12489                 (select string_agg(xpath,',')
12490                  from url_verify.url_selector uvus
12491                  where uvus.session = uvs.id
12492                  group by session) as selectors,
12493                 uvva.id as batch_id,
12494                 uvva.usr,
12495                 uvva.start_time,
12496                 uvva.finish_time
12497             FROM
12498                 url_verify.session uvs
12499             LEFT JOIN
12500                 url_verify.verification_attempt uvva
12501             ON
12502                 (uvs.id = uvva.session)
12503                 ]]></oils_persist:source_definition>
12504                 <fields oils_persist:primary="id">
12505             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12506             <field reporter:label="Session ID" name="session_id" reporter:datatype="link"/>
12507             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12508                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12509             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12510             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12511             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12512             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12513             <field reporter:label="Selectors" name="selectors" reporter:datatype="text" oils_obj:required="true"/>
12514             <field reporter:label="Batch ID" name="batch_id" reporter:datatype="link"/>
12515                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12516             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12517             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12518                 </fields>
12519                 <links>
12520             <link field="session_id" reltype="has_a" key="id" map="" class="uvs"/>
12521             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12522             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12523             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12524             <link field="batch_id" reltype="has_a" key="id" map="" class="uvva"/>
12525             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12526                 </links>
12527         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12528             <actions>
12529                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12530             </actions>
12531         </permacrud>
12532         </class>
12533
12534         <!-- This is what gets created with Catalog -> Link Checker -> New Session -->
12535     <class
12536         id="uvs"
12537         controller="open-ils.cstore open-ils.pcrud"
12538         oils_obj:fieldmapper="url_verify::session"
12539         oils_persist:tablename="url_verify.session"
12540         reporter:label="URL Verification Session"
12541     >
12542         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12543             <field reporter:label="Session ID" name="id" reporter:datatype="id" reporter:selector="name"/>
12544             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12545                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12546             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12547             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12548             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12549             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12550             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12551             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12552         </fields>
12553
12554         <links>
12555             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12556             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12557             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12558             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12559             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12560         </links>
12561
12562         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12563             <actions>
12564                 <create permission="URL_VERIFY" context_field="owning_lib"/>
12565                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12566                 <update permission="URL_VERIFY" context_field="owning_lib"/>
12567                 <delete permission="URL_VERIFY" context_field="owning_lib"/>
12568             </actions>
12569         </permacrud>
12570
12571     </class>
12572
12573         <!-- A biblio bucket gets populated with search results from Catalog -> Link Checker -> New Session -->
12574     <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">
12575         <oils_persist:source_definition><![CDATA[
12576             SELECT
12577                 cbrebi.id AS id,  -- so we can have a pkey in our view
12578                 uvs.id AS session,
12579                 uvs.owning_lib,
12580                 cbrebi.target_biblio_record_entry
12581             FROM url_verify.session uvs
12582             JOIN container.biblio_record_entry_bucket cbreb
12583                 ON (uvs.container = cbreb.id)
12584             JOIN container.biblio_record_entry_bucket_item cbrebi
12585                 ON (cbrebi.bucket = cbreb.id)
12586         ]]></oils_persist:source_definition>
12587         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12588             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12589             <field reporter:label="Session" name="session" reporter:datatype="link" />
12590             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12591             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12592         </fields>
12593         <links>
12594             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12595             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12596             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12597         </links>
12598         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12599             <actions>
12600                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12601             </actions>
12602         </permacrud>
12603     </class>
12604
12605         <!-- Also created with Catalog -> Link Checker -> New Session -->
12606     <class
12607         id="uvus"
12608         controller="open-ils.cstore open-ils.pcrud"
12609         oils_obj:fieldmapper="url_verify::url_selector"
12610         oils_persist:tablename="url_verify.url_selector"
12611         reporter:label="URL Verification URL Selector"
12612     >
12613         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12614             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id" reporter:selector="xpath"/>
12615             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12616                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12617             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12618         </fields>
12619
12620         <links>
12621             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12622             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12623         </links>
12624
12625         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12626             <actions>
12627                 <create permission="URL_VERIFY">
12628                     <context link="session" field="owning_lib"/>
12629                 </create>
12630                 <retrieve permission="URL_VERIFY">
12631                     <context link="session" field="owning_lib"/>
12632                 </retrieve>
12633                 <update permission="URL_VERIFY">
12634                     <context link="session" field="owning_lib"/>
12635                 </update>
12636                 <delete permission="URL_VERIFY">
12637                     <context link="session" field="owning_lib"/>
12638                 </delete>
12639             </actions>
12640         </permacrud>
12641
12642     </class>
12643
12644         <!-- URLs extracted by URL selectors -->
12645     <class
12646         id="uvu"
12647         controller="open-ils.cstore open-ils.pcrud"
12648         oils_obj:fieldmapper="url_verify::url"
12649         oils_persist:tablename="url_verify.url"
12650         reporter:label="URL Verification URL"
12651     >
12652         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12653             <field reporter:label="URL ID" name="id" reporter:datatype="id" reporter:selector="full_url"/>
12654                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12655                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12656                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12657                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12658             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12659             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12660             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12661             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12662             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12663             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12664             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12665             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12666             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12667             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12668             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12669             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12670             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12671         </fields>
12672
12673         <links>
12674             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12675             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12676             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12677             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12678             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12679         </links>
12680
12681         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12682             <actions>
12683                 <create permission="URL_VERIFY">
12684                     <context link="session" field="owning_lib"/>
12685                 </create>
12686                 <retrieve permission="URL_VERIFY">
12687                     <context link="session" field="owning_lib"/>
12688                 </retrieve>
12689                 <update permission="URL_VERIFY">
12690                     <context link="session" field="owning_lib"/>
12691                 </update>
12692                 <delete permission="URL_VERIFY">
12693                     <context link="session" field="owning_lib"/>
12694                 </delete>
12695             </actions>
12696         </permacrud>
12697
12698     </class>
12699
12700         <!-- What we now call Batches in the UI -->
12701     <class
12702         id="uvva"
12703         controller="open-ils.cstore open-ils.pcrud"
12704         oils_obj:fieldmapper="url_verify::verification_attempt"
12705         oils_persist:tablename="url_verify.verification_attempt"
12706         reporter:label="URL Verification Attempt"
12707     >
12708         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12709             <field reporter:label="Batch ID" name="id" reporter:datatype="id"/>
12710                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12711                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12712             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12713             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12714         </fields>
12715
12716         <links>
12717             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12718             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12719         </links>
12720
12721         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12722             <actions>
12723                 <create permission="URL_VERIFY">
12724                     <context link="session" field="owning_lib"/>
12725                 </create>
12726                 <retrieve permission="URL_VERIFY">
12727                     <context link="session" field="owning_lib"/>
12728                 </retrieve>
12729                 <update permission="URL_VERIFY">
12730                     <context link="session" field="owning_lib"/>
12731                 </update>
12732                 <delete permission="URL_VERIFY">
12733                     <context link="session" field="owning_lib"/>
12734                 </delete>
12735             </actions>
12736         </permacrud>
12737
12738     </class>
12739
12740         <!-- what we now call Attempts in the UI -->
12741     <class
12742         id="uvuv"
12743         controller="open-ils.cstore open-ils.pcrud"
12744         oils_obj:fieldmapper="url_verify::url_verification"
12745         oils_persist:tablename="url_verify.url_verification"
12746         reporter:label="URL Verification"
12747     >
12748         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12749             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12750                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12751                         <field reporter:label="Batch" name="attempt" reporter:datatype="link"/>
12752             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12753             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12754             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12755             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12756                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12757         </fields>
12758
12759         <links>
12760             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12761             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12762             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12763         </links>
12764
12765         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12766             <actions>
12767                 <create permission="URL_VERIFY">
12768                     <context link="attempt" jump="session" field="owning_lib"/>
12769                 </create>
12770                 <retrieve permission="URL_VERIFY">
12771                     <context link="attempt" jump="session" field="owning_lib"/>
12772                 </retrieve>
12773                 <update permission="URL_VERIFY">
12774                     <context link="attempt" jump="session" field="owning_lib"/>
12775                 </update>
12776                 <delete permission="URL_VERIFY">
12777                     <context link="attempt" jump="session" field="owning_lib"/>
12778                 </delete>
12779             </actions>
12780         </permacrud>
12781
12782     </class>
12783
12784         <class
12785                 id="cfdi"
12786                 controller="open-ils.cstore open-ils.pcrud"
12787                 oils_obj:fieldmapper="config::filter_dialog_interface"
12788                 oils_persist:tablename="config.filter_dialog_interface"
12789                 reporter:label="FilterDialog Interface">
12790                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12791                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12792                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12793                 </fields>
12794                 <links>
12795                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12796                 </links>
12797                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12798                         <actions>
12799                                 <retrieve />
12800                         </actions>
12801                 </permacrud>
12802         </class>
12803
12804         <class
12805                 id="cfdfs"
12806                 controller="open-ils.cstore open-ils.pcrud"
12807                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12808                 oils_persist:tablename="config.filter_dialog_filter_set"
12809                 reporter:label="FilterDialog Filter Set">
12810                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12811                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12812                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12813                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12814                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12815                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12816                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12817                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12818                 </fields>
12819                 <links>
12820                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12821                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12822                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12823                 </links>
12824                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12825                         <actions>
12826                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12827                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12828                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12829                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12830                         </actions>
12831                 </permacrud>
12832
12833         </class>
12834
12835         <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">
12836                 <fields oils_persist:primary="code">
12837                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12838                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12839                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12840                 </fields>
12841                 <links/>
12842                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12843                         <actions>
12844                                 <retrieve/>
12845                         </actions>
12846                 </permacrud>
12847         </class>
12848
12849         <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">
12850                 <oils_persist:source_definition><![CDATA[
12851
12852             SELECT  b.id,
12853                     MAX(dcp.edit_date) AS last_delete_date
12854              FROM   biblio.record_entry b
12855                     JOIN asset.call_number cn ON (cn.record = b.id)
12856                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12857              WHERE  NOT b.deleted
12858              GROUP BY b.id
12859              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12860
12861                 ]]></oils_persist:source_definition>
12862                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12863                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12864                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12865                 </fields>
12866                 <links>
12867                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12868                 </links>
12869                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12870                         <actions>
12871                                 <retrieve/>
12872                         </actions>
12873                 </permacrud>
12874         </class>
12875
12876         <class id="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">
12877                 <fields oils_persist:primary="id">
12878                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12879                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12880                 </fields>
12881                 <links/>
12882                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12883                         <actions>
12884                                 <retrieve/>
12885                         </actions>
12886                 </permacrud>
12887         </class>
12888
12889         <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">
12890                 <fields oils_persist:primary="id">
12891                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12892                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12893                 </fields>
12894                 <links/>
12895                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12896                         <actions>
12897                                 <retrieve/>
12898                         </actions>
12899                 </permacrud>
12900         </class>
12901
12902
12903         <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">
12904                 <oils_persist:source_definition><![CDATA[
12905                 SELECT
12906                     x.id,
12907                     COALESCE( y.copy_count, 0 ) AS copy_count,
12908                     x.hold_count AS hold_count,
12909                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12910                 FROM
12911                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12912                         FROM
12913                             action.hold_request ahr
12914                             JOIN reporter.hold_request_record rhrr USING (id)
12915                         WHERE
12916                             ahr.cancel_time IS NULL
12917                             AND ahr.fulfillment_time IS NULL
12918                         GROUP BY bib_record
12919                     )x
12920                     JOIN
12921                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12922                         FROM
12923                             action.hold_request ahr
12924                             JOIN reporter.hold_request_record rhrr USING (id)
12925                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12926                         WHERE
12927                             ahr.cancel_time IS NULL
12928                             AND ahr.fulfillment_time IS NULL
12929                             AND ahr.capture_time IS NULL
12930                             AND ahr.frozen IS FALSE
12931                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12932                             AND ahr.hold_type != 'M'
12933                            GROUP BY bib_record
12934                     )y
12935                     USING (id)
12936                 ]]></oils_persist:source_definition>
12937                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12938                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12939                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12940                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12941                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12942                 </fields>
12943                 <links>
12944                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12945                 </links>
12946                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12947                         <actions>
12948                                 <retrieve/>
12949                         </actions>
12950                 </permacrud>
12951         </class>
12952
12953         <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">
12954                 <oils_persist:source_definition><![CDATA[
12955             SELECT *,
12956                 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,
12957                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12958             FROM
12959                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12960                     FROM
12961                         action.hold_request ahr
12962                         JOIN reporter.hold_request_record rhrr USING (id)
12963                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12964                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12965                     WHERE
12966                         ahr.cancel_time IS NULL
12967                         AND ahr.fulfillment_time IS NULL
12968                     GROUP BY bib_record, pickup_lib
12969                 )x
12970                 JOIN
12971                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12972                     FROM
12973                         action.hold_request ahr
12974                         JOIN reporter.hold_request_record rhrr USING (id)
12975                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12976                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12977                     WHERE
12978                         ahr.cancel_time IS NULL
12979                         AND ahr.fulfillment_time IS NULL
12980                         AND ahr.capture_time IS NULL
12981                         AND ahr.frozen IS FALSE
12982                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12983                         AND ahr.hold_type != 'M'
12984                     GROUP BY bib_record, pickup_lib
12985                 )y
12986                 USING(id,pickup_lib)
12987                 JOIN
12988                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12989                     FROM
12990                         action.hold_request ahr
12991                         JOIN reporter.hold_request_record rhrr USING (id)
12992                     WHERE
12993                         ahr.cancel_time IS NULL
12994                         AND ahr.fulfillment_time IS NULL
12995                     GROUP BY bib_record
12996                 )z
12997                 USING (id)
12998                 JOIN
12999                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13000                     FROM
13001                         action.hold_request ahr
13002                         JOIN reporter.hold_request_record rhrr USING (id)
13003                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13004                     WHERE
13005                         ahr.cancel_time IS NULL
13006                         AND ahr.fulfillment_time IS NULL
13007                         AND ahr.capture_time IS NULL
13008                         AND ahr.frozen IS FALSE
13009                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13010                         AND ahr.hold_type != 'M'
13011                         GROUP BY bib_record
13012                 )u
13013                 USING (id)
13014                 ]]></oils_persist:source_definition>
13015                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13016                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13017                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
13018                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
13019                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
13020                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13021                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13022                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
13023                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13024                 </fields>
13025                 <links>
13026                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13027                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
13028                 </links>
13029                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13030                         <actions>
13031                                 <retrieve/>
13032                         </actions>
13033                 </permacrud>
13034         </class>
13035
13036         <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">
13037                 <oils_persist:source_definition><![CDATA[
13038             SELECT *,
13039                 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,
13040                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
13041             FROM
13042                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
13043                     FROM
13044                         action.hold_request ahr
13045                         JOIN actor.usr au ON (ahr.usr = au.id)
13046                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
13047                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13048                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
13049                     WHERE
13050                         ahr.cancel_time IS NULL
13051                         AND ahr.fulfillment_time IS NULL
13052                     GROUP BY bib_record, home_ou
13053                 )x
13054                 JOIN
13055                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
13056                     FROM
13057                         action.hold_request ahr
13058                         JOIN actor.usr au ON (ahr.usr = au.id)
13059                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
13060                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13061                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
13062                     WHERE
13063                         ahr.cancel_time IS NULL
13064                         AND ahr.fulfillment_time IS NULL
13065                         AND ahr.capture_time IS NULL
13066                         AND ahr.frozen IS FALSE
13067                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13068                         AND ahr.hold_type != 'M'
13069                     GROUP BY bib_record, home_ou
13070                 )y
13071                 USING (id,home_ou)
13072                 JOIN
13073                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13074                     FROM
13075                         action.hold_request ahr
13076                         JOIN reporter.hold_request_record rhrr USING (id)
13077                     WHERE
13078                         ahr.cancel_time IS NULL
13079                         AND ahr.fulfillment_time IS NULL
13080                     GROUP BY bib_record
13081                 )z
13082                 USING (id)
13083                 JOIN
13084                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13085                     FROM
13086                         action.hold_request ahr
13087                         JOIN reporter.hold_request_record rhrr USING (id)
13088                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13089                     WHERE
13090                         ahr.cancel_time IS NULL
13091                         AND ahr.fulfillment_time IS NULL
13092                         AND ahr.capture_time IS NULL
13093                         AND ahr.frozen IS FALSE
13094                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13095                         AND ahr.hold_type != 'M'
13096                     GROUP BY bib_record
13097                 )u
13098                 USING (id)
13099         ]]></oils_persist:source_definition>
13100         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13101                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13102                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13103                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
13104                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
13105                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13106                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13107                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
13108                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13109         </fields>
13110         <links>
13111                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13112                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13113         </links>
13114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13115                 <actions>
13116                         <retrieve/>
13117                 </actions>
13118         </permacrud>
13119 </class>
13120
13121         <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) ">
13122                 <oils_persist:source_definition><![CDATA[
13123                 WITH counts_at_ou AS (
13124                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
13125                 FROM
13126                     (SELECT rhrr.bib_record AS id,
13127                             aou.id AS pickup_lib_or_desc,
13128                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
13129                        FROM actor.org_unit aou
13130                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13131                             action.hold_request ahr
13132                             JOIN reporter.hold_request_record rhrr USING (id)
13133                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13134                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13135                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
13136                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13137                             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
13138                       GROUP BY 1, 2
13139                 ) a
13140                 JOIN
13141                     (SELECT rhrr.bib_record AS id,
13142                             aou.id AS pickup_lib_or_desc,
13143                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
13144                        FROM actor.org_unit aou
13145                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13146                             action.hold_request ahr
13147                             JOIN reporter.hold_request_record rhrr USING (id)
13148                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13149                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13150                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
13151                             -- Comment out the next line to count copies included from other bibs by metarecord holds
13152                             AND ahr.hold_type != 'M'
13153                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13154                             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
13155                       GROUP BY 1, 2
13156                 ) b
13157                 USING (id,pickup_lib_or_desc)
13158             )
13159             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13160                    y.holds_everywhere, z.copy_count_everywhere,
13161                 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,
13162                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13163             FROM counts_at_ou x
13164                 JOIN
13165                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13166                     FROM
13167                         action.hold_request ahr
13168                         JOIN reporter.hold_request_record rhrr USING (id)
13169                     WHERE
13170                         ahr.cancel_time IS NULL
13171                         AND ahr.fulfillment_time IS NULL
13172                     GROUP BY bib_record
13173                 )y
13174                 USING (id)
13175                 JOIN
13176                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13177                     FROM
13178                         action.hold_request ahr
13179                         JOIN reporter.hold_request_record rhrr USING (id)
13180                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13181                     WHERE
13182                         ahr.cancel_time IS NULL
13183                         AND ahr.fulfillment_time IS NULL
13184                         AND ahr.capture_time IS NULL
13185                         AND ahr.frozen IS FALSE
13186                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13187                         AND ahr.hold_type != 'M'
13188                         GROUP BY bib_record
13189                 )z
13190                 USING (id)
13191                 ]]></oils_persist:source_definition>
13192                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13193                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13194                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13195                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13196                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13197                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13198                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13199                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13200                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13201                 </fields>
13202                 <links>
13203                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13204                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13205                 </links>
13206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13207                         <actions>
13208                                 <retrieve/>
13209                         </actions>
13210                 </permacrud>
13211         </class>
13212
13213         <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">
13214                 <oils_persist:source_definition><![CDATA[
13215             SELECT
13216                 ac.id,
13217                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13218                 MAX(actac.xact_start) AS last_circ
13219             FROM asset.copy ac
13220                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13221             GROUP BY ac.id
13222
13223             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13224             --SELECT
13225             --    ac.id,
13226             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13227             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13228             --FROM asset.copy ac
13229             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13230             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13231             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13232                 ]]></oils_persist:source_definition>
13233                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13234                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13235                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13236                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13237                 </fields>
13238                 <links>
13239                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13240                 </links>
13241                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13242                         <actions>
13243                                 <retrieve/>
13244                         </actions>
13245                 </permacrud>
13246         </class>
13247
13248         <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">
13249                 <fields oils_persist:primary="id">
13250                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13251                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13252                 </fields>
13253                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13254                         <actions>
13255                                 <retrieve/>
13256                         </actions>
13257                 </permacrud>
13258         </class>
13259
13260         <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">
13261                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13262                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13263                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13264                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13265                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13266                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13267                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13268                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13269                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13270                 </fields>
13271                 <links>
13272                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13273                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13274                 </links>
13275                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13276                         <actions>
13277                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13278                                 <retrieve/>
13279                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13280                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13281                         </actions>
13282                 </permacrud>
13283         </class>
13284
13285         <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">
13286                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13287                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13288                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13289                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13290                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13291                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13292                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13293                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13294                 </fields>
13295                 <links>
13296                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13297                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13298                 </links>
13299                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13300                         <actions>
13301                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13302                                 <retrieve/>
13303                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13304                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13305                         </actions>
13306                 </permacrud>
13307         </class>
13308
13309
13310         <!-- ********************************************************************************************************************* -->
13311         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13312         <!-- ********************************************************************************************************************* -->
13313         <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">
13314                 <fields oils_persist:primary="id">
13315                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13316                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13317                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13318                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13319                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13320                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13321                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13322                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13323                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13324                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13325                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13326                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13327                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13328                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13329                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13330                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13331                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13332                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13333                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13334                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13335                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13336                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13337                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13338                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13339                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13340                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13341                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13342                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13343                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13344                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13345                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13346                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13347                 </fields>
13348                 <links>
13349                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13350                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13351                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13352                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13353                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13354                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13355                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13356                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13357                 </links>
13358         </class>
13359
13360         <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">
13361                 <fields oils_persist:primary="id">
13362                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13363                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13364                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13365                 </fields>
13366                 <links>
13367                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13368                 </links>
13369         </class>
13370
13371         <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">
13372                 <fields oils_persist:primary="id">
13373                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13374                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13375                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13376                 </fields>
13377                 <links>
13378                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13379                 </links>
13380         </class>
13381
13382         <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">
13383                 <fields oils_persist:primary="id">
13384                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13385
13386                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13387                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13388                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13389
13390                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13391                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13392                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13393
13394                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13395                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13396
13397                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13398                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13399                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13400
13401                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13402                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13403
13404                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13405                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13406                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13407
13408                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13409                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13410                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13411
13412                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13413                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13414                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13415                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13416
13417                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13418                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13419
13420                 </fields>
13421                 <links>
13422                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13423                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13424                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13425                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13426                 </links>
13427         </class>
13428
13429         <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">
13430                 <oils_persist:source_definition><![CDATA[
13431
13432             SELECT
13433                 po.ordering_agency AS ordering_agency,
13434                 po.id AS purchase_order,
13435                 li.id AS lineitem,
13436                 lid.id AS lineitem_detail,
13437                 cpa.id AS claim_policy_action
13438             FROM
13439                 acq.lineitem_detail lid
13440                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13441                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13442                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13443                 JOIN acq.claim_policy_action cpa ON (
13444                     cpa.claim_policy = cp.id
13445
13446                     -- we only care about claim policy actions whose claim
13447                     -- interval we'd reached or exceeded
13448                     AND (NOW() - cpa.action_interval) > po.order_date
13449
13450                     -- filter out all claim policy actions where claim events
13451                     -- have occurred on or after the action's action_interval
13452                     AND NOT EXISTS (
13453                         SELECT 1
13454                         FROM
13455                             acq.claim_event evt
13456                             JOIN acq.claim claim ON (
13457                                 claim.id = evt.claim
13458                                 AND claim.lineitem_detail = lid.id
13459                             )
13460                         WHERE
13461                             evt.event_date >= (po.order_date + cpa.action_interval)
13462                     )
13463                 )
13464             WHERE
13465                 lid.cancel_reason IS NULL
13466                 AND li.cancel_reason IS NULL -- belt/suspenders
13467                 AND po.cancel_reason IS NULL -- belt/suspenders
13468                 AND lid.recv_time IS NULL
13469                 AND po.state = 'on-order'
13470             ORDER BY 1, 2, 3, 4, 5
13471
13472                 ]]></oils_persist:source_definition>
13473                 <fields>
13474                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13475                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13476                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13477                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13478                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13479                 </fields>
13480                 <links>
13481                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13482                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13483                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13484                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13485                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13486                 </links>
13487         </class>
13488         <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">
13489                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13490                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13491                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13492                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13493                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13494                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13495                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13496                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13497                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13498                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13499                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13500                 </fields>
13501                 <links>
13502                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13503                 </links>
13504     </class>
13505         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13506                 <oils_persist:source_definition><![CDATA[
13507             SELECT * FROM acq.lineitem_summary 
13508                                 WHERE item_count > (invoice_count + cancel_count)
13509         ]]></oils_persist:source_definition>
13510                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13511                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13512                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13513                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13514                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13515                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13516                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13517                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13518                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13519                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13520                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13521                 </fields>
13522                 <links>
13523                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13524                 </links>
13525     </class>
13526         <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">
13527                 <oils_persist:source_definition><![CDATA[
13528
13529                         SELECT  t.*
13530                           FROM  action.transit_copy t
13531                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13532                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13533                           WHERE s.parent_ou <> d.parent_ou
13534
13535                 ]]></oils_persist:source_definition>
13536                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13537                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13538                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13539                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13540                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13541                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13542                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13543                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13544                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13545                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13546                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13547                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13548                 </fields>
13549                 <links>
13550                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13551                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13552                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13553                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13554                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13555                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13556                 </links>
13557         </class>
13558
13559     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13560                 <oils_persist:source_definition><![CDATA[
13561
13562         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13563                 SELECT
13564                         cp.id as copy,
13565                         COUNT(circ.id),
13566                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13567                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13568                 FROM
13569                         asset.copy cp
13570                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13571                 GROUP BY 1, 3, 4
13572                 UNION ALL
13573                 SELECT
13574                         cp.id as copy,
13575                         COUNT(circ.id),
13576                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13577                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13578                 FROM
13579                         asset.copy cp
13580                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13581                 GROUP BY 1, 3, 4
13582                 UNION ALL
13583                 SELECT
13584                         id as copy,
13585                         circ_count,
13586                         -1 AS year,
13587                         false as is_renewal
13588                 FROM
13589                         extend_reporter.legacy_circ_count
13590         )x GROUP BY 1, 3, 4
13591
13592                 ]]></oils_persist:source_definition>
13593         <fields>
13594             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13595             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13596             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13597             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13598         </fields>
13599                 <links>
13600                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13601                 </links>
13602                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13603                         <actions>
13604                                 <retrieve/>
13605                         </actions>
13606                 </permacrud>
13607     </class>
13608
13609         <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">
13610                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13611                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13612                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13613                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13614                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13615                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13616                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13617                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13618                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13619                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13620                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13621                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13622                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13623                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13624                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13625                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13626                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13627                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13628                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13629                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13630                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13631                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13632                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13633                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13634                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13635                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13636                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13637                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13638                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13639                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13640                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13641                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13642                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13643                 </fields>
13644                 <links>
13645                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13646                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13647                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13648                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13649                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13650                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13651                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13652                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13653                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13654                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13655                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13656                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13657                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13658                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13659                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13660                 </links>
13661         </class>
13662
13663     <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">
13664         <fields oils_persist:primary="id">
13665             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13666             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13667             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13668             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13669             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13670             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13671             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13672             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13673             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13674             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13675             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13676             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13677             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13678             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13679             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13680             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13681             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13682             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13683             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13684             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13685             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13686             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13687             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13688             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13689             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13690             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13691             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13692             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13693             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13694             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13695             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13696             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13697             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13698             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13699         </fields>
13700         <links>
13701             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13702             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13703             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13704             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13705             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13706             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13707             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13708             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13709         </links>
13710     </class>
13711
13712     <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">
13713         <fields oils_persist:primary="id">
13714             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13715             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13716             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13717             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13718         </fields>
13719         <links>
13720             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13721             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13722         </links>
13723     </class>
13724
13725     <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">
13726         <fields oils_persist:primary="owning_lib">
13727             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13728             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13729             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13730         </fields>
13731         <links>
13732             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13733         </links>
13734     </class>
13735
13736     <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">
13737         <fields oils_persist:primary="id">
13738             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13739             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13740             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13741             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13742             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13743         </fields>
13744         <links>
13745             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13746             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13747             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13748         </links>
13749     </class>
13750
13751     <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">
13752         <fields oils_persist:primary="circ_lib">
13753             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13754             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13755             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13756             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13757         </fields>
13758         <links>
13759             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13760             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13761         </links>
13762     </class>
13763
13764     <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">
13765         <fields oils_persist:primary="id">
13766             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13767             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13768             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13769             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13770             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13771         </fields>
13772         <links>
13773             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13774             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13775             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13776         </links>
13777     </class>
13778
13779     <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">
13780         <fields oils_persist:primary="home_ou">
13781             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13782             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13783             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13784             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13785         </fields>
13786         <links>
13787             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13788             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13789         </links>
13790     </class>
13791         <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">
13792                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13793                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13794                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13795                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13796                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13797                 </fields>
13798                 <links>
13799                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13800                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13801                 </links>
13802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13803                         <actions>
13804                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13805                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13806                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13807                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13808                         </actions>
13809                 </permacrud>
13810         </class>
13811         <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">
13812                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13813                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13814                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13815                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13816                 </fields>
13817                 <links>
13818                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13819                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13820                         </links>
13821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13822                 <actions>
13823                                 <create permission="ADMIN_ACQ_FUND_TAG">
13824                                         <context link="tag" field="owner"/>
13825                                 </create>
13826                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13827                                         <context link="tag" field="owner"/>
13828                                 </retrieve>
13829                                 <update permission="ADMIN_ACQ_FUND_TAG">
13830                                         <context link="tag" field="owner"/>
13831                                 </update>
13832                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13833                                         <context link="tag" field="owner"/>
13834                                 </delete>
13835                         </actions>
13836                 </permacrud>
13837         </class>
13838         <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">
13839                 <oils_persist:source_definition><![CDATA[
13840                 SELECT
13841                         poi.purchase_order AS purchase_order,
13842                         ii.invoice AS invoice,
13843                         NULL AS lineitem,
13844                         poi.id AS po_item,
13845                         NULL AS picklist
13846                 FROM
13847                         acq.po_item poi
13848                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13849                 UNION SELECT
13850                         jub.purchase_order AS purchase_order,
13851                         ie.invoice AS invoice,
13852                         jub.id AS lineitem,
13853                         NULL AS po_item,
13854                         jub.picklist AS picklist
13855                 FROM
13856                         acq.lineitem jub
13857                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13858                 UNION SELECT
13859                         ii.purchase_order AS purchase_order,
13860                         ii.invoice AS invoice,
13861                         NULL AS lineitem,
13862                         NULL AS po_item,
13863                         NULL AS picklist
13864                 FROM
13865                         acq.invoice_item ii
13866                 WHERE ii.po_item IS NULL
13867                 UNION SELECT
13868                         ie.purchase_order AS purchase_order,
13869                         ie.invoice AS invoice,
13870                         NULL AS lineitem,
13871                         NULL AS po_item,
13872                         NULL AS picklist
13873                 FROM
13874                         acq.invoice_entry ie
13875                 WHERE ie.lineitem IS NULL
13876                 UNION SELECT
13877                         NULL AS purchase_order,
13878                         NULL AS invoice,
13879                         jub.id AS lineitem,
13880                         NULL AS po_item,
13881                         jub.picklist AS picklist
13882                 FROM
13883                         acq.lineitem jub
13884                 WHERE jub.purchase_order IS NULL
13885                 ]]></oils_persist:source_definition>
13886                 <fields>
13887                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13888                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13889                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13890                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13891                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13892                 </fields>
13893                 <links>
13894                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13895                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13896                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13897                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13898                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13899                 </links>
13900         </class>
13901         <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">
13902                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13903                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13904                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13905                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13906                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13907                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13908                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13909                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13910                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13911                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13912                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13913                 </fields>
13914                 <links>
13915                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13916                 </links>
13917                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13918                         <actions>
13919                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13920                                 <retrieve/>
13921                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13922                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13923                         </actions>
13924                 </permacrud>
13925         </class>
13926
13927         <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">
13928                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13929                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13930                         <field name="date_applied" reporter:datatype="timestamp"/>
13931                         <field name="org" reporter:datatype="org_unit"/>
13932                         <field name="original_value" reporter:datatype="text"/>
13933                         <field name="new_value" reporter:datatype="text"/>
13934                         <field name="field_name" reporter:datatype="link"/>
13935                 </fields>
13936                 <links>
13937                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13938                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13939                 </links>
13940         </class>
13941         <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">
13942                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13943                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13944                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13945                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13946                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13947                 </fields>
13948                 <links>
13949                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13950                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13951                 </links>
13952         </class>
13953         <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">
13954                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13955                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13956                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13957                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13958                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13959                 </fields>
13960                 <links>
13961                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13962                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13963                 </links>
13964         </class>
13965         <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">
13966                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13967                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13968                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13969                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13970                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13971                 </fields>
13972                 <links>
13973                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13974                 </links>
13975                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13976                         <actions>
13977                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13978                                 <retrieve/>
13979                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13980                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13981                         </actions>
13982                 </permacrud>
13983         </class>
13984         <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">
13985                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13986                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13987                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13988                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13989                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13990                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13991                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13992                 </fields>
13993                 <links>
13994                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13995                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13996                 </links>
13997                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13998                         <actions>
13999                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
14000                                 <retrieve/>
14001                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
14002                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
14003                         </actions>
14004                 </permacrud>
14005         </class>
14006         <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">
14007                 <fields oils_persist:primary="code">
14008                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
14009                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
14010                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
14011                 </fields>
14012                 <links>
14013                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14014                 </links>
14015                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14016                         <actions>
14017                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
14018                                 <retrieve/>
14019                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
14020                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
14021                         </actions>
14022                 </permacrud>
14023         </class>
14024         <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">
14025                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
14026                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
14027                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
14028                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
14029                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
14030                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
14031                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
14032                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
14033                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
14034                 </fields>
14035                 <links>
14036                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
14037                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14038                 </links>
14039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14040                         <actions>
14041                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
14042                                 <retrieve/>
14043                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
14044                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
14045                         </actions>
14046                 </permacrud>
14047         </class>
14048         <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">
14049                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
14050                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
14051                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
14052                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
14053                 </fields>
14054                 <links>
14055                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
14056                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
14057                 </links>
14058                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14059                         <actions>
14060                                 <create permission="UPDATE_COPY">
14061                     <context link="copy" field="circ_lib"/>
14062                 </create>
14063                                 <retrieve/>
14064                                 <update permission="UPDATE_COPY">
14065                     <context link="copy" field="circ_lib"/>
14066                 </update>
14067                                 <delete permission="UPDATE_COPY">
14068                     <context link="copy" field="circ_lib"/>
14069                 </delete>
14070                         </actions>
14071                 </permacrud>
14072         </class>
14073         <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">
14074         <oils_persist:source_definition><![CDATA[
14075         SELECT ahcm.target_copy AS id,count(*) AS count
14076          FROM
14077          action.hold_request ahr,
14078          action.hold_copy_map ahcm
14079          WHERE
14080          ahr.cancel_time IS NULL AND
14081          ahr.fulfillment_time IS NULL AND
14082          ahr.capture_time IS NULL AND
14083          ahr.id = ahcm.hold
14084          GROUP BY ahcm.target_copy
14085         ]]></oils_persist:source_definition>
14086         <fields oils_persist:primary="id">
14087             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
14088             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
14089         </fields>
14090         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14091             <actions>
14092                <retrieve/>
14093             </actions>
14094         </permacrud>
14095         </class>
14096
14097         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
14098                 oils_obj:fieldmapper="config::workstation_setting_type" 
14099                 oils_persist:tablename="config.workstation_setting_type" 
14100                 reporter:label="Workstation Setting Type">
14101                 <fields oils_persist:primary="name">
14102                         <field name="name" reporter:datatype="text"/>
14103                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
14104                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
14105                         <field name="datatype" reporter:datatype="text"/>
14106                         <field name="fm_class" reporter:datatype="text"/>
14107                         <field name="grp" reporter:datatype="link"/>
14108                 </fields>
14109                 <links>
14110                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
14111                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
14112                 </links>
14113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14114                         <actions>
14115                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14116                                 <retrieve/>
14117                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14118                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14119                         </actions>
14120                 </permacrud>
14121         </class>
14122
14123         <!-- no pcrud access is granted for now, because it's assumed these
14124                          setting values will be applied and retrived via the API. -->
14125         <class id="awss" 
14126                 controller="open-ils.cstore"
14127                 oils_obj:fieldmapper="actor::workstation_setting" 
14128                 oils_persist:tablename="actor.workstation_setting" 
14129                 reporter:label="Workstation Setting">
14130                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
14131                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
14132                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
14133                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
14134                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
14135                 </fields>
14136                 <links>
14137                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
14138                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
14139                 </links>
14140         </class>
14141
14142         <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">
14143         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
14144                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
14145                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
14146                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
14147         </fields>
14148         </class>
14149
14150         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
14151                 oils_obj:fieldmapper="config::print_template" 
14152                 oils_persist:tablename="config.print_template" 
14153                 reporter:label="Print Templates">
14154                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
14155                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
14156                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
14157                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14158                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
14159                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
14160                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
14161                         <field name="content_type" reporter:datatype="text"/>
14162                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
14163                 </fields>
14164                 <links>
14165                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14166                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14167                 </links>
14168                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14169                         <actions>
14170                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14171                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14172                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14173                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14174                         </actions>
14175                 </permacrud>
14176         </class>
14177
14178         <class id="cct" 
14179                 controller="open-ils.cstore open-ils.pcrud"
14180                 oils_obj:fieldmapper="config::carousel_type" 
14181                 oils_persist:tablename="config.carousel_type" 
14182                 reporter:label="Carousel Types">
14183                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14184                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
14185                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14186                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14187                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14188                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14189                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14190                 </fields>
14191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14192                         <actions>
14193                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14194                                 <retrieve/>
14195                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14196                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14197                         </actions>
14198                 </permacrud>
14199         </class>
14200
14201         <class id="cc" 
14202                 controller="open-ils.cstore open-ils.pcrud"
14203                 oils_obj:fieldmapper="container::carousel" 
14204                 oils_persist:tablename="container.carousel" 
14205                 reporter:label="Carousels">
14206                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14207                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14208                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14209                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14210                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14211                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14212                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14213                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14214                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14215                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14216                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14217                         <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 -->
14218                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14219                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14220                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14221                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14222                 </fields>
14223                 <links>
14224                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14225                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14226                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14227                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14228                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14229                 </links>
14230                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14231                         <actions>
14232                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14233                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14234                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14235                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14236                         </actions>
14237                 </permacrud>
14238         </class>
14239
14240         <class id="ccou" 
14241                 controller="open-ils.cstore open-ils.pcrud"
14242                 oils_obj:fieldmapper="container::carousel_org_unit" 
14243                 oils_persist:tablename="container.carousel_org_unit" 
14244                 reporter:label="Carousels Visible at Library">
14245                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14246                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14247                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14248                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14249                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14250                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14251                 </fields>
14252                 <links>
14253                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14254                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14255                 </links>
14256                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14257                         <actions>
14258                                 <create permission="ADMIN_CAROUSEL">
14259                                     <context link="carousel" field="owner" />
14260                                 </create>
14261                                 <retrieve permission="ADMIN_CAROUSEL">
14262                                     <context link="carousel" field="owner" />
14263                                 </retrieve>
14264                                 <update permission="ADMIN_CAROUSEL">
14265                                     <context link="carousel" field="owner" />
14266                                 </update>
14267                                 <delete permission="ADMIN_CAROUSEL">
14268                                     <context link="carousel" field="owner" />
14269                                 </delete>
14270                         </actions>
14271                 </permacrud>
14272         </class>
14273
14274         <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">
14275                 <fields oils_persist:primary="name">
14276                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14277                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14278                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14279                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14280                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14281                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14282                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14283                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14284                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14285                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14286                 </fields>
14287                 <links>
14288                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14289                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14290                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14291                 </links>
14292                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14293                         <actions>
14294                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14295                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14296                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14297                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14298                         </actions>
14299                 </permacrud>
14300         </class>
14301         <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">
14302                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14303                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14304                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14305                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14306                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14307                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14308                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14309                 </fields>
14310                 <links>
14311                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14312                 </links>
14313                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14314                         <actions>
14315                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14316                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14317                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14318                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14319                         </actions>
14320                 </permacrud>
14321         </class>
14322
14323     <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">
14324         <fields oils_persist:primary="code">
14325             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14326             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14327         </fields>
14328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14329                         <actions>
14330                                 <retrieve/>
14331                         </actions>
14332                 </permacrud>
14333         </class>
14334
14335     <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">
14336         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14337             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14338             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14339             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14340             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14341             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14342             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14343             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14344             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14345                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14346         </fields>
14347                 <links>
14348                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14349                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14350                 </links>
14351         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14352             <actions>
14353                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14354                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14355                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14356                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14357             </actions>
14358         </permacrud>
14359     </class>
14360
14361         <!-- Simple Reporter classes are currently used only by the SR UI -->
14362     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14363         <oils_persist:source_definition><![CDATA[
14364             SELECT
14365               -- Circ id; just for counting
14366               combcirc.id AS circ_id,
14367
14368               -- User info, currently limiting to what's available from action.all_circulation
14369               combcirc.usr_post_code AS usr_post_code,
14370               combcirc.usr_birth_year AS usr_bith_year,
14371               combcirc.usr_profile AS usr_profile_id,
14372               pgtu.name AS usr_profile,
14373               combcirc.usr_home_ou AS usr_home_ou_id,
14374               aouuh.shortname AS usr_home_ou_shortname,
14375               aouuh.name AS usr_home_ou_name,
14376               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14377               aouus.shortname AS usr_sys_shortname,
14378               aouus.name AS usr_sys_name,
14379
14380               -- Circ info
14381               -- Checkout
14382               combcirc.xact_start AS xact_start,
14383               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14384               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14385               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14386               combcirc.circ_lib AS circ_lib_id,
14387               aouco.shortname AS circ_lib_shortname,
14388               aouco.name AS circ_lib_name,
14389               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14390               aoucos.shortname AS circ_sys_shortname,
14391               aoucos.name AS circ_sys_name,
14392               auco.usrname AS circ_staff,
14393               awso.name AS checkout_workstation,
14394
14395               combcirc.due_date AS due_date,
14396               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14397               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14398               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14399
14400               -- Checkin
14401               combcirc.xact_finish AS xact_finish,
14402               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14403               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14404               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14405               aouci.shortname AS checkin_lib_shortname,
14406               aouci.name AS checkin_lib_name,
14407               auci.usrname AS checkin_staff,
14408               awsi.name AS checkin_workstation,
14409               aoucis.shortname AS checkin_sys_shortname,
14410               aoucis.name AS checkin_sys_name,
14411
14412               combcirc.checkin_time AS checkin_time,
14413
14414               -- Misc circ info
14415               combcirc.renewal_remaining AS renewal_remaining,
14416               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14417               combcirc.grace_period AS grace_period,
14418
14419               combcirc.stop_fines AS stop_fines,
14420               combcirc.stop_fines_time AS stop_fines_time,
14421
14422               combcirc.duration AS duration,
14423               combcirc.fine_interval AS fine_interval,
14424               combcirc.recurring_fine AS recurring_fine,
14425               combcirc.max_fine AS max_fine,
14426               combcirc.duration_rule AS duration_rule,
14427               combcirc.recurring_fine_rule AS recurring_fine_rule,
14428               combcirc.max_fine_rule AS max_fine_rule,
14429               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14430               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,
14431               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14432
14433               -- Copy info
14434               acp.barcode AS copy_barcode,
14435               acp.circ_modifier AS copy_circ_modifier_code,
14436               ccm.name AS copy_circ_modifier_name,
14437               acp.circ_lib AS copy_circ_lib_id,
14438               acp.location AS location_id,
14439               acpl.name AS location_name,
14440               aoucp.shortname AS copy_circ_lib_shortname,
14441               aoucp.name AS copy_circ_lib_name,
14442               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14443               aoucps.shortname AS copy_sys_shortname,
14444               aoucps.name AS copy_sys_name,
14445               combcirc.copy_owning_lib AS copy_owning_lib_id,
14446               aoucpo.shortname AS copy_owning_lib_shortname,
14447               aoucpo.name AS copy_owning_lib_name,
14448               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14449               acnp.label AS copy_call_number_prefix,
14450               acn.label AS copy_call_number_label,
14451               acns.label AS copy_call_number_suffix,
14452               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14453               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14454               acn.label_sortkey AS copy_call_number_label_sortkey,
14455               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14456               COALESCE(rmsr.title, acp.dummy_title) AS title,
14457               COALESCE(rmsr.author, acp.dummy_author) AS author,
14458               rmsr.publisher AS publisher,
14459               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14460               array_to_string(rmsr.isbn, ', ') AS isbn,
14461               array_to_string(rmsr.issn, ', ') AS issn,
14462               part.label AS part_label,
14463               part.label_sortkey AS part_label_sortkey,
14464               acn.record AS bib_id,
14465               rmsr.tcn_value AS tcn_value
14466
14467             FROM
14468               action.all_circulation combcirc
14469
14470               -- User
14471               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14472               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14473               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14474
14475               -- Circ
14476               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14477               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14478               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14479               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14480               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14481               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14482               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14483               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14484
14485               -- Copy / call / title
14486               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14487                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14488               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14489               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14490               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14491               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14492               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14493               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14494               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14495               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14496               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14497               LEFT JOIN (
14498                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14499                 FROM biblio.monograph_part bmp
14500                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14501                 WHERE NOT bmp.deleted
14502               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14503         ]]></oils_persist:source_definition>
14504         <field_groups>
14505             <group name="common" reporter:label="Common Fields"/>
14506             <group name="item" reporter:label="Item Fields"/>
14507             <group name="user" reporter:label="Patron Fields"/>
14508             <group name="title" reporter:label="Call Number and Title Fields"/>
14509             <group name="org" reporter:label="Libraries"/>
14510         </field_groups>
14511         <fields oils_persist:primary="circ_id">
14512             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14513             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14514             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14515             <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"/>
14516             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14517             <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"/>
14518             <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"/>
14519             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14520             <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"/>
14521             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14522             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14523             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14524             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14525             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14526             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14527             <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"/>
14528             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14529             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14530             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14531             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14532             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14533             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14534             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14535             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14536             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14537             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14538             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14539             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14540             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14541             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14542             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14543             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14544             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14545             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14546             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14547             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14548             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14549             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14550             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14551             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14552             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14553             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14554             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14555             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14556             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14557             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14558             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14559             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14560             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14561             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14562             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14563             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14564             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14565             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14566             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14567             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14568             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14569             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14570             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14571             <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"/>
14572             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14573             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14574             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14575             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14576             <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"/>
14577             <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"/>
14578             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14579             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14580             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14581             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14582             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14583             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14584             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14585             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14586             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14587             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14588             <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"/>
14589             <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"/>
14590             <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"/>
14591             <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"/>
14592             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14593             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14594             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14595             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14596             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14597             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14598             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14599             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14600             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14601             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14602         </fields>
14603         <links>
14604             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14605             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14606             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14607         </links>
14608     </class>
14609
14610     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14611         <oils_persist:source_definition><![CDATA[
14612             SELECT
14613               au.home_ou AS home_ou_filter,
14614               au.id AS user_id,
14615               cardp.barcode AS barcode_primary,
14616               au.usrname AS usrname,
14617               au.email AS email,
14618               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14619               au.prefix AS prefix,
14620               au.first_given_name AS first_given_name,
14621               au.second_given_name AS second_given_name,
14622               au.family_name AS family_name,
14623               au.suffix AS suffix,
14624               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14625               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14626               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14627               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14628               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14629               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14630               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14631               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14632               au.profile AS profile_id,
14633               pgt.name AS profile,
14634               au.alias AS alias,
14635               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14636               au.day_phone AS day_phone,
14637               au.evening_phone AS evening_phone,
14638               au.other_phone AS other_phone,
14639               au.dob AS dob,
14640               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14641               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14642               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14643               au.active AS active,
14644               au.barred AS barred,
14645               au.deleted AS deleted,
14646               au.juvenile AS juvenile,
14647               au.claims_returned_count AS claims_returned_count,
14648               au.credit_forward_balance AS credit_forward_balance,
14649               au.create_date AS create_date,
14650               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14651               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14652               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14653               au.expire_date AS expire_date,
14654               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14655               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14656               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14657               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14658               au.last_update_time AS last_update_time,
14659               au.home_ou AS home_ou_id,
14660               aouh.shortname AS home_ou_shortname,
14661               aouh.name AS home_ou_name,
14662               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14663               aous.shortname AS home_sys_shortname,
14664               aous.name AS home_sys_name,
14665               auam.valid AS mailing_valid,
14666               auam.address_type AS mailing_address_type,
14667               auam.street1 AS mailing_street1,
14668               auam.street2 AS mailing_street2,
14669               auam.city AS mailing_city,
14670               auam.state AS mailing_state,
14671               auam.country AS mailing_country,
14672               auam.post_code AS mailing_post_code,
14673               auam.county AS mailing_county,
14674               auam.within_city_limits AS mailing_within_city_limits,
14675               auam.pending AS mailing_pending,
14676               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14677               auap.valid AS physical_valid,
14678               auap.address_type AS physical_address_type,
14679               auap.street1 AS physical_street1,
14680               auap.street2 AS physical_street2,
14681               auap.city AS physical_city,
14682               auap.state AS physical_state,
14683               auap.country AS physical_country,
14684               auap.post_code AS physical_post_code,
14685               auap.county AS physical_county,
14686               auap.within_city_limits AS physical_within_city_limits,
14687               auap.pending AS physical_pending,
14688               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14689               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14690               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14691               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14692               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14693               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14694               asceum1.stat_cat_entry AS legacy_stat_cat1,
14695               asceum2.stat_cat_entry AS legacy_stat_cat2,
14696
14697               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14698               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14699               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14700               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14701               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,
14702               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14703
14704             FROM
14705               actor.usr au
14706               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14707               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14708               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14709               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14710               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14711               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14712               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14713               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14714               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14715               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14716               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14717               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14718               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14719               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14720               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14721               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14722
14723             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14724               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14725               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14726               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14727               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14728               76,77,78,79,80,81
14729         ]]></oils_persist:source_definition>
14730         <field_groups>
14731             <group name="common" reporter:label="Common Fields"/>
14732             <group name="name" reporter:label="Name Fields"/>
14733             <group name="contact" reporter:label="Contact Fields"/>
14734             <group name="address" reporter:label="Address Related Fields"/>
14735             <group name="org" reporter:label="Libraries"/>
14736         </field_groups>
14737         <fields oils_persist:primary="user_id">
14738             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14739                 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"/>
14740             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14741             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14742             <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14743             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14744             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14745             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14746             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14747             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14748             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14749             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14750             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14751             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14752             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14753             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14754             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14755             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14756             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14757             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14758             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14759             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14760             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14761             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14762             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14763             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14764             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14765             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14766             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14767             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14768             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14769             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14770             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14771             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14772             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14773             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14774             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14775             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14776             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14777             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14778             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14779             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14780             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14781             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14782             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14783             <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"/>
14784             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14785             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14786             <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"/>
14787             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14788             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14789             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14790             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14791             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14792             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14793             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14794             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14795             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14796             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14797             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14798             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14799             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14800             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14801             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14802             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14803             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14804             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14805             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14806             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14807             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14808             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14809             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14810             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14811             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14812             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14813             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14814             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14815             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14816             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14817             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14818             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14819             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14820             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14821             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14822             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14823             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14824             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14825         </fields>
14826         <links>
14827             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14828         </links>
14829     </class>
14830
14831     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14832         <oils_persist:source_definition><![CDATA[
14833             SELECT
14834               -- ids
14835               acp.id AS copy_id,
14836               acp.floating AS floating_id,
14837               acn.id AS acn_id,
14838               acp.circ_lib AS circ_lib_id,
14839               acp.status AS status_id,
14840               acp.location AS location_id,
14841               acp.age_protect AS age_protect_id,
14842               aous.id AS circ_sys_id,
14843               acn.owning_lib AS owning_lib_id,
14844               aouos.id AS owning_sys_id,
14845               awsi.id AS inv_workstation_id,
14846
14847               -- OUs
14848               aou.shortname AS circ_lib_shortname,
14849               aou.name AS circ_lib_name,
14850               aous.shortname AS circ_sys_shortname,
14851               aous.name AS circ_sys_name,
14852               aouo.shortname AS owning_lib_shortname,
14853               aouo.name AS owning_lib_name,
14854               aouos.shortname AS owning_sys_shortname,
14855               aouos.name AS owning_sys_name,
14856
14857               -- dates
14858               acp.create_date AS create_date_time,
14859               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14860               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14861               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14862               acp.active_date AS active_date_time,
14863               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14864               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14865               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14866               acp.edit_date AS edit_date_time,
14867               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14868               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14869               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14870               acp.status_changed_time AS status_changed_time_time,
14871               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14872               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14873               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14874               ali.inventory_date AS latest_inv_date,
14875               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14876               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14877               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14878
14879               -- acp
14880               acp.barcode AS barcode,
14881               ccs.name AS status,
14882               acpl.name AS location_name,
14883                                                         acp.circ_modifier AS copy_circ_modifier_code,
14884                                                         ccm.name AS copy_circ_modifier_name,
14885               acp.price AS price,
14886               acp.cost AS acq_price,
14887               acp.deleted AS copy_deleted,
14888               acp.ref AS reference,
14889               acp.circulate AS copy_circulate,
14890               (acp.circulate AND acpl.circulate) AS circulate,
14891               acp.holdable AS copy_holdable,
14892               acp.deposit AS deposit,
14893               acp.deposit_amount AS deposit_amount,
14894               acp.alert_message AS alert_message,
14895               acp.opac_visible AS copy_opac_visible,
14896               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14897               crahp.name AS age_protect,
14898               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14899               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14900               acp.copy_number AS copy_number,
14901               acp.circ_as_type AS circ_as_type,
14902               acp.loan_duration AS loan_duration_int,
14903               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14904               acp.fine_level AS fine_level_int,
14905               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14906
14907               -- Call Number
14908               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14909               acnp.label AS copy_call_number_prefix,
14910               acn.label AS copy_call_number_label,
14911               acns.label AS copy_call_number_suffix,
14912               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14913               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14914               acn.label_sortkey AS copy_call_number_label_sortkey,
14915               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14916               racnd.dewey AS call_number_dewey,
14917               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14918               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14919               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14920               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14921
14922               -- Misc
14923               COALESCE(rmsr.title, acp.dummy_title) AS title,
14924               COALESCE(rmsr.author, acp.dummy_author) AS author,
14925               rmsr.publisher AS publisher,
14926               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14927               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14928               array_to_string(rmsr.issn, ', ') AS issn,
14929               part.label AS part_label,
14930               part.label_sortkey AS part_label_sortkey,
14931               acn.record AS bib_id,
14932               rmsr.tcn_value AS tcn_value,
14933               acn.deleted AS call_deleted,
14934               bre.deleted AS bib_deleted,
14935               ccs.holdable AS status_holdable,
14936               acpl.holdable AS location_holdable,
14937               acp.circulate AS location_circulate,
14938               awsi.name AS inventory_workstation,
14939               aucr.usrname AS creating_user,
14940               aued.usrname AS editing_user,
14941
14942               -- Aggregates
14943               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14944               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,
14945               COUNT(DISTINCT combcirc.id) AS circ_total,
14946               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14947
14948             FROM
14949               asset.copy acp
14950               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14951               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14952               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14953               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14954               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14955               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14956               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14957               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14958               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14959               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14960               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14961               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14962               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14963               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14964               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14965               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14966               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14967               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14968               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14969               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14970               LEFT JOIN (
14971                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14972                 FROM biblio.monograph_part bmp
14973                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14974                 WHERE NOT bmp.deleted
14975               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14976
14977             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14978               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14979               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14980               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14981               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14982               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14983               91,92,93,94,95,96
14984
14985         ]]></oils_persist:source_definition>
14986         <field_groups>
14987             <group name="common" reporter:label="Common Fields"/>
14988             <group name="dates" reporter:label="Date Fields"/>
14989             <group name="title" reporter:label="Call Number and Title Fields"/>
14990             <group name="org" reporter:label="Libraries"/>
14991         </field_groups>
14992         <fields oils_persist:primary="copy_id">
14993             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14994             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14995             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14996             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14997             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14998             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14999             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15000             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
15001             <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"/>
15002             <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"/>
15003             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
15004             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15005             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15006             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15007             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15008             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15009             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15010             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15011             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15012             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15013             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15014             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15015             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15016             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15017             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15018             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15019             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15020             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15021             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15022             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15023             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15024             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15025             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15026             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15027             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15028             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
15029             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
15030             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15031             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
15032             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15033             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15034             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15035             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
15036             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15037             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15038             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15039             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15040             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15041             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15042             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15043             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15044             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15045             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15046             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
15047             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15048             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15049             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15050             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
15051             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
15052             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15053             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
15054             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
15055             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15056             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
15057             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15058             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
15059             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
15060             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15061             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15062             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
15063             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15064             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15065             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15066             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15067             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15068             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15069             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15070             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15071             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15072             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15073             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15074             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15075             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15076             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15077             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15078             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15079             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15080             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15081             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15082             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15083             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
15084             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15085             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
15086             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15087         </fields>
15088         <links>
15089             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
15090             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15091             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15092             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15093             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15094             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15095         </links>
15096     </class>
15097
15098     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
15099         <oils_persist:source_definition><![CDATA[
15100
15101             SELECT
15102               -- ids
15103               acp.id AS copy_id,
15104               acn.id AS acn_id,
15105               acp.circ_lib AS circ_lib_id,
15106               acp.status AS status_id,
15107               acp.location AS location_id,
15108               acp.age_protect AS age_protect_id,
15109               aous.id AS circ_sys_id,
15110               acn.owning_lib AS owning_lib_id,
15111               aouos.id AS owning_sys_id,
15112               awsi.id AS inv_workstation_id,
15113
15114               -- OUs
15115               aou.shortname AS circ_lib_shortname,
15116               aou.name AS circ_lib_name,
15117               aous.shortname AS circ_sys_shortname,
15118               aous.name AS circ_sys_name,
15119               aouo.shortname AS owning_lib_shortname,
15120               aouo.name AS owning_lib_name,
15121               aouos.shortname AS owning_sys_shortname,
15122               aouos.name AS owning_sys_name,
15123
15124               -- dates
15125               acp.create_date AS create_date_time,
15126               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
15127               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
15128               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
15129               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
15130               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
15131               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
15132               acp.active_date AS active_date_time,
15133               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
15134               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
15135               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
15136               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
15137               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
15138               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
15139               acp.edit_date AS edit_date_time,
15140               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
15141               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
15142               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
15143               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
15144               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
15145               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
15146               acp.status_changed_time AS status_changed_time_time,
15147               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
15148               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
15149               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
15150               ali.inventory_date AS latest_inv_date,
15151               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
15152               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
15153               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
15154               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
15155               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
15156               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
15157
15158               -- acp
15159               acp.barcode AS barcode,
15160               ccs.name AS status,
15161               acpl.name AS location_name,
15162               acp.circ_modifier AS circ_modifier_code,
15163               ccm.name AS circ_modifier_name,
15164               acp.price AS price,
15165               acp.cost AS acq_price,
15166               acp.deleted AS copy_deleted,
15167               acp.ref AS reference,
15168               acp.circulate AS copy_circulate,
15169               (acp.circulate AND acpl.circulate) AS circulate,
15170               acp.holdable AS copy_holdable,
15171               acp.deposit AS deposit,
15172               acp.deposit_amount AS deposit_amount,
15173               acp.alert_message AS alert_message,
15174               acp.opac_visible AS copy_opac_visible,
15175               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
15176               crahp.name AS age_protect,
15177               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15178               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15179               acp.copy_number AS copy_number,
15180               acp.circ_as_type AS circ_as_type,
15181               acp.loan_duration AS loan_duration_int,
15182               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15183               acp.fine_level AS fine_level_int,
15184               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15185
15186               -- Call Number
15187               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15188               acnp.label AS copy_call_number_prefix,
15189               acn.label AS copy_call_number_label,
15190               acns.label AS copy_call_number_suffix,
15191               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15192               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15193               acn.label_sortkey AS copy_call_number_label_sortkey,
15194               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15195               racnd.dewey AS call_number_dewey,
15196               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15197               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15198               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15199               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15200
15201               -- Misc
15202               COALESCE(rmsr.title, acp.dummy_title) AS title,
15203               COALESCE(rmsr.author, acp.dummy_author) AS author,
15204               rmsr.publisher AS publisher,
15205               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15206               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15207               array_to_string(rmsr.issn, ', ') AS issn,
15208               part.label AS part_label,
15209               part.label_sortkey AS part_label_sortkey,
15210               acn.record AS bib_id,
15211               rmsr.tcn_value AS tcn_value,
15212               acn.deleted AS call_deleted,
15213               bre.deleted AS bib_deleted,
15214               ccs.holdable AS status_holdable,
15215               acpl.holdable AS location_holdable,
15216               acp.circulate AS location_circulate,
15217               awsi.name AS inventory_workstation,
15218
15219               -- Aggregates
15220               -- may decide these price games aren't worth it, but estimated collection value is useful
15221               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,
15222               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15223               MAX(combcirc.xact_start) AS last_circ_datetime,
15224               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15225               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15226               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15227               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15228               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15229               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15230               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15231               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15232               (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,
15233               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15234               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15235               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15236               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15237               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15238               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15239               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,
15240               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,
15241               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,
15242               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
15243
15244             FROM
15245               asset.copy acp
15246               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15247               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15248               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15249               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15250               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15251               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15252               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15253               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15254               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15255               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15256               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15257               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15258               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15259               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15260               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15261               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15262               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15263               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15264               LEFT JOIN (
15265                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15266                 FROM biblio.monograph_part bmp
15267                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15268                 WHERE NOT bmp.deleted
15269               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15270
15271             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15272               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15273               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15274               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15275               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15276               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15277               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15278
15279         ]]></oils_persist:source_definition>
15280         <field_groups>
15281             <group name="common" reporter:label="Common Fields"/>
15282             <group name="dates" reporter:label="Date Fields"/>
15283             <group name="inv" reporter:label="Inventory Fields"/>
15284             <group name="title" reporter:label="Call Number and Title Fields"/>
15285             <group name="org" reporter:label="Libraries"/>
15286         </field_groups>
15287         <fields oils_persist:primary="copy_id">
15288              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15289              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15290              <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"/>
15291              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15292              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15293              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15294              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15295              <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"/>
15296              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15297              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15298              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15299              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15300              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15301              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15302              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15303              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15304              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15305              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15306              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15307              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15308              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15309              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15310              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15311              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15312              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15313              <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"/>
15314              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15315              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15316              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15317              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15318              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15319              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15320              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15321              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15322              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15323              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15324              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15325              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15326              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15327              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15328              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15329              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15330              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15331              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15332              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15333              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15334              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15335              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15336              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15337              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15338              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15339              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15340              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15341              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15342              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15343              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15344              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15345              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15346              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15347              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15348              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15349              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15350              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15351              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15352              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15353              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15354              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15355              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15356              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15357              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15358              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15359              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15360              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15361              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15362              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15363              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15364              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15365              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15366              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15367              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15368              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15369              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15370              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15371              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15372              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15373              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15374              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15375              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15376              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15377              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15378              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15379              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15380              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15381              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15382              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15383              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15384              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15385              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15386              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15387              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15388              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15389              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15390              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15391              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15392              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15393              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15394              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15395              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15396              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15397              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15398              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15399              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15400              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15401              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15402              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15403              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15404              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15405              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15406              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15407              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15408              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15409              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15410              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15411              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15412              <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"/>
15413              <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"/>
15414              <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"/>
15415         </fields>
15416         <links>
15417             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15418             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15419             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15420             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15421             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15422         </links>
15423     </class>
15424
15425     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15426         <oils_persist:source_definition><![CDATA[
15427
15428             SELECT
15429               -- ids
15430               xact.id AS xact_id,
15431               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15432               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15433
15434               -- OUs
15435               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15436               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15437               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15438               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15439
15440               -- billings
15441               billings.total_amount AS billing_grand_total,
15442               billings.total_unvoided_amount AS billing_total,
15443
15444               billings.voided_billing_count AS billing_voided_count,
15445               billings.all_billing_types AS all_billing_types,
15446               billings.billing_types AS billing_types,
15447
15448               billings.total_voided_amount AS billing_total_voided,
15449               billings.total_overdue_amount AS billing_overdue_amount,
15450               billings.total_lost_amount AS billing_lost_amount,
15451               billings.total_long_od_amount AS billing_long_od_amount,
15452               billings.total_damaged_amount AS billing_damaged_amount,
15453               billings.total_deposit_amount AS billing_deposit_amount,
15454               billings.total_rental_amount AS billing_rental_amount,
15455
15456               -- payments
15457               payments.total_amount AS payment_grand_total,
15458               payments.total_unvoided_amount AS payment_total,
15459
15460               payments.voided_payment_count AS payment_voided_count,
15461               payments.all_payment_types AS all_payment_types,
15462               payments.payment_types AS payment_types,
15463
15464               payments.total_voided_amount AS payment_total_voided,
15465               payments.total_account_adjustment AS payment_account_adjustment_amount,
15466               payments.total_cash_payment AS payment_cash_amount,
15467               payments.total_check_payment AS payment_check_amount,
15468               payments.total_credit_card_payment AS payment_credit_card_amount,
15469               payments.total_debit_card_payment AS payment_debit_card_amount,
15470               payments.total_credit_payment AS payment_credit_amount,
15471               payments.total_forgive_payment AS payment_forgive_amount,
15472               payments.total_work_payment AS payment_work_amount,
15473               payments.total_goods_payment AS payment_goods_amount,
15474               payments.total_currency_payment AS payment_currency_amount,
15475               payments.total_non_currency_payment AS payment_non_currency_amount,
15476
15477               -- dates
15478               xact.xact_start AS xact_start,
15479               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15480               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15481               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15482               xact.xact_finish AS xact_finish,
15483               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15484               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15485               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15486               billings.earliest_billing_ts AS earliest_billing_ts,
15487               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15488               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15489               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15490               billings.latest_billing_ts AS latest_billing_ts,
15491               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15492               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15493               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15494               payments.earliest_payment_ts AS earliest_payment_ts,
15495               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15496               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15497               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15498               payments.latest_payment_ts AS latest_payment_ts,
15499               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15500               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15501               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15502
15503               -- Misc
15504               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15505               (xact.xact_finish IS NOT NULL) AS xact_closed
15506
15507             FROM
15508               money.billable_xact xact
15509               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15510               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15511               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15512               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15513               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15514               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15515
15516               -- oohh nooo.... If not done this way you encounter situations
15517               -- like multiplying billing totals x number of payments and
15518               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15519               LEFT JOIN (
15520                 SELECT
15521                   xact,
15522                   MIN(billing_ts) AS earliest_billing_ts,
15523                   MAX(billing_ts) AS latest_billing_ts,
15524
15525                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15526                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15527                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15528
15529                   SUM(amount) AS total_amount,
15530                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15531                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15532                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15533                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15534                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15535                   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.
15536                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15537                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15538
15539                 FROM
15540                   money.all_billings
15541                 GROUP BY 1
15542               ) billings ON (xact.id = billings.xact)
15543               -- Can't include accepting user or cash_drawer because that will "duplicate"
15544               -- rows if multiple staff accept payments on a single xact...
15545               LEFT JOIN (
15546                 SELECT
15547                   xact,
15548                   MIN(payment_ts) AS earliest_payment_ts,
15549                   MAX(payment_ts) AS latest_payment_ts,
15550
15551                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15552                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15553                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15554
15555                   SUM(amount) AS total_amount,
15556                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15557                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15558                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15559                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15560                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15561                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15562                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15563                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15564                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15565                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15566                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15567                   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,
15568                   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
15569
15570                 FROM
15571                   money.all_payments
15572                 GROUP BY 1
15573               ) payments ON (xact.id = payments.xact)
15574
15575         ]]></oils_persist:source_definition>
15576         <field_groups>
15577             <group name="common" reporter:label="Common Fields"/>
15578             <group name="bill" reporter:label="Billing Fields"/>
15579             <group name="pay" reporter:label="Payment Fields"/>
15580             <group name="dates" reporter:label="Date Fields"/>
15581             <group name="org" reporter:label="Libraries"/>
15582         </field_groups>
15583         <fields oils_persist:primary="xact_id">
15584              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15585              <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"/>
15586              <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"/>
15587              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15588              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15589              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15590              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15591              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15592              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15593              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15594              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15595              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15596              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15597              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15598              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15599              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15600              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15601              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15602              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15603              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15604              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15605              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15606              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15607              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15608              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15609              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15610              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15611              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15612              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15613              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15614              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15615              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15616              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15617              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15618              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15619              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15620              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15621              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15622              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15623              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15624              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15625              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15626              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15627              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15628              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15629              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15630              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15631              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15632              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15633              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15634              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15635              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15636              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15637              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15638              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15639              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15640              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15641              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15642              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15643              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15644              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15645              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15646         </fields>
15647     </class>
15648
15649         <class id="coauf" 
15650                 controller="open-ils.cstore open-ils.pcrud"
15651                 oils_obj:fieldmapper="config::openathens_uid_field" 
15652                 oils_persist:tablename="config.openathens_uid_field" 
15653                 reporter:label="OpenAthens unique identifiers">
15654                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15655                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15656                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15657                 </fields>
15658                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15659                         <actions>
15660                                 <retrieve/>
15661                         </actions>
15662                 </permacrud>
15663         </class>
15664
15665         <class id="coanf" 
15666                 controller="open-ils.cstore open-ils.pcrud"
15667                 oils_obj:fieldmapper="config::openathens_name_field" 
15668                 oils_persist:tablename="config.openathens_name_field" 
15669                 reporter:label="OpenAthens name fields">
15670                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15671                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15672                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15673                 </fields>
15674                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15675                         <actions>
15676                                 <retrieve/>
15677                         </actions>
15678                 </permacrud>
15679         </class>
15680
15681         <class id="coai" 
15682                 controller="open-ils.cstore open-ils.pcrud"
15683                 oils_obj:fieldmapper="config::openathens_identity" 
15684                 oils_persist:tablename="config.openathens_identity" 
15685                 reporter:label="Sign-on to OpenAthens">
15686                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15687                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15688                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15689                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15690                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15691                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15692                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15693                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15694                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15695                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15696                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15697                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15698                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15699                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15700                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15701                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15702                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15703                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15704                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15705                 </fields>
15706                 <links>
15707                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15708                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15709                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15710                 </links>
15711                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15712                         <actions>
15713                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15714                                 <retrieve/>
15715                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15716                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15717                         </actions>
15718                 </permacrud>
15719         </class>
15720
15721         <class id="acqr_inv_totals"
15722                 controller="open-ils.reporter"
15723                 oils_persist:virtual="true"
15724                 reporter:label="Invoice Totals">
15725                 <oils_persist:source_definition><![CDATA[
15726                         WITH invoice_entry_totals AS (
15727                                 SELECT acqinv.id,
15728                                         SUM(COALESCE(acqie.cost_billed, 0.00)) AS total_invoice_entry_cost_billed,
15729                                         SUM(COALESCE(acqie.amount_paid, 0.00)) AS total_invoice_entry_amount_paid
15730                                 FROM acq.invoice acqinv
15731                                 LEFT JOIN acq.invoice_entry acqie ON (acqinv.id = acqie.invoice)
15732                                 GROUP BY 1
15733                         ), invoice_item_totals AS (
15734                                 SELECT acqinv.id,
15735                                         SUM(COALESCE(acqii.cost_billed, 0.00)) AS total_invoice_item_cost_billed,
15736                                         SUM(COALESCE(acqii.amount_paid, 0.00)) AS total_invoice_item_amount_paid
15737                                 FROM acq.invoice acqinv
15738                                 LEFT JOIN acq.invoice_item  acqii ON (acqinv.id = acqii.invoice)
15739                                 GROUP BY 1
15740                         )
15741                         SELECT id,
15742                                 total_invoice_entry_cost_billed, total_invoice_entry_amount_paid,
15743                                 total_invoice_item_cost_billed, total_invoice_item_amount_paid,
15744                                 total_invoice_entry_cost_billed + total_invoice_item_cost_billed AS total_cost_billed,
15745                                 total_invoice_entry_amount_paid + total_invoice_item_amount_paid AS total_amount_paid
15746                         FROM invoice_entry_totals
15747                         JOIN invoice_item_totals USING (id)
15748                 ]]></oils_persist:source_definition>
15749                 <fields oils_persist:primary="id">
15750                         <field reporter:label="Invoice" name="id" reporter:datatype="link" />
15751                         <field reporter:label="Total Billed for Line Items" name="total_invoice_entry_cost_billed" reporter:datatype="money" />
15752                         <field reporter:label="Total Paid for Line Items" name="total_invoice_entry_amount_paid" reporter:datatype="money" />
15753                         <field reporter:label="Total Billed for Direct Charges" name="total_invoice_item_cost_billed" reporter:datatype="money" />
15754                         <field reporter:label="Total Paid for Direct Charges" name="total_invoice_item_amount_paid" reporter:datatype="money" />
15755                         <field reporter:label="Total Billed" name="total_cost_billed" reporter:datatype="money" />
15756                         <field reporter:label="Total Paid" name="total_amount_paid" reporter:datatype="money" />
15757                 </fields>
15758         <links>
15759             <link field="id" reltype="has_a" key="id" map="" class="acqinv"/>
15760         </links>
15761         </class>
15762
15763         <class id="acqr_debit_by_fund"
15764                 controller="open-ils.reporter"
15765                 oils_persist:virtual="true"
15766                 reporter:label="Invoice Debits by Fund">
15767                 <oils_persist:source_definition><![CDATA[
15768                         WITH invoice_funds AS (
15769                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15770                                 FROM acq.invoice_entry acqie
15771                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15772                                 UNION ALL
15773                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15774                                 FROM acq.invoice_item acqii
15775                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15776                         )
15777                         SELECT invoice, fund, encumbrance, SUM (amount) AS total_amount
15778                         FROM invoice_funds
15779                         GROUP BY 1, 2, 3
15780                 ]]></oils_persist:source_definition>
15781                 <fields>
15782                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
15783                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
15784                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool" />
15785                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money" />
15786                 </fields>
15787         <links>
15788             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15789             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
15790         </links>
15791         </class>
15792
15793         <class id="acqr_debit_by_fund_tag"
15794                 controller="open-ils.reporter"
15795                 oils_persist:virtual="true"
15796                 reporter:label="Invoice Debits by Fund Tag">
15797                 <oils_persist:source_definition><![CDATA[
15798                         WITH invoice_funds AS (
15799                                 SELECT invoice, fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15800                                 FROM acq.invoice_entry acqie
15801                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.invoice_entry = acqie.id)
15802                                 UNION ALL
15803                                 SELECT invoice, acqfdeb.fund, COALESCE(amount, 0.00)::NUMERIC(8,2) AS amount, encumbrance
15804                                 FROM acq.invoice_item acqii
15805                                 JOIN acq.fund_debit acqfdeb ON (acqfdeb.id = acqii.fund_debit)
15806                         )
15807                         SELECT invoice, tag, encumbrance, SUM(amount) AS total_amount
15808                         FROM invoice_funds
15809                         LEFT JOIN acq.fund_tag_map acqftm ON (invoice_funds.fund = acqftm.fund)
15810                         GROUP BY 1, 2, 3
15811                 ]]></oils_persist:source_definition>
15812                 <fields>
15813                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
15814                         <field reporter:label="Fund Tag" name="tag" reporter:datatype="link" />
15815                         <field reporter:label="Encumbrance?" name="encumbrance" reporter:datatype="bool" />
15816                         <field reporter:label="Total Amount" name="total_amount" reporter:datatype="money" />
15817                 </fields>
15818         <links>
15819             <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
15820             <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
15821         </links>
15822         </class>
15823
15824         <!-- ********************************************************************************************************************* -->
15825 </IDL>
15826
15827 <!-- Local Variables: -->
15828 <!-- indent-tabs-mode: t -->
15829 <!-- tab-width: 4 -->
15830 <!-- nxml-child-indent: 4 -->
15831 <!-- End: -->
15832 <!--
15833         vim:noet:ts=4:sw=4:
15834 -->