]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP1952931 Support ACQ Advanced Shipment Notices (DESADV -- Dispatch Advice Messages)
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77
78         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio"
79                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
80                    oils_persist:tablename="oai.biblio">
81                 <fields oils_persist:primary="rec_id">
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
83                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
84                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
85                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
86                 </fields>
87         </class>
88         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority"
89                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
90                    oils_persist:tablename="oai.authority">
91                 <fields oils_persist:primary="rec_id">
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
93                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
94                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
95                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
96                 </fields>
97         </class>
98
99         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
100                 <fields>
101                         <field name="usr" oils_persist:virtual="true" />
102                         <field name="forgive_payment" oils_persist:virtual="true" />
103                         <field name="work_payment" oils_persist:virtual="true" />
104                         <field name="credit_payment" oils_persist:virtual="true" />
105                         <field name="goods_payment" oils_persist:virtual="true" />
106                         <field name="account_adjustment" oils_persist:virtual="true" />
107                 </fields>
108                 <links>
109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
110                 </links>
111         </class>
112
113         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
114                 <fields>
115                         <field name="workstation" oils_persist:virtual="true" />
116                         <field name="cash_payment" oils_persist:virtual="true" />
117                         <field name="check_payment" oils_persist:virtual="true" />
118                         <field name="credit_card_payment" oils_persist:virtual="true" />
119                         <field name="debit_card_payment" oils_persist:virtual="true" />
120                 </fields>
121                 <links>
122                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
123                 </links>
124         </class>
125
126         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
127                 <fields>
128                         <field name="id" oils_persist:virtual="true" />
129                         <field name="children" oils_persist:virtual="true" />
130                         <field name="owner_doc" oils_persist:virtual="true" />
131                         <field name="intra_doc_id" oils_persist:virtual="true" />
132                         <field name="parent_node" oils_persist:virtual="true" />
133                         <field name="node_type" oils_persist:virtual="true" />
134                         <field name="namespace_uri" oils_persist:virtual="true" />
135                         <field name="name" oils_persist:virtual="true" />
136                         <field name="value" oils_persist:virtual="true" />
137                 </fields>
138         </class>
139
140         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
141                 <fields>
142                         <field name="title" oils_persist:virtual="true" />
143                         <field name="author" oils_persist:virtual="true" />
144                         <field name="doc_id" oils_persist:virtual="true" />
145                         <field name="doc_type" oils_persist:virtual="true" />
146                         <field name="pubdate" oils_persist:virtual="true" />
147                         <field name="isbn" oils_persist:virtual="true" />
148                         <field name="publisher" oils_persist:virtual="true" />
149                         <field name="tcn" oils_persist:virtual="true" />
150                         <field name="subject" oils_persist:virtual="true" />
151                         <field name="types_of_resource" oils_persist:virtual="true" />
152                         <field name="call_numbers" oils_persist:virtual="true" />
153                         <field name="edition" oils_persist:virtual="true" />
154                         <field name="online_loc" oils_persist:virtual="true" />
155                         <field name="synopsis" oils_persist:virtual="true" />
156                         <field name="physical_description" oils_persist:virtual="true" />
157                         <field name="toc" oils_persist:virtual="true" />
158                         <field name="copy_count" oils_persist:virtual="true" />
159                         <field name="series" oils_persist:virtual="true" />
160                         <field name="serials" oils_persist:virtual="true" />
161                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
162                 </fields>
163         </class>
164
165         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
166                 <fields>
167                         <field name="err_msg" oils_persist:virtual="true" />
168                         <field name="type" oils_persist:virtual="true" />
169                 </fields>
170         </class>
171
172         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
173                 <fields>
174                         <field name="err_msg" oils_persist:virtual="true" />
175                         <field name="type" oils_persist:virtual="true" />
176                 </fields>
177         </class>
178
179         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
180                 <fields oils_persist:primary="matchpoint">
181                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
182                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
183                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
184                 </fields>
185                 <links>
186                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
187                 </links>
188         </class>
189
190         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
191         <!-- when the time is right, turn me into a view.  -->
192                 <fields>
193             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
194             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
195             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
196             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
197             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
198             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
199             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
200             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
201             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
202             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
203                 </fields>
204         </class>
205
206         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
207                 <fields>
208                         <field name="public_name" oils_persist:virtual="true" />
209                         <field name="target_url" oils_persist:virtual="true" />
210                         <field name="target_coverage" oils_persist:virtual="true" />
211                         <field name="target_embargo" oils_persist:virtual="true" />
212                 </fields>
213         </class>
214
215         <!-- Actually in the DB -->
216         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
219                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
220                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
221                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
222                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
223                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
224                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
225                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
226                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
227                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
228                 </fields>
229                 <links>
230                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
231                 </links>
232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
233                         <actions>
234                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
235                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
236                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
237                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
238                         </actions>
239                 </permacrud>
240         </class>
241
242         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
243                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
244                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
245                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
246                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
247                 </fields>
248                 <links>
249                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
250                 </links>
251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
252                         <actions>
253                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
254                     <context link="grp" field="owner"/>
255                 </create>
256                                 <retrieve/>
257                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
258                     <context link="grp" field="owner"/>
259                 </update>
260                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
261                     <context link="grp" field="owner"/>
262                 </delete>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rrbs" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::record_badge_score" 
270             oils_persist:tablename="rating.record_badge_score" 
271             reporter:label="Statistical Popularity Badge">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.record_badge_score_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
276                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
277                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
278                 </fields>
279         <links>
280             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
281             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
282         </links>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <retrieve/>
286                         </actions>
287                 </permacrud>
288         </class>
289
290         <class  id="rp" 
291             controller="open-ils.cstore open-ils.pcrud" 
292             oils_obj:fieldmapper="rating::popularity_parameter" 
293             oils_persist:tablename="rating.popularity_parameter" 
294             reporter:label="Statistical Popularity Parameter">
295                 <fields oils_persist:primary="id" 
296                 oils_persist:sequence="rating.popularity_parameter_id_seq">
297                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
299                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
300                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
301                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
302                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
303                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
304                 </fields>
305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
306                         <actions>
307                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
308                                 <retrieve/>
309                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
310                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
311                         </actions>
312                 </permacrud>
313         </class>
314
315         <class  id="rb" 
316             controller="open-ils.cstore open-ils.pcrud" 
317             oils_obj:fieldmapper="rating::badge" 
318             oils_persist:tablename="rating.badge" 
319             reporter:label="Statistical Popularity Badge">
320                 <fields oils_persist:primary="id" 
321                 oils_persist:sequence="rating.badge_id_seq">
322                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
323                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
325                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
326                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
327                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
328                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
329                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
330                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
331                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
332                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
333                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
334                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
335                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
336                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
337                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
338                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
339                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
340                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
341                 </fields>
342                 <links>
343                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
344                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
345                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
346                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
347                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
348                 </links>
349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
350                         <actions>
351                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
352                                 <retrieve/>
353                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
354                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
355                         </actions>
356                 </permacrud>
357         </class>
358
359         <class  id="vibtg" 
360             controller="open-ils.cstore open-ils.pcrud" 
361             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
362             oils_persist:tablename="vandelay.import_bib_trash_group" 
363             reporter:label="Import/Overlay Field Groups for Removal">
364                 <fields oils_persist:primary="id" 
365                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
366                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
367                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
368                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
369                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
370                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
371                 </fields>
372                 <links>
373                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
374                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
375                 </links>
376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
377                         <actions>
378                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
379                                 <retrieve/>
380                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
381                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
382                         </actions>
383                 </permacrud>
384         </class>
385
386
387         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
388                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
389                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
390                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
391                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
392                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
393                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
394                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
395                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
396                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
397                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
398                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
399                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
400                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
401                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
402                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
403                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
404                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
405                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
406                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
407                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
408                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
409                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
410                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
411                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
412                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
413                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
414                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
415                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
416                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
417                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
418                 </fields>
419                 <links>
420                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
421                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
422                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
423                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
424                 </links>
425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
426                         <actions>
427                                 <create permission="CREATE_IMPORT_ITEM">
428                     <context link="definition" field="owner"/>
429                                 </create>
430                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
431                     <context link="definition" field="owner"/>
432                                 </retrieve>
433                                 <update permission="UPDATE_IMPORT_ITEM">
434                     <context link="definition" field="owner"/>
435                                 </update>
436                                 <delete permission="DELETE_IMPORT_ITEM">
437                     <context link="definition" field="owner"/>
438                                 </delete>
439                         </actions>
440                 </permacrud>
441         </class>
442
443         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
444                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
445                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
446                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
448                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
449                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
450                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
451                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
452                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
453                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
454                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
455                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
456                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
457                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
458                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
459                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
460                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
462                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
463                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
464                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
465                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
466                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
467                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
468                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
469                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
470                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
471                 </fields>
472                 <links>
473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
474                 </links>
475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
476                         <actions>
477                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
478                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
479                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
480                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
481                         </actions>
482                 </permacrud>
483         </class>
484
485         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
486                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
487                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
488                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
489                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
490                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
491                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
492                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
493                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
494                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
495                 </fields>
496                 <links>
497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
498                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
499                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
500                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
501                 </links>
502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
503                         <actions>
504                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
505                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
506                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
507                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
508                         </actions>
509                 </permacrud>
510         </class>
511
512         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
513                 <fields oils_persist:primary="code">
514                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
516                 </fields>
517                 <links>
518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
519                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
520                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
521                 </links>
522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
523                         <actions>
524                                 <retrieve/>
525                         </actions>
526                 </permacrud>
527         </class>
528
529         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
530                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
531                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
532                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
533                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
534                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
535                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
536                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
537                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
538                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
539                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
540                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
541                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
542                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
543                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
544                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
545                 </fields>
546                 <links>
547                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
548                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
549                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
550                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
551             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
552             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
553             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
554                 </links>
555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
556                         <actions>
557                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
558                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
559                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
560                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
561                         </actions>
562                 </permacrud>
563         </class>
564
565         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
566                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
568                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
569                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
570                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
571                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
572                 </fields>
573                 <links/>
574                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
575                         <actions>
576                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
577                 <retrieve/>
578                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
579                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
580                         </actions>
581                 </permacrud>
582         </class>
583
584         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
585                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
586                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
587                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
588                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
589                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
594                 </links>
595                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
596                         <actions>
597                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
598                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
599                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
600                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
601                         </actions>
602                 </permacrud>
603         </class>
604
605         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
607                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
608                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
609                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
610                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
611                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
612                 </fields>
613                 <links>
614                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
615                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
616                 </links>
617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
618                         <actions>
619                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
620                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
621                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
622                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
623                         </actions>
624                 </permacrud>
625         </class>
626
627         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
628                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
629                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
630                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
632                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
633                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
634                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
635                 </fields>
636                 <links>
637                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
638                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
639                 </links>
640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
641                         <actions>
642                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
643                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
644                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
645                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
646                         </actions>
647                 </permacrud>
648         </class>
649
650         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
651                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
652                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
653                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
654                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
655                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
656                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
657                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
658                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
659                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
660                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
661                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
662                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
663                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
664                 </fields>
665                 <links>
666                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
667                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
668                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
669             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
670             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
671                 </links>
672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
673                         <actions>
674                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
675                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
676                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
677                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
678                         </actions>
679                 </permacrud>
680         </class>
681
682         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
683                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
685                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
686                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
687                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
688                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
689                 </fields>
690                 <links/>
691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
692                         <actions>
693                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
694                 <retrieve/>
695                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
696                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
697                         </actions>
698                 </permacrud>
699         </class>
700
701         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
702                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
703                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
704                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
705                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
706                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
711                 </links>
712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
713                         <actions>
714                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
716                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
717                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
718                         </actions>
719                 </permacrud>
720         </class>
721
722         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
724                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
725                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
726                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
727                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
728                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
729                 </fields>
730                 <links>
731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
732                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
733                 </links>
734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735                         <actions>
736                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
737                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
738                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
739                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
740                         </actions>
741                 </permacrud>
742         </class>
743
744         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
745                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
746                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
748                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
749                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
750                 </fields>
751                 <links>
752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
753                 </links>
754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
755                         <actions>
756                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
757                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
758                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
759                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
760                         </actions>
761                 </permacrud>
762         </class>
763
764         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
765                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
766                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
767                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
768                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
769                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
770                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
771                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
772                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
773             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
774                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
775                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
776                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
777                 </fields>
778                 <links>
779                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
780                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
781                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
782                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
783                 </links>
784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
785                         <actions>
786                                 <create permission="ADMIN_IMPORT_MATCH_SET">
787                     <context link="match_set" field="owner"/>
788                                 </create>
789                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
790                     <context link="match_set" field="owner"/>
791                                 </retrieve>
792                                 <update permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </update>
795                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </delete>
798                         </actions>
799                 </permacrud>
800         </class>
801
802         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
803                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
804                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
805                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
806                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
807                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
808                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
809                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
810                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
811                 </fields>
812                 <links>
813                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
814                 </links>
815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
816                         <actions>
817                                 <create permission="ADMIN_IMPORT_MATCH_SET">
818                     <context link="match_set" field="owner"/>
819                                 </create>
820                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
821                     <context link="match_set" field="owner"/>
822                                 </retrieve>
823                                 <update permission="ADMIN_IMPORT_MATCH_SET">
824                     <context link="match_set" field="owner"/>
825                                 </update>
826                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
827                     <context link="match_set" field="owner"/>
828                                 </delete>
829                         </actions>
830                 </permacrud>
831         </class>
832
833         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
834                 oils_obj:fieldmapper="vandelay::session_tracker" 
835                 oils_persist:tablename="vandelay.session_tracker" 
836                 reporter:label="Vandelay Session Tracker">
837                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
839                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
840                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
842                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
843                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
844                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
845                                          queue or an auth queue and there's no IDL class for vandelay.queue .
846                                          parent table.
847                         -->
848                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
849                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
850                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
851                         <field reporter:label="State" name="state" reporter:datatype="text"/>
852                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
853                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
854                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
855                 </fields>
856                 <links>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
859                 </links>
860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
861                         <actions>
862                                 <!-- created by the API -->
863                                 <retrieve global_required="true"
864                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
865                                 <update global_required="true"
866                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
867                                         <context link="workstation" field="owning_lib"/>
868                                 </update>
869                                 <delete 
870                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
871                                         <context link="workstation" field="owning_lib"/>
872                                 </delete>
873                         </actions>
874                 </permacrud>
875         </class>
876
877         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
879                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
880                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
881                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
882                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
883                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
884                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
885                 </fields>
886                 <links>
887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
889                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
890                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
891                 </links>
892         </class>
893
894     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
895         <fields oils_persist:primary="name">
896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
897             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
898             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
899             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
900         </fields>
901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
902             <actions>
903                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
904                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
905                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
906                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
907             </actions>
908         </permacrud>
909     </class>
910
911     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
912         <fields oils_persist:primary="id">
913             <field reporter:label="ID" name="id" reporter:datatype="id"/>
914             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
915             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
916             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
917             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
918         </fields>
919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
920             <actions>
921                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922                 <retrieve/>
923                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
924                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
925             </actions>
926         </permacrud>
927     </class>
928
929         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
932                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
933                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
934                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
935                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
936                 </fields>
937                 <links>
938                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
939                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
940                 </links>
941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
942             <actions>
943                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
944                 <retrieve/>
945                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
946                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
947             </actions>
948         </permacrud>
949         </class>
950
951         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
952                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
953                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
954                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
956         </fields>
957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
958             <actions>
959                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
960                 <retrieve/>
961                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
962                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
963             </actions>
964         </permacrud>
965         </class>
966
967         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
968                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
969                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
970                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
971                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
972                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
974                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
975                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
976                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
977                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
978                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
979                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
980         </fields>
981                 <links>
982                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
984         </links>
985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
986             <actions>
987                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
988                 <retrieve/>
989                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
991             </actions>
992         </permacrud>
993         </class>
994
995         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:field_safe="true">
996                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
997                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
998                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
999                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
1001                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
1002                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1003                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
1004                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
1005                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
1006                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
1007         </fields>
1008                 <links>
1009                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
1010                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1011         </links>
1012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1013             <actions>
1014                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
1015                 <retrieve/>
1016                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
1017                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
1018             </actions>
1019         </permacrud>
1020         </class>
1021
1022         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
1023                 <fields oils_persist:primary="name">
1024                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1025                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1026                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1027                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1028                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1029                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1030                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1031                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1032                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1033                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1034                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1035                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1036                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1037                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1038                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1039                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1040                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1041                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1042                 </fields>
1043                 <links>
1044                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1045                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1046                 </links>
1047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1048             <actions>
1049                 <create permission="ADMIN_SVF" global_required="true"/>
1050                 <retrieve/>
1051                 <update permission="ADMIN_SVF" global_required="true"/>
1052                 <delete permission="ADMIN_SVF" global_required="true"/>
1053             </actions>
1054         </permacrud>
1055         </class>
1056
1057         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
1058                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1060                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1061                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1062             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1063                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1064                 </fields>
1065                 <links/>
1066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1067             <actions>
1068                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1069                 <retrieve/>
1070                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1071                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1077                 <fields oils_persist:primary="coded_value">
1078                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1087                 <retrieve/>
1088                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1089                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1090             </actions>
1091         </permacrud>
1092         </class>
1093
1094         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1096                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1097                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1098                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1099                 </fields>
1100                 <links>
1101                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1102                 </links>
1103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1104             <actions>
1105                 <retrieve/>
1106             </actions>
1107         </permacrud>
1108         </class>
1109
1110
1111         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1112                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1113                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1114                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1115                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1116                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1117                 </fields>
1118                 <links>
1119                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1120                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1121                 </links>
1122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1123             <actions>
1124                 <retrieve/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129
1130         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1131                 <fields oils_persist:primary="source">
1132                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1134                 </fields>
1135                 <links>
1136                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1137                 </links>
1138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1139             <actions>
1140                 <retrieve/>
1141             </actions>
1142         </permacrud>
1143         </class>
1144
1145         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1146                 <fields>
1147                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1148                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1149                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1150                 </fields>
1151                 <links>
1152                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1153                 </links>
1154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1155             <actions>
1156                 <retrieve/>
1157             </actions>
1158         </permacrud>
1159         </class>
1160
1161         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1162                 <fields oils_persist:primary="id">
1163                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1164                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1165                 </fields>
1166                 <links>
1167                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1168                 </links>
1169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1170             <actions>
1171                 <retrieve/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1179                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1180                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1181                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1182                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1183                 </fields>
1184                 <links>
1185                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1186                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1187                 </links>
1188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1189             <actions>
1190                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1191                 <retrieve/>
1192                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1193                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1194             </actions>
1195         </permacrud>
1196         </class>
1197
1198         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1199                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1200                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1201                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1202                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1203                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1204                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1205                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1206                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1207             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1208             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1209             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1210                 </fields>
1211                 <links>
1212                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1213                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1218                 <retrieve/>
1219                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1220                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1226                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1227                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1228                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1229                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1230                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1231                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1232                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1233                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1234                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1235                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1236                 </fields>
1237                 <links>
1238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1239                 </links>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1243                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1244                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1245                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1251         <fields oils_persist:primary="name">
1252             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1253             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1255             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1256             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1257             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1258             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1259             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1260             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1261             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1262         </fields>
1263         <links>
1264             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1265             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1266         </links>
1267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1268             <actions>
1269                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <retrieve/>
1271                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1272                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273             </actions>
1274         </permacrud>
1275     </class>
1276
1277     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1278         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1279             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1280             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1281             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1282             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1283             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1284             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1285             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1286         </fields>
1287         <links>
1288             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1289         </links>
1290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291             <actions>
1292                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1293                 <retrieve/>
1294                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1296             </actions>
1297         </permacrud>
1298     </class>
1299
1300     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1301                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1302                         oils_persist:tablename="config.z3950_index_field_map" 
1303                         reporter:label="Z39.50 Index Field Map">
1304         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1305             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1306             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1307             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1308             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1309             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1310             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1311         </fields>
1312         <links>
1313             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1314             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1315             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1316         </links>
1317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1318             <actions>
1319                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1320                 <retrieve/>
1321                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1322                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1323             </actions>
1324         </permacrud>
1325     </class>
1326
1327
1328         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1329                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1330                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1331                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1332                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1333                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1334                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1335                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1336             <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1337                 </fields>
1338                 <links>
1339             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1340             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1341                 </links>
1342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1343                         <actions>
1344                                 <retrieve/>
1345                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1346                         </actions>
1347                 </permacrud>
1348         </class>
1349
1350         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1351                 <fields oils_persist:primary="key">
1352                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1353                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1354                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1355                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1356                 </fields>
1357                 <links/>
1358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1359                         <actions>
1360                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1361                                 <retrieve/>
1362                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1363                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1364                         </actions>
1365                 </permacrud>
1366         </class>
1367
1368         <class id="atcol" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1369                 <fields oils_persist:primary="module">
1370                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1371                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1372                 </fields>
1373                 <links/>
1374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1375                         <actions>
1376                                 <retrieve/>
1377                         </actions>
1378                 </permacrud>
1379         </class>
1380
1381         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1382                 <fields oils_persist:primary="module">
1383                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1385                 </fields>
1386                 <links/>
1387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1388                         <actions>
1389                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1390                                 <retrieve/>
1391                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1392                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1393                         </actions>
1394                 </permacrud>
1395         </class>
1396
1397         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1398                 <fields oils_persist:primary="module">
1399                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1400                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1401                 </fields>
1402                 <links/>
1403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1404                         <actions>
1405                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1406                                 <retrieve/>
1407                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1408                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1409                         </actions>
1410                 </permacrud>
1411         </class>
1412
1413         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1414                 <fields oils_persist:primary="module">
1415                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                 </fields>
1418                 <links/>
1419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1420                         <actions>
1421                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1422                                 <retrieve/>
1423                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1424                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1425                         </actions>
1426                 </permacrud>
1427         </class>
1428
1429         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1430                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1431                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1432                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1433                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1434                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1435                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1436                 </fields>
1437                 <links>
1438                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1439                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1440                 </links>
1441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1442                         <actions>
1443                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1444                     <context link="event_def" field="owner"/>
1445                 </create>
1446                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1447                     <context link="event_def" field="owner"/>
1448                 </retrieve>
1449                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1450                     <context link="event_def" field="owner"/>
1451                 </update>
1452                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1453                     <context link="event_def" field="owner"/>
1454                 </delete>
1455                         </actions>
1456                 </permacrud>
1457         </class>
1458
1459         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1460                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1461                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1462                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1463                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1464                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1467                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1468                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1469                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1471                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1473                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1474                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1475                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1477                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1478                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1479                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1480                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1481                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1482                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1483                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1485                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1486                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1489                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1490                 </fields>
1491                 <links>
1492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1493                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1494                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1495                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1496                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1498                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1499                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1500                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1501                 </links>
1502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503                         <actions>
1504                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                         </actions>
1509                 </permacrud>
1510         </class>
1511
1512     <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1513         <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1514             <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1515             <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1516             <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1517             <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1518             <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1519             <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1520             <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1521         </fields>
1522         <links>
1523             <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1524             <link field="locale" relteype="has_a" key="code" map="" class="i18n_l"/>
1525          </links>
1526          <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1527              <actions>
1528                  <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1529                      <context link="event_def" field="owner"/>
1530                  </create>
1531                  <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1532                      <context link="event_def" field="owner"/>
1533                  </retrieve>
1534                  <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1535                      <context link="event_def" field="owner"/>
1536                  </update>
1537                  <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1538                      <context link="event_def" field="owner"/>
1539                  </delete>
1540             </actions>
1541         </permacrud>
1542     </class>
1543
1544
1545         <class id="atevdefg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group" oils_persist:tablename="action_trigger.event_def_group" reporter:label="Trigger Event Definition Group" oils_persist:restrict_primary="100">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1547                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1549                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1550                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1551                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1552                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1553                 </fields>
1554                 <links>
1555                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1556                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1557                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1558                 </links>
1559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560                         <actions>
1561                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1562                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1563                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1564                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1565                         </actions>
1566                 </permacrud>
1567         </class>
1568
1569         <class id="atevdefgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group_member" oils_persist:tablename="action_trigger.event_def_group_member" reporter:label="Trigger Event Definition Group Member">
1570                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1572                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1573                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1574                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1575                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1576                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1577                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1578                 </fields>
1579                 <links>
1580                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1581                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1582                 </links>
1583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1584                         <actions>
1585                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1586                     <context link="grp" field="owner"/>
1587                 </create>
1588                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1589                     <context link="grp" field="owner"/>
1590                 </retrieve>
1591                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1592                     <context link="grp" field="owner"/>
1593                 </update>
1594                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1595                     <context link="grp" field="owner"/>
1596                 </delete>
1597                         </actions>
1598                 </permacrud>
1599         </class>
1600
1601         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1602                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1603                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1604                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1605                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1606                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1607                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1608                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1609                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1610                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1611                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1612                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1613                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1614                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1615                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1616                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1617                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1618                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1619                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1620                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1621                 </fields>
1622                 <links>
1623                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1624                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1625                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1626                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1627                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1628                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1629                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1630                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1631                 </links>
1632         </class>
1633
1634         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1635                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1636                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1637                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1638                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1639                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1640                 </fields>
1641                 <links>
1642                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1643                 </links>
1644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1645                         <actions>
1646                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1647                     <context link="event_def" field="owner"/>
1648                 </create>
1649                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1650                     <context link="event_def" field="owner"/>
1651                 </retrieve>
1652                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1653                     <context link="event_def" field="owner"/>
1654                 </update>
1655                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1656                     <context link="event_def" field="owner"/>
1657                 </delete>
1658                         </actions>
1659                 </permacrud>
1660         </class>
1661
1662         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1663                 <oils_persist:source_definition><![CDATA[
1664                 SELECT  atevdef.hook,
1665                         atevdef.name,
1666                         atevdef.reactor,
1667                         atev.id,
1668                         atev.event_def,
1669                         atev.add_time,
1670                         atev.run_time,
1671                         atev.start_time,
1672                         atev.update_time,
1673                         atev.complete_time,
1674                         atev.update_process,
1675                         atev.state,
1676                         atev.user_data,
1677                         atev.template_output,
1678                         atev.error_output,
1679                         atev.async_output,
1680                         targ_circ.id AS target_circ,
1681                         targ_ahr.id AS target_hold,
1682                         COALESCE(
1683                                 targ_circ.circ_lib,
1684                                 targ_ahr.pickup_lib
1685                         ) AS perm_lib
1686                 FROM action_trigger.event atev
1687                 JOIN action_trigger.event_definition atevdef ON
1688                         (atevdef.id = atev.event_def)
1689                 JOIN action_trigger.hook ath ON
1690                         (ath.key = atevdef.hook)
1691                 LEFT JOIN action.circulation targ_circ ON
1692                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1693                 LEFT JOIN action.hold_request targ_ahr ON
1694                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1695                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1696                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1697                                 'circ.staff.max_visible_event_age',
1698                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1699                         ) UNION
1700                         SELECT '1000 YEARS'::INTERVAL AS value
1701                 ) ous)
1702                 ]]></oils_persist:source_definition>
1703                 <fields oils_persist:primary="id">
1704                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1705                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1706                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1707                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1708                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1709                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1710                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1711                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1712                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1713                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1714                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1715                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1716                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1717                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1718                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1719                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1720                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1721                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1722                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1723                 </fields>
1724                 <links>
1725                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1726                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1727                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1728                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1729                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1730                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1731                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1732                 </links>
1733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1734                         <actions>
1735                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1736                         </actions>
1737                 </permacrud>
1738         </class>
1739
1740         <class id="atoul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::optimized_user_log" reporter:label="Action Trigger Optimized User Log" oils_persist:readonly="true">
1741                 <oils_persist:source_definition><![CDATA[
1742                 SELECT  atevdef.hook,
1743                         atevdef.name,
1744                         atevdef.reactor,
1745                         atev.id,
1746                         atev.event_def,
1747                         atev.add_time,
1748                         atev.run_time,
1749                         atev.start_time,
1750                         atev.update_time,
1751                         atev.complete_time,
1752                         atev.update_process,
1753                         atev.state,
1754                         atev.user_data,
1755                         atev.template_output,
1756                         atev.error_output,
1757                         atev.async_output,
1758             atev.target,
1759                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1760                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1761             atev.context_user,
1762                         atev.context_library,
1763             atev.context_bib,
1764             atev.context_item,
1765             rssr.title,
1766             rssr.author
1767                 FROM action_trigger.event atev
1768                 JOIN action_trigger.event_definition atevdef ON
1769                         (atevdef.id = atev.event_def)
1770                 JOIN action_trigger.hook ath ON
1771                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1772         LEFT JOIN reporter.super_simple_record rssr ON
1773             (atev.context_bib = rssr.id)
1774                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1775                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1776                                 'circ.staff.max_visible_event_age',
1777                                 atev.context_library
1778                         ) UNION
1779                         SELECT '1000 YEARS'::INTERVAL AS value
1780                 ) ous)
1781                 ]]></oils_persist:source_definition>
1782                 <fields oils_persist:primary="id">
1783                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1785                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1786                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1787                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1788                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1789                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1790                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1791                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1792                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1793                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1794                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1795                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1796                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1797                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1798                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1799                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1800                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1801                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1802                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1803                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1804                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1805                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1806                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1807                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1808                 </fields>
1809                 <links>
1810                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1811                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1812                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1813                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1814                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1815                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1816                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1817                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1818                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1819                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1820                 </links>
1821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1822                         <actions>
1823                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1824                         </actions>
1825                 </permacrud>
1826         </class>
1827
1828         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1829                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1830                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1831                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1832                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1833                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1834                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1835                 </fields>
1836                 <links>
1837                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1838                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1839                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1840                 </links>
1841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1842                         <actions>
1843                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1844                         </actions>
1845                 </permacrud>
1846         </class>
1847
1848         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1849                 <fields oils_persist:primary="code">
1850                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1851                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1852                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1853                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1854                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1855                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1863                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1871                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1872                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1873                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1874                 </fields>
1875                 <links/>
1876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1877             <actions>
1878                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1879                 <retrieve/>
1880                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1881                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1882             </actions>
1883         </permacrud>
1884         </class>
1885
1886         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1887                 <fields oils_persist:primary="code">
1888                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1889                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1890                 </fields>
1891                 <links/>
1892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1893             <actions>
1894                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1895                 <retrieve/>
1896                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1897                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1898             </actions>
1899         </permacrud>
1900         </class>
1901
1902         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1903                 <fields oils_persist:primary="code">
1904                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1905                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1906                 </fields>
1907                 <links/>
1908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1909             <actions>
1910                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1913                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1914             </actions>
1915         </permacrud>
1916         </class>
1917
1918         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1919                 <fields oils_persist:primary="code">
1920                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1921                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1922                 </fields>
1923                 <links/>
1924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1925             <actions>
1926                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1927                 <retrieve/>
1928                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1929                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1930             </actions>
1931         </permacrud>
1932         </class>
1933
1934         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1935                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1936                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1937                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1938                 </fields>
1939                 <links/>
1940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1941             <actions>
1942                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1943                 <retrieve/>
1944                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1945                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1946             </actions>
1947         </permacrud>
1948         </class>
1949
1950         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1951                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1952                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1953                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1954                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1955                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1956                 </fields>
1957         <links>
1958             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1959             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1960             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1961         </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="UPDATE_COPY">
1965                     <context link="target_copy" field="circ_lib"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="UPDATE_COPY">
1969                     <context link="target_copy" field="circ_lib"/>
1970                 </update>
1971                 <delete permission="UPDATE_COPY">
1972                     <context link="target_copy" field="circ_lib"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977
1978         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1979                 <fields oils_persist:primary="code">
1980                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1981                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1982                 </fields>
1983                 <links/>
1984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1985             <actions>
1986                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1987                 <retrieve/>
1988                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1989                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1990             </actions>
1991         </permacrud>
1992         </class>
1993
1994         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1995                 <fields oils_persist:primary="code">
1996                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1997                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1998                 </fields>
1999                 <links/>
2000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2001             <actions>
2002                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
2003                 <retrieve/>
2004                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
2005                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
2006             </actions>
2007         </permacrud>
2008         </class>
2009
2010         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
2011                 <fields oils_persist:primary="code">
2012                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
2013                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2014                 </fields>
2015                 <links/>
2016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2017             <actions>
2018                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2019                 <retrieve/>
2020                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2021                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2022             </actions>
2023         </permacrud>
2024         </class>
2025
2026     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
2027         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
2028             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2029             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2030             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
2031             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
2032             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
2033             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2034             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2035             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2036             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2037             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2038             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2039             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2040             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2041             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2042             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2043             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2044             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2045         </fields>
2046         <links/>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2050                 <retrieve/>
2051                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2052                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
2058         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2059             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2060             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2061             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2062             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2063             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2064             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2065             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2066             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2067             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2068             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2069             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2070             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2071             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2072             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2073             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2074             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2075             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2076             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2077             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2078         </fields>
2079         <links/>
2080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2081             <actions>
2082                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2083                 <retrieve/>
2084                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2085                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2086             </actions>
2087         </permacrud>
2088     </class>
2089
2090     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
2091         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2092             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2093             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2094             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2095             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2096             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2097         </fields>
2098         <links>
2099             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2100             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2101             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2102         </links>
2103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2104             <actions>
2105                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2106                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2107                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2108                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2109             </actions>
2110         </permacrud>
2111     </class>
2112
2113         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
2114                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2115                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2116                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2117                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2118                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2120                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2121                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2122                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2123                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2124                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2125                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2127                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2128                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2129                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2130                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2131             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2132                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2133                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2134                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2135                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2136                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2137                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2138                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2139                 </fields>
2140                 <links>
2141                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2142                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2147                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2149                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2150                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2151                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2152                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2153                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2154             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2155                 </links>
2156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2157             <actions>
2158                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2159                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162             </actions>
2163         </permacrud>
2164         </class>
2165
2166         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
2167                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2168                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2169                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2170                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2172                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2173                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2175                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2176                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2177                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2178                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2183             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2184                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2185                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2186             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2187                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2188                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2189                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2191             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2192             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2193             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2194                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2195                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2196                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2197                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2198                 </fields>
2199                 <links>
2200                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2201                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2202                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2205                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2206                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2207                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2208                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2209                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2210                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2211                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2212                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2213                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2214             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2215                 </links>
2216         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217             <actions>
2218                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2219                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2220                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222             </actions>
2223         </permacrud>
2224         </class>
2225
2226     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
2227         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2228             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2229             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2230             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2231         </fields>
2232         <links/>
2233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2234             <actions>
2235                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2236                 <retrieve/>
2237                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2239             </actions>
2240         </permacrud>
2241     </class>
2242
2243     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
2244         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2245             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2246             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2247             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2248             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2249             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2250             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2251             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2252         </fields>
2253         <links>
2254             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2255         </links>
2256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2257             <actions>
2258                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2259                 <retrieve/>
2260                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2262             </actions>
2263         </permacrud>
2264     </class>
2265
2266     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2267         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2268             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2269             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2270             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2271             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2272             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2273         </fields>
2274         <links>
2275             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2276             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2277         </links>
2278         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2279             <actions>
2280                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2281                     <context link="matchpoint" field="org_unit"/>
2282                 </create>
2283                 <retrieve/>
2284                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2285                     <context link="matchpoint" field="org_unit"/>
2286                 </update>
2287                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2288                     <context link="matchpoint" field="org_unit"/>
2289                 </delete>
2290             </actions>
2291         </permacrud>
2292     </class>
2293
2294     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2295         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2296             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2297             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2298             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2299         </fields>
2300         <links>
2301             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2302             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2303         </links>
2304         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2305             <actions>
2306                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2307                     <context link="limit_set" field="owning_lib"/>
2308                 </create>
2309                 <retrieve/>
2310                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2311                     <context link="limit_set" field="owning_lib"/>
2312                 </update>
2313                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2314                     <context link="limit_set" field="owning_lib"/>
2315                 </delete>
2316             </actions>
2317         </permacrud>
2318     </class>
2319     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2320         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2321             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2322             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2323             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2324         </fields>
2325         <links>
2326             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2327             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2328         </links>
2329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2330             <actions>
2331                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                     <context link="limit_set" field="owning_lib"/>
2333                 </create>
2334                 <retrieve/>
2335                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2336                     <context link="limit_set" field="owning_lib"/>
2337                 </update>
2338                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2339                     <context link="limit_set" field="owning_lib"/>
2340                 </delete>
2341             </actions>
2342         </permacrud>
2343     </class>
2344
2345     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2346         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2347             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2348             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2349             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2350             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2351         </fields>
2352         <links>
2353             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2354             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2355         </links>
2356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2357             <actions>
2358                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2359                     <context link="limit_set" field="owning_lib"/>
2360                 </create>
2361                 <retrieve/>
2362                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2363                     <context link="limit_set" field="owning_lib"/>
2364                 </update>
2365                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2366                     <context link="limit_set" field="owning_lib"/>
2367                 </delete>
2368             </actions>
2369         </permacrud>
2370     </class>
2371
2372         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2373                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2374                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2375                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2376                 </fields>
2377                 <links/>
2378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2379             <actions>
2380                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2381                 <retrieve/>
2382                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387
2388         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2389                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2390                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2391                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2392                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2394                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2395                 </fields>
2396                 <links>
2397                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2398                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2399                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2400                 </links>
2401         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2402             <actions>
2403                 <create permission="ADMIN_SURVEY">
2404                     <context link="survey" field="owner"/>
2405                 </create>
2406                 <retrieve/>
2407                 <update permission="ADMIN_SURVEY">
2408                     <context link="survey" field="owner"/>
2409                 </update>
2410                 <delete permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </delete>
2413             </actions>
2414         </permacrud>
2415         </class>
2416         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2417                 <fields oils_persist:primary="id" oils_persist:sequence="">
2418                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2419                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2420                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2423                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2424                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2425                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2426                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2427                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2428                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2429                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2430                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2431                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2432                 </fields>
2433                 <links>
2434                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2435                 </links>
2436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2437                         <actions>
2438                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2439                                         <context link="usr" field="home_ou" />
2440                                 </retrieve>
2441                         </actions>
2442                 </permacrud>
2443         </class>
2444         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2445                 <fields oils_persist:primary="id" oils_persist:sequence="">
2446                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2447                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2448                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2449                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2450                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2451                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2452                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2453                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2454                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2455                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2456                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2457                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2458                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2459                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2460                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2461                 </fields>
2462                 <links>
2463                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2464                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2465                 </links>
2466         </class>
2467         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2468                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2469                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2470                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2471                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2472                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2473                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2474                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2475                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2476                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2477                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2478                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2479                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2480                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2481                 </fields>
2482                 <links>
2483                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2485                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2486                 </links>
2487                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488                         <actions> <!-- created magically, so no create action -->
2489                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2490                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2491                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2496                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2497                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2499                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2500                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2501                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2502                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2503                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2504                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2505                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2506                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2507                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2508                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2509                 </fields>
2510                 <links>
2511                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2512                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2513                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2514                 </links>
2515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2516                         <actions> <!-- created magically, so no create action -->
2517                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2518                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2519                         </actions>
2520                 </permacrud>
2521         </class>
2522         <class id="aump" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_penalty" oils_persist:tablename="actor.usr_message_penalty" reporter:label="User Message Penalty">
2523         <fields oils_persist:primary="id">
2524                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2525                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2526                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2527                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2530                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2531                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2533                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2534                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2535                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2536                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2537                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2538                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2539                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2540                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2541                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2542                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2543                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2545                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2546                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2547                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2548                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2549                 </fields>
2550                 <links>
2551                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2552                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2553                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2554                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2555                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2559                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2560                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2562                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2563                 </links>
2564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2565                         <actions> <!-- created magically, so no create action -->
2566                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2567                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571
2572         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2573                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2574                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2576                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2577                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2578                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2579                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2580                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2581                 </fields>
2582                 <links>
2583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2584                 </links>
2585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2586                         <actions>
2587                                 <create permission="UPDATE_USER">
2588                                         <context link="usr" field="home_ou"/>
2589                                 </create>
2590                                 <retrieve permission="VIEW_USER">
2591                                         <context link="usr" field="home_ou"/>
2592                                 </retrieve>
2593                                 <update permission="UPDATE_USER">
2594                                         <context link="usr" field="home_ou"/>
2595                                 </update>
2596                                 <delete permission="UPDATE_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </delete>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2604                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2605                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2606                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2607                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2608                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2609                 </fields>
2610                 <links>
2611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2612                 </links>
2613         </class>
2614         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2616                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2617                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2618                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2619                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2620                 </fields>
2621                 <links>
2622                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2623                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <retrieve permission="VIEW_USER">
2628                                         <context link="usr" field="home_ou" />
2629                                 </retrieve>
2630                         </actions>
2631                 </permacrud>
2632         </class>
2633         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2634                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2635                         <field name="field" reporter:datatype="link"/>
2636                         <field name="id" reporter:datatype="id" />
2637                         <field name="source" reporter:datatype="link"/>
2638                         <field name="value" reporter:datatype="text"/>
2639                 </fields>
2640                 <links>
2641                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2642                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2643                 </links>
2644         </class>
2645         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2647                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2648                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2649                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2650                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2651                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2652                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2653                 </fields>
2654                 <links>
2655                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2656                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2657                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2658                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2659                 </links>
2660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2661                         <actions>
2662                                 <retrieve/>
2663                         </actions>
2664                 </permacrud>
2665         </class>
2666         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2667                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2668                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2669                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2670                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2671                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2672                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2673                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2674                 </fields>
2675                 <links>
2676                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2677                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2678                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2679                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2680                 </links>
2681                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2682                         <actions>
2683                                 <retrieve/>
2684                         </actions>
2685                 </permacrud>
2686         </class>
2687         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2689                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2690                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2691                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2692                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2693                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2694                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2695                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2696                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2697                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2698                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2699                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2701                 </fields>
2702                 <links>
2703                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2704                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2705                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2706                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2707                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2709                 </links>
2710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2711             <actions>
2712                 <create permission="TRANSIT_COPY" context_field="owner">
2713                     <context link="target_copy" field="circ_lib"/>
2714                 </create>
2715                 <retrieve/>
2716                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2717                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2723                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2724                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2725                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2726                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2727                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2728                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2729                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2730                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2731                 </fields>
2732                 <links>
2733                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2734                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2735                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2736                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2737                 </links>
2738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739             <actions>
2740                 <create permission="ADMIN_SURVEY">
2741                     <context link="survey" field="owner"/>
2742                 </create>
2743                 <retrieve permission="VIEW_USER">
2744                     <context link="usr" field="home_ou"/>
2745                 </retrieve>
2746                 <update permission="ADMIN_SURVEY">
2747                     <context link="survey" field="owner"/>
2748                 </update>
2749                 <delete permission="ADMIN_SURVEY">
2750                     <context link="survey" field="owner"/>
2751                 </delete>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2757                         <field name="bucket" reporter:datatype="link"/>
2758                         <field name="id" reporter:datatype="id" />
2759                         <field name="target_copy" reporter:datatype="link"/>
2760                         <field name="create_time" reporter:datatype="timestamp" />
2761                         <field name="pos" reporter:datatype="int" />
2762                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2763                 </fields>
2764                 <links>
2765                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2766                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2767             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <retrieve permission="ADMIN_COPY_BUCKET">
2772                     <context link="bucket" field="owning_lib"/>
2773                 </retrieve>
2774             </actions>
2775         </permacrud>
2776         </class>
2777         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2778                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2779                         <field name="id" reporter:datatype="id" />
2780                         <field name="item" reporter:datatype="link"/>
2781                         <field name="note" reporter:datatype="text" />
2782                 </fields>
2783                 <links>
2784                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2785                 </links>
2786         </class>
2787
2788         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2789                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2790                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2791                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2792                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2793                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2794                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2795                 </fields>
2796                 <links>
2797                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2798                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2799                 </links>
2800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2801                         <actions>
2802                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2803                                 <retrieve/>
2804                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                         </actions>
2807                 </permacrud>
2808         </class>
2809
2810         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2811                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2812                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2813                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2814                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2815                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2816                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2817                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2818                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2819                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2820                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2821                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2822                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2823                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2824                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2827                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2828                 </fields>
2829                 <links>
2830                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2831                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2832                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2833                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2834                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2835                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2836                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2837                 </links>
2838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2839                         <actions>
2840                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2841                                 <retrieve/>
2842                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2844                         </actions>
2845                 </permacrud>
2846         </class>
2847
2848         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2849                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2850                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2851                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2852                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2853                 </fields>
2854                 <links>
2855                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2856                 </links>
2857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2858                         <actions>
2859                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2860                                 <retrieve/>
2861                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2863                         </actions>
2864                 </permacrud>
2865         </class>
2866
2867         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2868                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2869                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2870                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2871                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2872                 </fields>
2873                 <links>
2874                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2875                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2880                                 <retrieve/>
2881                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886
2887         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2888                 <fields oils_persist:primary="code">
2889                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2890                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2891                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2892                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2893                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2894                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2895                 </fields>
2896                 <links>
2897                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2898                 </links>
2899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2900                         <actions>
2901                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2902                                 <retrieve/>
2903                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2905                         </actions>
2906                 </permacrud>
2907         </class>
2908
2909         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2910                 <fields oils_persist:primary="code">
2911                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2912                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2913                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2914                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2915                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2916                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2917                 </fields>
2918                 <links>
2919                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2920                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2921                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2922                 </links>
2923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2924                         <actions>
2925                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2926                                 <retrieve/>
2927                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2929                         </actions>
2930                 </permacrud>
2931         </class>
2932
2933     <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2934         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2935             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2936             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2937             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2938         </fields>
2939         <links>
2940             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2941             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2942         </links>
2943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2944             <actions>
2945                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2946                 <retrieve/>
2947                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2949             </actions>
2950         </permacrud>
2951     </class>
2952
2953         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2954                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2955                         <field name="active" reporter:datatype="bool"/>
2956                         <field name="create_date" reporter:datatype="timestamp"/>
2957                         <field name="creator" />
2958                         <field name="deleted" reporter:datatype="bool"/>
2959                         <field name="edit_date" reporter:datatype="timestamp"/>
2960                         <field name="editor" />
2961                         <field name="id" reporter:datatype="id" />
2962                         <field name="last_xact_id" />
2963                         <field name="marc" />
2964                         <field name="source" />
2965                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2966                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2967                         <field name="heading" />
2968                         <field name="simple_heading" />
2969                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2970                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2971                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2972                 </fields>
2973                 <links>
2974                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2976                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2977                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2978                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2979                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2980                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2981                 </links>
2982                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2983                         <actions>
2984                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2985                                 <retrieve/>
2986                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2987                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2988                         </actions>
2989                 </permacrud>
2990         </class>
2991         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2992                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2993                         <field name="char_encoding" />
2994                         <field name="id" />
2995                         <field name="record" />
2996                         <field name="record_status" />
2997                         <field name="thesaurus" />
2998                 </fields>
2999                 <links>
3000                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3001                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3002                 </links>
3003         </class>
3004         <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
3005                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3006                         <field name="id" reporter:datatype="id" />
3007                         <field name="bib" reporter:datatype="link" />
3008                         <field name="authority" reporter:datatype="link" />
3009                 </fields>
3010                 <links>
3011                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3012                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3013                 </links>
3014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3015                         <actions>
3016                                 <retrieve/>
3017                         </actions>
3018                 </permacrud>
3019         </class>
3020         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3021                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3022                         <field name="id" reporter:datatype="id" />
3023                         <field name="record" reporter:datatype="link" />
3024                         <field name="atag" reporter:datatype="link" />
3025                         <field name="value" reporter:datatype="text" />
3026                         <field name="thesaurus" reporter:datatype="text" />
3027                 </fields>
3028                 <links>
3029                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3030                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3031                 </links>
3032         </class>
3033
3034         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
3035                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3036                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3037                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3038                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3039                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3040                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3041                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3042                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3043                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3044                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3045                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3046                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3047                 </fields>
3048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3049                         <actions>
3050                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3051                                 <retrieve/>
3052                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3054                         </actions>
3055                 </permacrud>
3056         </class>
3057
3058         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
3059                 <fields oils_persist:primary="code" oils_persist:sequence="">
3060                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3061                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3062                 </fields>
3063                 <links/>
3064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3065             <actions>
3066                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3067                 <retrieve/>
3068                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3069                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3070             </actions>
3071         </permacrud>
3072         </class>
3073         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
3074                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3075                         <field name="accepting_usr" />
3076                         <field name="amount" reporter:datatype="money" />
3077                         <field name="amount_collected" reporter:datatype="money" />
3078                         <field name="approval_code" reporter:datatype="text"/>
3079                         <field name="cash_drawer" reporter:datatype="link"/>
3080                         <field name="cc_number" reporter:datatype="text"/>
3081                         <field name="cc_order_number" reporter:datatype="text"/>
3082                         <field name="cc_processor" reporter:datatype="text"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="note" reporter:datatype="text"/>
3085                         <field name="payment_ts" reporter:datatype="timestamp"/>
3086                         <field name="xact" reporter:datatype="link"/>
3087                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3088                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3089                 </fields>
3090                 <links>
3091                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3092                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3093                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3094                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3095                 </links>
3096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3097             <actions>
3098                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3099                     <context link="xact" jump="usr" field="home_ou"/>
3100                 </retrieve>
3101                         </actions>
3102                 </permacrud>
3103         </class>
3104         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition" oils_persist:field_safe="true">
3105                 <fields oils_persist:primary="name">
3106                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3107                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3108                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3109                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3110                 </fields>
3111                 <links/>
3112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3113             <actions>
3114                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3115                 <retrieve/>
3116                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3117                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3118             </actions>
3119         </permacrud>
3120         </class>
3121
3122         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
3123                 <fields oils_persist:primary="alias">
3124                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3125                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3126                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3127                 </fields>
3128                 <links>
3129                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3130                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3131                 </links>
3132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3133             <actions>
3134                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3135                 <retrieve/>
3136                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3138             </actions>
3139         </permacrud>
3140         </class>
3141
3142         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
3143                 <fields oils_persist:primary="name">
3144                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3145                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3146                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3147                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3148                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3149                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3150                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3151                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3152                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3153                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3154                 </fields>
3155                 <links>
3156                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3157                 </links>
3158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3159             <actions>
3160                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3161                 <retrieve/>
3162                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3163                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3164             </actions>
3165         </permacrud>
3166         </class>
3167
3168         <class id="cmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field" oils_persist:tablename="config.metabib_field" reporter:label="Metabib Field" oils_persist:field_safe="true">
3169                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3171                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3172                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3173                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3174                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3175                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3176                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3177                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3178                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3179                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3180                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3181                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3182                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3183                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3184                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3185                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3186                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3187                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3188                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3189                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3190                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3191                 </fields>
3192                 <links>
3193                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3194                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3195                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3196                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3197                 </links>
3198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3199             <actions>
3200                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3201                 <retrieve/>
3202                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3203                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3204             </actions>
3205         </permacrud>
3206         </class>
3207
3208         <class id="cmfvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_virtual_map" oils_persist:tablename="config.metabib_field_virtual_map" reporter:label="Metabib Field Virtual Map" oils_persist:field_safe="true">
3209                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3210                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3211                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3212                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3213                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3214                 </fields>
3215                 <links>
3216                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3217                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3218                 </links>
3219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3220             <actions>
3221                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3222                 <retrieve/>
3223                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3224                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3225             </actions>
3226         </permacrud>
3227         </class>
3228
3229         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
3230                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3231                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3232                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3233                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3234                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3235                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3236                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3237                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3238                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3239                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3240                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3241                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3242                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3243                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3244                 </fields>
3245                 <links>
3246                 </links>
3247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248                         <actions>
3249                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3250                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3251                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3252                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3253                         </actions>
3254                 </permacrud>
3255         </class>
3256         <class id="cbfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::biblio_fingerprint" oils_persist:tablename="config.biblio_fingerprint" reporter:label="Fingerprint Definition">
3257                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3258                         <field name="id" reporter:datatype="id" />
3259                         <field name="name" reporter:datatype="text"/>
3260                         <field name="xpath" reporter:datatype="text"/>
3261                         <field name="format" reporter:datatype="link"/>
3262                         <field name="first_word" reporter:datatype="bool" />
3263                 </fields>
3264                 <links/>
3265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266             <actions>
3267                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3268                 <retrieve/>
3269                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3270                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3271             </actions>
3272         </permacrud>
3273         </class>
3274         <class id="cam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::audience_map" oils_persist:tablename="config.audience_map" reporter:label="Audience Map" oils_persist:field_safe="true">
3275                 <fields oils_persist:primary="code" oils_persist:sequence="">
3276                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3277                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3278                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3279                 </fields>
3280                 <links/>
3281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3282             <actions>
3283                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3284                 <retrieve/>
3285                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3286                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3287             </actions>
3288         </permacrud>
3289         </class>
3290         <class id="cifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_form_map" oils_persist:tablename="config.item_form_map" reporter:label="Item Form Map" oils_persist:field_safe="true">
3291                 <fields oils_persist:primary="code" oils_persist:sequence="">
3292                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3293                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297             <actions>
3298                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3299                 <retrieve/>
3300                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3301                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3302             </actions>
3303         </permacrud>
3304         </class>
3305     <class id="acmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course" oils_persist:tablename="asset.course_module_course" reporter:label="Course">
3306         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3307             <field reporter:label="ID" name="id" reporter:datatype="id" />
3308             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3309             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3310             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3311             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3312             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3313             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3314             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3315                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3316         </fields>
3317         <links>
3318             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3319             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3320             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3321                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3322         </links>
3323         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3324             <actions>
3325                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3326                 <retrieve/>
3327                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3328                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3329             </actions>
3330         </permacrud>
3331     </class>
3332     <class id="acmcu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_users" oils_persist:tablename="asset.course_module_course_users" reporter:label="Course Users">
3333         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3334             <field reporter:label="ID" name="id" reporter:datatype="id" />
3335             <field reporter:label="Course" name="course" reporter:datatype="link" />
3336             <field reporter:label="User" name="usr" reporter:datatype="link" />
3337             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3338         </fields>
3339         <links>
3340             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3341             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3342             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3343         </links>
3344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3345             <actions>
3346                 <create permission="MANAGE_RESERVES">
3347                                         <context link="course" field="owning_lib" />
3348                 </create>
3349                 <retrieve/>
3350                 <update permission="MANAGE_RESERVES">
3351                                         <context link="course" field="owning_lib" />
3352                 </update>
3353                 <delete permission="MANAGE_RESERVES">
3354                                         <context link="course" field="owning_lib" />
3355                 </delete>
3356             </actions>
3357         </permacrud>
3358     </class>
3359     <class id="acmcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_materials" oils_persist:tablename="asset.course_module_course_materials" reporter:label="Course Materials" oils_persist:field_safe="true">
3360         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3361             <field reporter:label="ID" name="id" reporter:datatype="id" />
3362             <field reporter:label="Course" name="course" reporter:datatype="link" />
3363             <field reporter:label="Item" name="item" reporter:datatype="link" />
3364             <field reporter:label="Record" name="record" reporter:datatype="link" />
3365             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3366             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3367             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3368             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3369             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3370             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3371             <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link" />
3372         </fields>
3373         <links>
3374             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3375             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3376             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3377             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3378             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3379             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3380             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3381             <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou" />
3382         </links>
3383         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3384             <actions>
3385                 <create permission="MANAGE_RESERVES">
3386                                         <context link="course" field="owning_lib" />
3387                 </create>
3388                 <retrieve/>
3389                 <update permission="MANAGE_RESERVES">
3390                                         <context link="course" field="owning_lib" />
3391                 </update>
3392                 <delete permission="MANAGE_RESERVES">
3393                                         <context link="course" field="owning_lib" />
3394                 </delete>
3395             </actions>
3396         </permacrud>
3397     </class>
3398         <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">
3399                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3400                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3401                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3402             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3403                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3404                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3405                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3406                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3407                 </fields>
3408                 <links>
3409             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3410                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3411                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3412                 </links>
3413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3414                         <actions>
3415                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3416                                 <retrieve/>
3417                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3418                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3419                         </actions>
3420                 </permacrud>
3421         </class>
3422     <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">
3423         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3424             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3425             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3426             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3427         </fields>
3428         <links>
3429             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3430             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3431         </links>
3432         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3433             <actions>
3434                 <create permission="MANAGE_RESERVES">
3435                                         <context link="course" field="owning_lib" />
3436                 </create>
3437                 <retrieve/>
3438                 <update permission="MANAGE_RESERVES">
3439                                         <context link="course" field="owning_lib" />
3440                 </update>
3441                 <delete permission="MANAGE_RESERVES">
3442                                         <context link="course" field="owning_lib" />
3443                 </delete>
3444             </actions>
3445         </permacrud>
3446     </class>
3447         <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">
3448                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3449                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3450                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3451             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3452                 </fields>
3453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3454                         <actions>
3455                                 <create permission="MANAGE_RESERVES" global_required="true" />
3456                                 <retrieve/>
3457                                 <update permission="MANAGE_RESERVES" global_required="true" />
3458                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3459                         </actions>
3460                 </permacrud>
3461         </class>
3462         
3463     <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">
3464         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3465             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3466             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3467             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3468             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3469         </fields>
3470         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3471             <actions>
3472                 <retrieve/>
3473             </actions>
3474         </permacrud>
3475     </class>
3476         <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">
3477                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3478                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3479                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3480                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3481                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3482                 </fields>
3483                 <links>
3484                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3485                 </links>
3486         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3487             <actions>
3488                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3489                 <retrieve/>
3490                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3491                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3492             </actions>
3493         </permacrud>
3494         </class>
3495         <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">
3496                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3497                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3498                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3499                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3500                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3501                 </fields>
3502                 <links>
3503                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3504                 </links>
3505         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3506             <actions>
3507                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3508                 <retrieve/>
3509                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3510                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3511             </actions>
3512         </permacrud>
3513         </class>
3514         <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">
3515                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3516                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3517                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3518                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3519                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3520                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3521                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3522                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3523                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3524                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3525                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3526                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3527                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3528                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3529                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3530                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3531                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3532                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3533                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3534                 </fields>
3535                 <links>
3536                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3537                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3538                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3539                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3540                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3541                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3542                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3543                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3544                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3545                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3546                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3547                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3548                 </links>
3549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3550             <actions>
3551                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3552                 <retrieve/>
3553                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3554                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3555             </actions>
3556         </permacrud>
3557         </class>
3558         <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">
3559                 <fields oils_persist:primary="call_number">
3560                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3561                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3562                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3563                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3564                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3565                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3566                 </fields>
3567                 <links>
3568                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3569                 </links>
3570         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3571             <actions>
3572                 <retrieve/>
3573             </actions>
3574         </permacrud>
3575         </class>
3576         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3577                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3578                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3579                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3580                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3581                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3582                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3583                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3584                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3585                 </fields>
3586                 <links>
3587                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3588                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3589         </links>
3590         </class>
3591         <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">
3592                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3593                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3594                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3595                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3596                 </fields>
3597                 <links>
3598                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3599                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3600                 </links>
3601         </class>
3602         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3603                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3604                         <field name="id" reporter:datatype="id" />
3605                         <field name="value" oils_persist:i18n="true" />
3606                 </fields>
3607                 <links/>
3608         </class>
3609         <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">
3610                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3611                         <field name="balance_owed" reporter:datatype="money" />
3612                         <field name="total_owed" reporter:datatype="money" />
3613                         <field name="total_paid" reporter:datatype="money" />
3614                         <field name="usr" reporter:datatype="link"/>
3615                 </fields>
3616                 <links>
3617                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3618         </links>
3619         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3620             <actions>
3621                 <retrieve permission="VIEW_USER">
3622                     <context link="usr" field="home_ou"/>
3623                 </retrieve>
3624             </actions>
3625         </permacrud>
3626         </class>
3627         <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">
3628                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3629                         <field name="balance_owed" reporter:datatype="money" />
3630                         <field name="total_owed" reporter:datatype="money" />
3631                         <field name="total_paid" reporter:datatype="money" />
3632                         <field name="usr" reporter:datatype="link"/>
3633                 </fields>
3634                 <links>
3635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3636         </links>
3637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3638             <actions>
3639                 <retrieve permission="VIEW_USER">
3640                     <context link="usr" field="home_ou"/>
3641                 </retrieve>
3642             </actions>
3643         </permacrud>
3644         </class>
3645         <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">
3646                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3647                         <field name="collector" />
3648                         <field name="enter_time" reporter:datatype="timestamp"/>
3649                         <field name="id" reporter:datatype="id" />
3650                         <field name="location" reporter:datatype="link"/>
3651                         <field name="usr" reporter:datatype="link"/>
3652                 </fields>
3653                 <links>
3654                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3655                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3656                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3657                 </links>
3658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3659             <actions>
3660                 <create permission="money.collections_tracker.create" context_field="location"/>
3661                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3662                 <delete permission="money.collections_tracker.create" context_field="location"/>
3663             </actions>
3664         </permacrud>
3665         </class>
3666         <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">
3667                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3668                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3669                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3670                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3671                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3672                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3673                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3674                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3675                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3676                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3677                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3678                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3679                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3680                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3681                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3682                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3683                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3684                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3685                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3686                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3687                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3688                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3704                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3705                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3706                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3707                 </fields>
3708                 <links>
3709                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3710                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3711                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3712                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3713                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3714                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3715                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3716                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3717                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3718                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3719                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3720                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3721                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3722                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3723                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3724                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3725                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3726                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3727                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3728                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3729                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3730                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3731                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3732                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3733                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3734                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3735                 </links>
3736         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3737             <actions>
3738                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3739                 <retrieve/>
3740                 <update permission="UPDATE_MARC" global_required="true"/>
3741                 <!-- 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. -->
3742                 <delete permission="DELETE_RECORD" global_required="true"/>
3743             </actions>
3744         </permacrud>
3745         </class>
3746         <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">
3747                 <fields oils_persist:primary="id">
3748                         <field name="dow_0_close" />
3749                         <field name="dow_0_open" />
3750                         <field name="dow_0_note"  reporter:datatype="text" />
3751                         <field name="dow_1_close" />
3752                         <field name="dow_1_open" />
3753                         <field name="dow_1_note"  reporter:datatype="text" />
3754                         <field name="dow_2_close" />
3755                         <field name="dow_2_open" />
3756                         <field name="dow_2_note"  reporter:datatype="text" />
3757                         <field name="dow_3_close" />
3758                         <field name="dow_3_open" />
3759                         <field name="dow_3_note"  reporter:datatype="text" />
3760                         <field name="dow_4_close" />
3761                         <field name="dow_4_open" />
3762                         <field name="dow_4_note"  reporter:datatype="text" />
3763                         <field name="dow_5_close" />
3764                         <field name="dow_5_open" />
3765                         <field name="dow_5_note"  reporter:datatype="text" />
3766                         <field name="dow_6_close" />
3767                         <field name="dow_6_open" />
3768                         <field name="dow_6_note"  reporter:datatype="text" />
3769                         <field name="id" reporter:datatype="id" />
3770                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3771                 </fields>
3772                 <links>
3773                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3774                 </links>
3775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3776             <actions>
3777                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3778                 <retrieve/>
3779                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3780                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3781             </actions>
3782         </permacrud>
3783         </class>
3784         <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">
3785                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3786                         <field name="id" reporter:datatype="id" />
3787                         <field name="record" reporter:datatype="link"/>
3788                         <field name="label" reporter:datatype="text"/>
3789                         <field name="label_sortkey" reporter:datatype="text"/>
3790                         <field name="deleted" reporter:datatype="bool"/>
3791                 </fields>
3792                 <links>
3793                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3794                 </links>
3795         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3796             <actions>
3797                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3798                 <retrieve/>
3799                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3800                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3801             </actions>
3802         </permacrud>
3803         </class>
3804         <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">
3805                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3806                         <field name="id" reporter:datatype="id" />
3807                         <field name="target_copy" reporter:datatype="link" />
3808                         <field name="part" reporter:datatype="link"/>
3809                 </fields>
3810                 <links>
3811                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3812                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3813                 </links>
3814         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3815             <actions>
3816                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3817                 <retrieve/>
3818                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3819                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3820             </actions>
3821         </permacrud>
3822         </class>
3823     <class  id="aecc"
3824             controller="open-ils.cstore open-ils.pcrud"
3825             oils_obj:fieldmapper="action::emergency_closing_circulation"
3826             oils_persist:tablename="action.emergency_closing_circulation"
3827             reporter:label="Emergency Closing Circulation Entry"
3828             oils_persist:readonly="true"
3829     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3830         <fields oils_persist:primary="id">
3831             <field name="id" reporter:datatype="id" />
3832             <field name="circulation" reporter:datatype="link" />
3833                         <field name="emergency_closing" reporter:datatype="link"/>
3834             <field name="original_due_date" reporter:datatype="timestamp" />
3835             <field name="process_time" reporter:datatype="timestamp" />
3836         </fields>
3837         <links>
3838             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3839             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3840         </links>
3841         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3842             <actions>
3843                 <retrieve/>
3844             </actions>
3845         </permacrud>
3846     </class>
3847     <class  id="aecr"
3848             controller="open-ils.cstore open-ils.pcrud"
3849             oils_obj:fieldmapper="action::emergency_closing_reservation"
3850             oils_persist:tablename="action.emergency_closing_reservation"
3851             reporter:label="Emergency Closing Reservation Entry"
3852             oils_persist:readonly="true"
3853     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3854         <fields oils_persist:primary="id">
3855             <field name="id" reporter:datatype="id" />
3856             <field name="reservation" reporter:datatype="link" />
3857                         <field name="emergency_closing" reporter:datatype="link"/>
3858             <field name="original_end_time" reporter:datatype="timestamp" />
3859             <field name="process_time" reporter:datatype="timestamp" />
3860         </fields>
3861         <links>
3862             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3863             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3864         </links>
3865         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3866             <actions>
3867                 <retrieve/>
3868             </actions>
3869         </permacrud>
3870     </class>
3871     <class  id="aech"
3872             controller="open-ils.cstore open-ils.pcrud"
3873             oils_obj:fieldmapper="action::emergency_closing_hold"
3874             oils_persist:tablename="action.emergency_closing_hold"
3875             reporter:label="Emergency Closing Hold Entry"
3876             oils_persist:readonly="true"
3877     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3878         <fields oils_persist:primary="id">
3879             <field name="id" reporter:datatype="id" />
3880             <field name="hold" reporter:datatype="link" />
3881                         <field name="emergency_closing" reporter:datatype="link"/>
3882             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3883             <field name="process_time" reporter:datatype="timestamp" />
3884         </fields>
3885         <links>
3886             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3887             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3888         </links>
3889         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3890             <actions>
3891                 <retrieve/>
3892             </actions>
3893         </permacrud>
3894     </class>
3895     <class  id="aecs"
3896             controller="open-ils.cstore open-ils.pcrud"
3897             oils_obj:fieldmapper="action::emergency_closing_status"
3898             oils_persist:tablename="action.emergency_closing_status"
3899             reporter:label="Emergency Closing Status"
3900             oils_persist:readonly="true"
3901     >
3902         <fields oils_persist:primary="id">
3903             <field name="id" reporter:datatype="id" />
3904             <field name="creator" reporter:datatype="link" />
3905             <field name="create_time" reporter:datatype="timestamp" />
3906             <field name="process_start_time" reporter:datatype="timestamp" />
3907             <field name="process_end_time" reporter:datatype="timestamp" />
3908             <field name="last_update_time" reporter:datatype="timestamp" />
3909             <field name="circulations" reporter:datatype="int" />
3910             <field name="circulations_complete" reporter:datatype="int" />
3911             <field name="reservations" reporter:datatype="int" />
3912             <field name="reservations_complete" reporter:datatype="int" />
3913             <field name="holds" reporter:datatype="int" />
3914             <field name="holds_complete" reporter:datatype="int" />
3915         </fields>
3916         <links>
3917             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3918         </links>
3919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3920             <actions>
3921                 <retrieve/>
3922             </actions>
3923         </permacrud>
3924     </class>
3925     <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">
3926         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3927             <field name="id" reporter:datatype="id" />
3928             <field name="creator" reporter:datatype="link" />
3929             <field name="create_time" reporter:datatype="timestamp" />
3930             <field name="process_start_time" reporter:datatype="timestamp" />
3931             <field name="process_end_time" reporter:datatype="timestamp" />
3932             <field name="last_update_time" reporter:datatype="timestamp" />
3933             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3934             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3935             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3936             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3937             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3938         </fields>
3939         <links>
3940             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3941             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3942             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3943             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3944             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3945             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3946         </links>
3947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3948             <actions>
3949                 <create permission="EMERGENCY_CLOSING">
3950                     <context link="closing" field="org_unit" />
3951                 </create>
3952                 <retrieve/>
3953                 <update permission="EMERGENCY_CLOSING">
3954                     <context link="closing" field="org_unit" />
3955                 </update>
3956                 <delete permission="EMERGENCY_CLOSING">
3957                     <context link="closing" field="org_unit" />
3958                 </delete>
3959             </actions>
3960         </permacrud>
3961     </class>
3962         <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">
3963                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3964                         <field name="close_end" reporter:datatype="timestamp" />
3965                         <field name="close_start" reporter:datatype="timestamp" />
3966                         <field name="id" reporter:datatype="id" />
3967                         <field name="org_unit" reporter:datatype="org_unit"/>
3968                         <field name="reason" reporter:datatype="text"/>
3969                         <field name="full_day" reporter:datatype="bool"/>
3970                         <field name="multi_day" reporter:datatype="bool"/>
3971                         <field name="emergency_closing" reporter:datatype="link"/>
3972                 </fields>
3973                 <links>
3974                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3975                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3976                 </links>
3977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3978             <actions>
3979                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3980                 <retrieve/>
3981                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3982                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3983             </actions>
3984         </permacrud>
3985         </class>
3986         <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">
3987                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3988                         <field name="extended" reporter:datatype="interval"/>
3989                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3990                         <field name="max_renewals" reporter:datatype="int" />
3991                         <field name="name" reporter:datatype="text"/>
3992                         <field name="normal" reporter:datatype="interval"/>
3993                         <field name="shrt" reporter:datatype="interval"/>
3994                         <field name="max_auto_renewals" reporter:datatype="int" />
3995                 </fields>
3996                 <links>
3997                 </links>
3998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3999             <actions>
4000                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4001                 <retrieve/>
4002                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4003                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4004             </actions>
4005         </permacrud>
4006         </class>
4007
4008         <class id="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">
4009                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4010                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4011                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4012             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4013                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4014             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4015                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4016                                 reporter:datatype="link" config_field="true"/>
4017                 </fields>
4018                 <links>
4019             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4020                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4021                 </links>
4022                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4023             <actions>
4024                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4025                 <retrieve/>
4026                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4027                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4028             </actions>
4029                 </permacrud>
4030         </class>
4031
4032         <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">
4033                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4034                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4035                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4036                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4037             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4038                 </fields>
4039                 <links>
4040                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4041                 </links>
4042                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4043             <actions>
4044                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4045                 <retrieve/>
4046                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4047                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4048             </actions>
4049                 </permacrud>
4050         </class>
4051
4052         <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">
4053                 <fields oils_persist:primary="id" oils_persist:sequence="">
4054                         <field name="balance_owed" reporter:datatype="money"/>
4055                         <field name="id" reporter:datatype="id" />
4056                         <field name="last_billing_note" reporter:datatype="text"/>
4057                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4058                         <field name="last_billing_type" reporter:datatype="text"/>
4059                         <field name="last_payment_note" reporter:datatype="text"/>
4060                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4061                         <field name="last_payment_type" reporter:datatype="text"/>
4062                         <field name="total_owed" reporter:datatype="money"/>
4063                         <field name="total_paid" reporter:datatype="money"/>
4064                         <field name="usr" reporter:datatype="link"/>
4065                         <field name="xact_finish" reporter:datatype="timestamp" />
4066                         <field name="xact_start" reporter:datatype="timestamp" />
4067                         <field name="xact_type" reporter:datatype="text"/>
4068                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4069                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4070                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4071                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4072                         <field name="billing_location" reporter:datatype="link"/>
4073                 </fields>
4074                 <links>
4075                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4076                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4077                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4078                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4079                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4080                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4081                 </links>
4082                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4083                         <actions>
4084                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4085                                         <context link="usr" field="home_ou" />
4086                                 </retrieve>
4087                         </actions>
4088                 </permacrud>
4089         </class>
4090         <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">
4091                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4092                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4093                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4094                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4096                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4097                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4098                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4099                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4100                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4101                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4102                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4103                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4104                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4105                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4106                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4107                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4108                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4109                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4110                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4111                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4112                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4113                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4114                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4115                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4116                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4117                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4118                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4119                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4120                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4121                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4122                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4123                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4124                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4125                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4126                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4127                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4128                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4129                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4130                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4131                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4132                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4133                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4134                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4135                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4136                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4137                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4138                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4139                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4140                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4141                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4142                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4143                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4144                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4145                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4146                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4147                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4148                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4149                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4150                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4151                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4152                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4153                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4154                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4155                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4156                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4157                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4158                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4159                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4160                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4161                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4162                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4163                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4164             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4165                 </fields>
4166                 <links>
4167                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4168                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4169                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4170                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4171                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4172                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4173                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4174                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4175                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4176                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4177                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4178                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4179                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4180                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4181                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4182                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4183                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4184                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4185                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4186                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4187                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4188                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4189                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4190                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4191                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4192                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4193                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4194                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4195                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4196                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4197                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4198                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4199             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4200                 </links>
4201                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4202                         <actions>
4203                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4204                         </actions>
4205                 </permacrud>
4206         </class>
4207         <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">
4208                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4209                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4210                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4211                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4212                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4213                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4214                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4215                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4216                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4217         </fields>
4218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4219                         <actions>
4220                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4221                                 <retrieve/>
4222                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4223                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4224                         </actions>
4225                 </permacrud>
4226         </class>
4227         <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">
4228                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4229                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4230                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4231                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4232                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4233         </fields>
4234         <links>
4235                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4236                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4237                 </links>
4238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4239                         <actions>
4240                                 <retrieve permission="RUN_REPORTS">
4241                                         <context link="usr" field="home_ou" />
4242                                 </retrieve>
4243                         </actions>
4244                 </permacrud>
4245         </class>
4246         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4248                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4249                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4250                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4251                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4252                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4253                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4254         </fields>
4255         <links>
4256                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4257                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4258                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4259                 </links>
4260                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4261                         <actions>
4262                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4263                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4264                                         <context link="usr" field="home_ou" />
4265                                         <context link="ws" field="owning_lib" />
4266                                 </retrieve>
4267                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4268                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4269                         </actions>
4270                 </permacrud>
4271         </class>
4272         <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">
4273                 <fields oils_persist:primary="name">
4274                         <field name="name" reporter:datatype="text"/>
4275                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4276                 </fields>
4277                 <links/>
4278                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4279                         <actions>
4280                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4281                                 <retrieve/>
4282                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4283                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4284                         </actions>
4285                 </permacrud>
4286         </class>
4287         <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">
4288                 <fields oils_persist:primary="name">
4289                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4290                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4291                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4292                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4293                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4294                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4295                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4296                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4297                 </fields>
4298                 <links>
4299                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4300                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4301                 </links>
4302                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4303                         <actions>
4304                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4305                                 <retrieve/>
4306                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4307                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4308                         </actions>
4309                 </permacrud>
4310         </class>
4311         <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">
4312                 <fields oils_persist:primary="name">
4313                         <field name="name" reporter:datatype="text"/>
4314                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4315                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4316                         <field name="datatype" reporter:datatype="text"/>
4317                         <field name="view_perm" reporter:datatype="link"/>
4318                         <field name="update_perm" reporter:datatype="link"/>
4319                         <field name="fm_class" reporter:datatype="text"/>
4320                         <field name="grp" reporter:datatype="link"/>
4321                 </fields>
4322                 <links>
4323                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4324                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4325                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4326                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4327                 </links>
4328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4329                         <actions>
4330                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4331                                 <retrieve/>
4332                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4333                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4334                         </actions>
4335                 </permacrud>
4336         </class>
4337         <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">
4338                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4339                         <field name="id" />
4340                         <field name="name"  reporter:datatype="text"/>
4341                         <field name="org_unit" reporter:datatype="org_unit"/>
4342                         <field name="value"  reporter:datatype="text"/>
4343                 </fields>
4344                 <links>
4345                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4346                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4347                 </links>
4348         </class>
4349         <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">
4350                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4351                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4352                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4353                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4354                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4355                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4356                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4357                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4358                 </fields>
4359                 <links>
4360                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4361                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4362                 </links>
4363         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4364             <actions>
4365                 <create permission="CREATE_COPY_NOTE">
4366                     <context link="owning_copy" field="circ_lib"/>
4367                 </create>
4368                 <retrieve permission="VIEW_COPY_NOTES">
4369                     <context link="owning_copy" field="circ_lib"/>
4370                 </retrieve>
4371                 <update permission="UPDATE_COPY_NOTE">
4372                     <context link="owning_copy" field="circ_lib"/>
4373                 </update>
4374                 <delete permission="DELETE_COPY_NOTE">
4375                     <context link="owning_copy" field="circ_lib"/>
4376                 </delete>
4377             </actions>
4378         </permacrud>
4379         </class>
4380         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4381                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4382                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4383                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4384                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4385                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4386                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4387                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4388                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4389                 </fields>
4390                 <links>
4391                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4392                 </links>
4393         </class>
4394         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4395                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4396                         <field name="fingerprint"  reporter:datatype="text"/>
4397                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4398                         <field name="master_record" reporter:datatype="link"/>
4399                         <field name="mods"  reporter:datatype="text"/>
4400                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4401                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4402                 </fields>
4403                 <links>
4404                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4405                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4406                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4407                 </links>
4408                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4409                         <actions>
4410                                 <retrieve/>
4411                         </actions>
4412                 </permacrud>
4413         </class>
4414         <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">
4415                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4416                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4417                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4418                 </fields>
4419                 <links/>
4420         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4421             <actions>
4422                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4423                 <retrieve/>
4424                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4425                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4426             </actions>
4427         </permacrud>
4428         </class>
4429         <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">
4430                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4431                         <field name="code"  reporter:datatype="text"/>
4432                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4433                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4434                 </fields>
4435                 <links/>
4436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4437             <actions>
4438                 <create permission="CREATE_PERM" global_required="true"/>
4439                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4440                 <update permission="UPDATE_PERM" global_required="true"/>
4441                 <delete permission="DELETE_PERM" global_required="true"/>
4442             </actions>
4443         </permacrud>
4444         </class>
4445         <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">
4446                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4447                         <field name="id" reporter:datatype="id" />
4448                         <field name="metarecord" reporter:datatype="link"/>
4449                         <field name="source" reporter:datatype="link"/>
4450                 </fields>
4451                 <links>
4452                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4453                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4454                 </links>
4455                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4456                         <actions>
4457                                 <retrieve/>
4458                         </actions>
4459                 </permacrud>
4460         </class>
4461         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4462                         oils_obj:fieldmapper="metabib::display_entry" 
4463                         oils_persist:tablename="metabib.display_entry" 
4464                         oils_persist:field_safe="true"
4465                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4466                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4467                         <field name="id" reporter:datatype="id" />
4468                         <field name="field" reporter:datatype="link"/>
4469                         <field name="source" reporter:datatype="link"/>
4470                         <field name="value"  reporter:datatype="text"/>
4471                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4472                 </fields>
4473                 <links>
4474                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4475                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4476                 </links>
4477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4478                         <actions>
4479                                 <retrieve/>
4480                         </actions>
4481                 </permacrud>
4482         </class>
4483         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4484                 oils_persist:tablename="metabib.flat_display_entry"
4485                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4486                 oils_persist:field_safe="true"
4487                 reporter:label="Flat Display Entry" 
4488                 oils_persist:readonly="true">
4489                 <fields>
4490                         <field name="source" reporter:datatype="id" />
4491                         <field name="name" reporter:datatype="text"/>
4492                         <field name="multi" reporter:datatype="bool"/>
4493                         <field name="label" reporter:datatype="text"/>
4494                         <field name="field" reporter:datatype="link"/>
4495                         <field name="value" reporter:datatype="text"/>
4496                 </fields>
4497                 <links>
4498                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4499                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4500                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4501                 </links>
4502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4503                         <actions>
4504                                 <retrieve/>
4505                         </actions>
4506                 </permacrud>
4507         </class>
4508         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4509                 oils_persist:tablename="metabib.compressed_display_entry"
4510                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4511                 oils_persist:field_safe="true"
4512                 reporter:label="Compressed Display Entry" 
4513                 oils_persist:readonly="true">
4514                 <fields>
4515                         <field name="source" reporter:datatype="id" />
4516                         <field name="name" reporter:datatype="text"/>
4517                         <field name="multi" reporter:datatype="bool"/>
4518                         <field name="label" reporter:datatype="text"/>
4519                         <field name="field" reporter:datatype="link"/>
4520                         <field name="value" reporter:datatype="text"/>
4521                 </fields>
4522                 <links>
4523                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4524                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4525                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4526                 </links>
4527                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4528                         <actions>
4529                                 <retrieve/>
4530                         </actions>
4531                 </permacrud>
4532         </class>
4533         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4534                 oils_persist:tablename="metabib.wide_display_entry"
4535                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4536                 oils_persist:field_safe="true"
4537                 reporter:label="Wide Display Entry" 
4538                 oils_persist:readonly="true">
4539                 <fields oils_persist:primary="source">
4540                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4541                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4542                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4543                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4544                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4545                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4546                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4547                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4548                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4549                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4550                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4551                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4552                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4553                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4554                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4555                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4556                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4557                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4558                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4559                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4560                 </fields>
4561                 <links>
4562                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4563                 </links>
4564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4565                         <actions>
4566                                 <retrieve/>
4567                         </actions>
4568                 </permacrud>
4569         </class>
4570
4571         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4572                 oils_persist:tablename="config.display_field_map"
4573                 oils_obj:fieldmapper="config::display_field_map"
4574                 oils_persist:field_safe="true"
4575                 reporter:label="Display Field Map">
4576                 <fields oils_persist:primary="name">
4577                         <field name="name" reporter:datatype="text"/>
4578                         <field name="field" reporter:datatype="link"/>
4579                         <field name="multi" reporter:datatype="bool"/>
4580                 </fields>
4581                 <links>
4582                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4583                 </links>
4584                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4585                         <actions>
4586                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4587                                 <retrieve/>
4588                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4589                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4590                         </actions>
4591                 </permacrud>
4592         </class>
4593
4594         <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">
4595                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4596                         <field name="id" reporter:datatype="id" />
4597                         <field name="field" reporter:datatype="link"/>
4598                         <field name="source" reporter:datatype="link"/>
4599                         <field name="value"  reporter:datatype="text"/>
4600                 </fields>
4601                 <links>
4602                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4603                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4604                 </links>
4605         </class>
4606         <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">
4607                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4608                         <field name="id" reporter:datatype="id" />
4609                         <field name="value" reporter:datatype="text"/>
4610                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4611                 </fields>
4612                 <links>
4613                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4614                 </links>
4615                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4616                         <actions>
4617                                 <retrieve/>
4618                         </actions>
4619                 </permacrud>
4620         </class>
4621         <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">
4622                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4623                         <field name="id" reporter:datatype="id" />
4624                         <field name="entry" reporter:datatype="link"/>
4625                         <field name="def" reporter:datatype="link"/>
4626                         <field name="source" reporter:datatype="link"/>
4627                 </fields>
4628                 <links>
4629                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4630                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4631                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4632                 </links>
4633         </class>
4634         <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">
4635                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4636                         <field name="id" reporter:datatype="id" />
4637                         <field name="entry" reporter:datatype="link"/>
4638                         <field name="simple_heading" reporter:datatype="link"/>
4639                 </fields>
4640                 <links>
4641                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4642                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4643                 </links>
4644         </class>
4645         <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">
4646                 <oils_persist:source_definition><![CDATA[
4647                         SELECT * FROM metabib.author_field_entry
4648                                                 UNION ALL
4649                         SELECT * FROM metabib.keyword_field_entry
4650                                                 UNION ALL
4651                         SELECT * FROM metabib.identifier_field_entry
4652                                                 UNION ALL
4653                         SELECT * FROM metabib.title_field_entry
4654                                                 UNION ALL
4655                         SELECT * FROM metabib.subject_field_entry
4656                                                 UNION ALL
4657                         SELECT * FROM metabib.series_field_entry
4658                 ]]></oils_persist:source_definition>
4659                 <fields>
4660                         <field name="field" reporter:datatype="link"/>
4661                         <field name="id" reporter:datatype="id" />
4662                         <field name="source" reporter:datatype="link"/>
4663                         <field name="value"  reporter:datatype="text"/>
4664                 </fields>
4665                 <links>
4666                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4667                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4668                 </links>
4669         </class>
4670         <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">
4671                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4672                         <field name="field" reporter:datatype="link"/>
4673                         <field name="id" reporter:datatype="id" />
4674                         <field name="source" reporter:datatype="link"/>
4675                         <field name="value"  reporter:datatype="text"/>
4676                 </fields>
4677                 <links>
4678                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4679                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4680                 </links>
4681         </class>
4682         <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">
4683                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4684                         <field name="accepting_usr" reporter:datatype="link"/>
4685                         <field name="amount" reporter:datatype="money" />
4686                         <field name="amount_collected" reporter:datatype="money" />
4687                         <field name="cash_drawer" reporter:datatype="link"/>
4688                         <field name="id" reporter:datatype="id" />
4689                         <field name="note"  reporter:datatype="text"/>
4690                         <field name="payment_ts" reporter:datatype="timestamp"/>
4691                         <field name="xact" reporter:datatype="link"/>
4692                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4693                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4694                 </fields>
4695                 <links>
4696                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4697                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4698                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4699                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4700                 </links>
4701         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4702             <actions>
4703                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4704                     <context link="xact" jump="usr" field="home_ou"/>
4705                 </retrieve>
4706                         </actions>
4707                 </permacrud>
4708         </class>
4709         <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">
4710                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4711                         <field name="accepting_usr" reporter:datatype="link"/>
4712                         <field name="amount" reporter:datatype="money" />
4713                         <field name="amount_collected" reporter:datatype="money" />
4714                         <field name="id" reporter:datatype="id" />
4715                         <field name="note"  reporter:datatype="text"/>
4716                         <field name="payment_ts" reporter:datatype="timestamp"/>
4717                         <field name="xact" reporter:datatype="link"/>
4718                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4719                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4720                 </fields>
4721                 <links>
4722                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4723                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4724                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4725                 </links>
4726         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4727             <actions>
4728                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4729                     <context link="xact" jump="usr" field="home_ou"/>
4730                 </retrieve>
4731                         </actions>
4732                 </permacrud>
4733         </class>
4734         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4735                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4736                         <field name="accepting_usr" reporter:datatype="link"/>
4737                         <field name="amount" reporter:datatype="money" />
4738                         <field name="amount_collected" reporter:datatype="money" />
4739                         <field name="id" reporter:datatype="id" />
4740                         <field name="note"  reporter:datatype="text"/>
4741                         <field name="payment_ts" reporter:datatype="timestamp"/>
4742                         <field name="xact" reporter:datatype="link"/>
4743                         <field name="billing" reporter:datatype="link"/>
4744                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4745                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4746                 </fields>
4747                 <links>
4748                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4749                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4750                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4751                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4752                 </links>
4753         </class>
4754         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4755                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4756                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4757                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4758                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4759                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4760                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4761                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4762                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4763                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4764                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4765                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4766                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4767                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4768                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4769                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4770                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4771                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4772                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4773                 </fields>
4774                 <links>
4775                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4776                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4777                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4778                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4779                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4780                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4781                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4782                 </links>
4783         </class>
4784
4785         <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">
4786                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4787                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4788                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4789                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4790                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4791                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4792                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4793                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4794                 </fields>
4795                 <links/>
4796         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4797             <actions>
4798                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4799                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4800                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4801                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4802             </actions>
4803         </permacrud>
4804         </class>
4805         <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">
4806                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4807                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4808                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4809                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4810                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4811                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4812                 </fields>
4813                 <links>
4814                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4815                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4816                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4817         </links>
4818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4819             <actions>
4820                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4821                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4822                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4823                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4824             </actions>
4825         </permacrud>
4826         </class>
4827         <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">
4828                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4829                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4830                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4831                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4832                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4833             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4834             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4835             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4836             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4837                 </fields>
4838                 <links/>
4839         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4840             <actions>
4841                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4842                 <retrieve/>
4843                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4844                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4845             </actions>
4846         </permacrud>
4847         </class>
4848         <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">
4849                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4850                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4851                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4852                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4853                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4854                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4855                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4856                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4857                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4858                 </fields>
4859                 <links>
4860                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4861                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4862                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4863                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4864                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4865                 </links>
4866                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4867                         <actions>
4868                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4869                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4870                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4871                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4872                         </actions>
4873                 </permacrud>
4874         </class>
4875         <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">
4876                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4877                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4878                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4879                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4880                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4881                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4882                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4883                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4884                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4885                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4886                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4887                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4888                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4889                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4890                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4891                 </fields>
4892                 <links>
4893                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4894                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4895                 </links>
4896                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4897                         <actions>
4898                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4899                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4900                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4901                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4902                         </actions>
4903                 </permacrud>
4904         </class>
4905         <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">
4906                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4907                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4908                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4909                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4910                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4911                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4912                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4913                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4914                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4915                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4916                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4917                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4918                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4919                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4920                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4921                 </fields>
4922                 <links>
4923                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4924                 </links>
4925                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4926                         <actions>
4927                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4928                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4929                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4930                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4931                         </actions>
4932                 </permacrud>
4933         </class>
4934
4935
4936         <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">
4937                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4938                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4939                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4940                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4941                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4942                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4943                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4944                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4945                 </fields>
4946                 <links>
4947                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4948                 </links>
4949         </class>
4950
4951         <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">
4952                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4953                         <field name="call_number" />
4954                         <field name="create_date" reporter:datatype="timestamp"/>
4955                         <field name="creator" reporter:datatype="link"/>
4956                         <field name="id" reporter:datatype="id" />
4957                         <field name="pub" reporter:datatype="bool"/>
4958                         <field name="title"  reporter:datatype="text"/>
4959                         <field name="value"  reporter:datatype="text"/>
4960                 </fields>
4961                 <links>
4962                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4963                 </links>
4964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4965             <actions>
4966                 <create permission="CREATE_VOLUME_NOTE">
4967                     <context link="call_number" field="owning_lib"/>
4968                 </create>
4969                 <retrieve permission="VIEW_VOLUME_NOTES">
4970                     <context link="call_number" field="owning_lib"/>
4971                 </retrieve>
4972                 <update permission="UPDATE_VOLUME_NOTE">
4973                     <context link="call_number" field="owning_lib"/>
4974                 </update>
4975                 <delete permission="DELETE_VOLUME_NOTE">
4976                     <context link="call_number" field="owning_lib"/>
4977                 </delete>
4978             </actions>
4979         </permacrud>
4980         </class>
4981         <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">
4982                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4983                         <field name="create_date" reporter:datatype="timestamp"/>
4984                         <field name="creator" reporter:datatype="link"/>
4985                         <field name="edit_date" reporter:datatype="timestamp"/>
4986                         <field name="editor" reporter:datatype="link"/>
4987                         <field name="id" reporter:datatype="id" />
4988                         <field name="record" reporter:datatype="link"/>
4989                         <field name="value" reporter:datatype="text"/>
4990                 </fields>
4991                 <links>
4992                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4993                 </links>
4994         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4995             <actions>
4996                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4997                 <retrieve/>
4998                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4999                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5000             </actions>
5001         </permacrud>
5002         </class>
5003         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
5004         <oils_persist:source_definition><![CDATA[
5005 SELECT  usr,
5006         SUM(
5007             CASE
5008                 WHEN (
5009                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5010                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5011                 ) THEN 1
5012                 ELSE 0
5013             END
5014         ) AS out,
5015
5016         SUM(
5017             CASE
5018                 WHEN (
5019                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5020                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5021                 ) THEN 1
5022                 ELSE 0
5023             END
5024         ) AS overdue,
5025
5026         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5027         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5028         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5029   FROM  action.circulation
5030   WHERE checkin_time IS NULL
5031   GROUP BY 1
5032         ]]></oils_persist:source_definition>
5033         <fields oils_persist:primary="usr">
5034             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5035             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5036             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5037             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5038             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5039             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5040         </fields>
5041         <links>
5042             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5043         </links>
5044         </class>
5045         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5046         <oils_persist:source_definition><![CDATA[
5047 SELECT  usr,
5048         STRING_AGG(
5049             CASE
5050                 WHEN (
5051                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5052                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5053                 ) THEN id::TEXT
5054                 ELSE '0'
5055             END
5056         ,',') AS out,
5057
5058         STRING_AGG(
5059             CASE
5060                 WHEN (
5061                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5062                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5063                 ) THEN id::TEXT
5064                 ELSE '0'
5065             END
5066         ,',') AS overdue,
5067
5068         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5069         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5070         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5071   FROM  action.circulation
5072   WHERE checkin_time IS NULL
5073   GROUP BY 1
5074         ]]></oils_persist:source_definition>
5075         <fields oils_persist:primary="usr">
5076             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5077             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5078             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5079             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5080             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5081             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5082         </fields>
5083         <links>
5084             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5085         </links>
5086         </class>
5087         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5088                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5089                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5090                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5091                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5092                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5093                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5094                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5095                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5096                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5097                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5098                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5099                 </fields>
5100                 <links>
5101                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5102                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5103                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5104                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5105                 </links>
5106         </class>
5107         <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">
5108                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5109                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5110                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5111                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5112                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5113                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5114                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5115                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5116                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5117                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5118                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5119                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5120                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5121                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5122                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5123                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5124                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5125                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5126                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5127                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5128                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5129                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5130                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5131                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5132                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5133                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5134                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5135                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5136                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5137                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5138                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5139                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5140                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5141                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5142                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5143                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5144                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5145                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5146                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5147                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5148                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5149                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5150                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5151                 </fields>
5152                 <links>
5153                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5154                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5155                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5156                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5157                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5158                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5159                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5160                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5161                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5162                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5163                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5164                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5165                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5166                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5167                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5168                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5169                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5170                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5171                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5172                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5173                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5174                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5175                 </links>
5176                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5177                         <actions>
5178                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5179                         </actions>
5180                 </permacrud>
5181         </class>
5182         <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">
5183                 <fields>
5184                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5185                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5186                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5187                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5188                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5189                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5190                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5191                 </fields>
5192                 <links>
5193                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5194                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5195                 </links>
5196                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5197                         <actions>
5198                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5199                         </actions>
5200                 </permacrud>
5201         </class>
5202         <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">
5203                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5204                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5205                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5206                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5207                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5208                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5209                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5210                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5211                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5212                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5213                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5214                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5215                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5216                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5217                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5218                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5219                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5220                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5221                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5222                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5223                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5224                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5225                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5226                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5227                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5228                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5229                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5230                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5231                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5232                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5233                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5234                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5235                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5236                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5237                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5238                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5239                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5240                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5241                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5242                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5243                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5244                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5245                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5246                 </fields>
5247                 <links>
5248                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5249                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5250                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5251                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5252                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5253                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5254                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5255                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5256                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5257                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5258                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5259                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5260                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5261                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5262                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5263                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5264                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5265                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5266                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5267                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5268                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5269                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5270                 </links>
5271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5272                         <actions>
5273                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5274                         </actions>
5275                 </permacrud>
5276         </class>
5277
5278         <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">
5279                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5280                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5281                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5282                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5283                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5284                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5285                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5286                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5287                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5288                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5289                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5290                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5291                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5292                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5293                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5294                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5295                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5296                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5297                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5298                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5299                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5300                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5301                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5302                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5303                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5304                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5305                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5306                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5307                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5308                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5309                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5310                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5311                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5312                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5313                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5314                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5315                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5316                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5317                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5318                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5319                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5320                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5321                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5322                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5323                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5324                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5325                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5326                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5327                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5328                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5329                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5330                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5331                 </fields>
5332                 <links>
5333                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5334                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5335                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5336                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5337                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5338                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5339                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5340                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5341                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5342                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5343                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5344                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5345                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5346                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5347                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5348                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5349                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5350                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5351                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5352                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5353                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5354                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5355                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5356                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5357                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5358                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5359                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5360                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5361                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5362                 </links>
5363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5364                         <actions>
5365                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5366                         </actions>
5367                 </permacrud>
5368         </class>
5369         <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">
5370                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5371                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5372                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5373                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5374                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5375                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5376                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5377                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5378                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5379                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5380                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5381                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5382                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5383                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5384                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5385                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5386                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5387                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5388                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5389                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5390                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5391                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5392                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5393                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5394                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5395                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5396                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5397                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5398                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5399                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5400                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5401                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5402                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5403                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5404                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5405                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5406                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5407                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5408                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5409                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5410                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5411                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5412                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5413                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5414                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5415                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5416                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5417                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5418                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5419                 </fields>
5420                 <links>
5421                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5422                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5423                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5424                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5425                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5426                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5427                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5428                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5429                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5430                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5431                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5432                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5433                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5434                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5435                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5436                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5437                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5438                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5439                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5440                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5441                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5442                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5443                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5444                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5445                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5446                 </links>
5447         </class>
5448         <class id="auch" 
5449                 controller="open-ils.cstore" 
5450                 oils_obj:fieldmapper="action::user_circ_history" 
5451                 oils_persist:tablename="action.usr_circ_history" 
5452                 reporter:label="User Checkout History">
5453                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5454                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5455                         <!-- prevent reporting on the user that owns the checkout history -->
5456                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5457                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5458                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5459                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5460                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5461                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5462                 </fields>
5463                 <links>
5464                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5465                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5466                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5467                 </links>
5468         </class>
5469         <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">
5470                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5471                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5472                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5473                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5474                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5475                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5476                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5477                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5478                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5479                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5480                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5481                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5482                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5483                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5484                 </fields>
5485                 <links>
5486                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5487                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5488                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5489                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5490                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5491                 </links>
5492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5493                         <actions>
5494                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5495                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5496                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5497                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5498                         </actions>
5499                 </permacrud>
5500         </class>
5501
5502         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5503                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5504                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5505                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5506                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5507                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5508                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5509                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5510                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5511                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5512                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5513                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5514                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5515                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5516                 </fields>
5517                 <links>
5518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5519                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5520                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5521                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5522                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5523                 </links>
5524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5525                         <actions>
5526                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5527                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5528                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5529                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5530                         </actions>
5531                 </permacrud>
5532         </class>
5533         
5534         <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">
5535                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5536                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5537                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5538                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5539                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5540                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5541                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5542                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5543                 </fields>
5544                 <links>
5545                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5546                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5547                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5548                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5549                 </links>
5550                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5551                         <actions>
5552                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5553                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5554                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5555                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5556                         </actions>
5557                 </permacrud>
5558         </class>
5559         
5560         <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">
5561                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5562                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5563                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5564                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5565                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5566                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5567                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5568                 </fields>
5569                 <links>
5570                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5571                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5572                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5573                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5574                 </links>
5575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5576                         <actions>
5577                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5578                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5579                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5580                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5581                         </actions>
5582                 </permacrud>
5583         </class>
5584         
5585         <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">
5586                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5587                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5588                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5589                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5590                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5591                 </fields>
5592                 <links>
5593                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5594                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5595                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5596                 </links>
5597                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5598                         <actions>
5599                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5600                     <context link="resource" field="owner" />
5601                 </create>
5602                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5603                     <context link="resource" field="owner" />
5604                 </retrieve>
5605                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5606                     <context link="resource" field="owner" />
5607                 </update>
5608                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5609                     <context link="resource" field="owner" />
5610                 </delete>
5611                         </actions>
5612                 </permacrud>
5613         </class>
5614         
5615         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5616                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5617                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5618                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5619                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5620                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5621                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5622                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5623                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5624                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5625                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5626                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5627                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5628                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5629                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5630                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5631                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5632                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5633                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5634                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5635                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5636                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5637                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5638                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5639                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5640                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5641                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5642                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5643                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5644                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5645                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5646                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5647                 </fields>
5648                 <links>
5649                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5650                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5651                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5652                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5653                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5654                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5655                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5656                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5657                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5658                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5659                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5660                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5661                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5662                 </links>
5663                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5664                         <actions>
5665                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5666                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5667                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5668                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5669                         </actions>
5670                 </permacrud>
5671         </class>
5672         
5673         <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">
5674                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5675                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5676                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5677                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5678                 </fields>
5679                 <links>
5680                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5681                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5682                 </links>
5683                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5684                         <actions>
5685                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5686                                         <context link="reservation" field="pickup_lib"/>
5687                                 </create>
5688                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5689                                         <context link="reservation" field="pickup_lib"/>
5690                                 </retrieve>
5691                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5692                                         <context link="reservation" field="pickup_lib"/>
5693                                 </update>
5694                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5695                                         <context link="reservation" field="pickup_lib"/>
5696                                 </delete>
5697                         </actions>
5698                 </permacrud>
5699         </class>
5700
5701         <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">
5702                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5703                         <field name="bucket" reporter:datatype="link"/>
5704                         <field name="id" reporter:datatype="id" />
5705                         <field name="target_call_number" reporter:datatype="link" />
5706                         <field name="create_time" reporter:datatype="timestamp" />
5707                         <field name="pos" reporter:datatype="int" />
5708                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5709                 </fields>
5710                 <links>
5711                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5712                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5713             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5714                 </links>
5715                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5716                         <actions>
5717                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5718                     <context link="bucket" field="owning_lib"/>
5719                 </retrieve>
5720             </actions>
5721         </permacrud>
5722         </class>
5723         <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">
5724                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5725                         <field name="id" reporter:datatype="id" />
5726                         <field name="item" reporter:datatype="link"/>
5727                         <field name="note" reporter:datatype="text" />
5728                 </fields>
5729                 <links>
5730                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5731                 </links>
5732         </class>
5733         <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">
5734                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5735                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5736                         <field name="btype" reporter:datatype="text"/>
5737                         <field name="id" reporter:datatype="id" />
5738                         <field name="name" reporter:datatype="text"/>
5739                         <field name="description" reporter:datatype="text"/>
5740                         <field name="owner" reporter:datatype="link"/>
5741                         <field name="pub" reporter:datatype="bool"/>
5742                         <field name="create_time" reporter:datatype="timestamp" />
5743                         <field name="owning_lib" reporter:datatype="org_unit" />
5744                 </fields>
5745                 <links>
5746                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5747                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5748                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5749                 </links>
5750                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5751                         <actions>
5752                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5753                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5754                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5755                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5756                         </actions>
5757                 </permacrud>
5758         </class>
5759         <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">
5760                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5761                         <field name="id" reporter:datatype="id" />
5762                         <field name="bucket" reporter:datatype="link"/>
5763                         <field name="note" reporter:datatype="text" />
5764                 </fields>
5765                 <links>
5766                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5767                 </links>
5768         </class>
5769         <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">
5770                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5771                         <field name="hold" reporter:datatype="link"/>
5772                         <field name="id" reporter:datatype="id" />
5773                         <field name="target_copy" reporter:datatype="link"/>
5774                         <field name="proximity" reporter:datatype="number"/>
5775                 </fields>
5776                 <links>
5777                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5778                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5779                 </links>
5780         </class>
5781         <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">
5782                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5783                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5784                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5785                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5786                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5787                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5788                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5789                 </fields>
5790                 <links>
5791                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5792                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5793                 </links>
5794         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5795             <actions>
5796                 <create permission="CREATE_HOLD_NOTIFICATION">
5797                                         <context link="hold" jump="usr" field="home_ou" />
5798                                 </create>
5799                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5800                                         <context link="hold" jump="usr" field="home_ou" />
5801                                 </retrieve>
5802                 <update permission="CREATE_HOLD_NOTIFICATION">
5803                                         <context link="hold" jump="usr" field="home_ou" />
5804                                 </update>
5805                 <delete permission="CREATE_HOLD_NOTIFICATION">
5806                                         <context link="hold" jump="usr" field="home_ou" />
5807                                 </delete>
5808             </actions>
5809         </permacrud>
5810         </class>
5811         <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">
5812                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5813                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5814                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5815                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5816                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5817                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5818                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5819                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5820                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5821                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5822                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5823                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5824                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5825                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5826                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5827                 </fields>
5828                 <links>
5829                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5830                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5831                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5832                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5833                 </links>
5834         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5835             <actions>
5836                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5837                 <retrieve/>
5838                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5839                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5840             </actions>
5841         </permacrud>
5842         </class>
5843         <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">
5844                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5845                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5846                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5847                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5848                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5849             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5850             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5851             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5852                 </fields>
5853                 <links>
5854                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5855                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5856                 </links>
5857         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5858             <actions>
5859                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5860                 <retrieve/>
5861                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5862                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5863             </actions>
5864         </permacrud>
5865         </class>
5866         <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">
5867                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5868                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5869             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5870             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5871                 </fields>
5872                 <links>
5873                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5874                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5875                 </links>
5876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5877             <actions>
5878                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5879                                         <context link="lgroup" field="owner" />
5880                 </create>
5881                 <retrieve/>
5882                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5883                                         <context link="lgroup" field="owner" />
5884                 </update>
5885                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5886                                         <context link="lgroup" field="owner" />
5887                 </delete>
5888             </actions>
5889         </permacrud>
5890         </class>
5891
5892     <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">
5893         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5894             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5895             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5896             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5897             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5898         </fields>
5899         <links>
5900             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5901             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5902         </links>
5903         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5904             <actions>
5905                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5906                 <retrieve/>
5907                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5908                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5909             </actions>
5910         </permacrud>
5911     </class>
5912
5913         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5914                 <fields>
5915                         <field name="sre_id" oils_persist:virtual="true" />
5916                         <field name="location" oils_persist:virtual="true" />
5917                         <field name="owning_lib" oils_persist:virtual="true" />
5918                         <field name="basic_holdings" oils_persist:virtual="true" />
5919                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5920                         <field name="supplement_holdings" oils_persist:virtual="true" />
5921                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5922                         <field name="index_holdings" oils_persist:virtual="true" />
5923                         <field name="index_holdings_add" oils_persist:virtual="true" />
5924                         <field name="online" oils_persist:virtual="true" />
5925                         <field name="missing" oils_persist:virtual="true" />
5926                         <field name="incomplete" oils_persist:virtual="true" />
5927                 </fields>
5928         </class>
5929
5930         <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">
5931                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5932                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5933                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5934                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5935                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5936                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5937                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5938                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5939                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5940                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5941                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5942                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5943                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5944                 </fields>
5945                 <links>
5946                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5947                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5948                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5949                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5950                 </links>
5951                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5952                         <actions>
5953                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5954                                 <retrieve/>
5955                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5956                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5957                         </actions>
5958                 </permacrud>
5959         </class>
5960
5961         <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">
5962                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5963                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5964                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5965                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5966                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5967                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5968                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5969                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5970                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5971                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5972                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5973                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5974                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5975                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5976                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5977                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5978                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5979                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5980                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5981                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5982                 </fields>
5983                 <links>
5984                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5985                 </links>
5986                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5987                         <actions>
5988                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5989                                         <context link="subscription" field="owning_lib" />
5990                                 </create>
5991                                 <retrieve />
5992                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5993                                         <context link="subscription" field="owning_lib" />
5994                                 </update>
5995                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5996                                         <context link="subscription" field="owning_lib" />
5997                                 </delete>
5998                         </actions>
5999                 </permacrud>
6000         </class>
6001
6002         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
6003                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
6004                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6005                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
6006                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
6007                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
6008                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6009                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6010                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6011                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6012                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6013                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6014                 </fields>
6015                 <links>
6016                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6017                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6018                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6019                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6020                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6021                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6022                 </links>
6023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6024                         <actions>
6025                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6026                                 <retrieve />
6027                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6028                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6029                         </actions>
6030                 </permacrud>
6031         </class>
6032
6033         <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">
6034                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6035                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6036                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6037                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6038                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6039                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6040                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6041                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6042                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6043                 </fields>
6044                 <links>
6045                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6046                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6047                 </links>
6048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6049                         <actions>
6050                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6051                     <context link="subscription" field="owning_lib"/>
6052                 </create>
6053                                 <retrieve />
6054                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6055                     <context link="subscription" field="owning_lib"/>
6056                 </update>
6057                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6058                     <context link="subscription" field="owning_lib"/>
6059                 </delete>
6060                         </actions>
6061                 </permacrud>
6062         </class>
6063
6064         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6065                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6066                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6067                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6068                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6069                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6070                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6071                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6072                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6073                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6074                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6075                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6076                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6077                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6078                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6079                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6080                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6081                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6082                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6083                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6084                 </fields>
6085                 <links>
6086                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6087                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6088                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6089                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6090                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6091                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6092                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6093                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6094                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6095                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6096                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6097                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6098                 </links>
6099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6100                         <actions>
6101                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6102                                 <retrieve />
6103                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6104                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6105                         </actions>
6106                 </permacrud>
6107         </class>
6108
6109         <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">
6110                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6111                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6112                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6113                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6114                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6115                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6116                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6117                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6118                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6119                 </fields>
6120                 <links>
6121                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6122                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6123                 </links>
6124                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6125                         <actions>
6126                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6127                                         <context link="distribution" field="holding_lib" />
6128                                 </create>
6129                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6130                                         <context link="distribution" field="holding_lib" />
6131                                 </retrieve>
6132                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6133                                         <context link="distribution" field="holding_lib" />
6134                                 </update>
6135                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6136                                         <context link="distribution" field="holding_lib" />
6137                                 </delete>
6138                         </actions>
6139                 </permacrud>
6140         </class>
6141
6142         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6143                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6144                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6145                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6146                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6147                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6148                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6149                 </fields>
6150                 <links>
6151                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6152                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6153                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6154                 </links>
6155                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6156                         <actions>
6157                                 <create permission="ADMIN_SERIAL_STREAM">
6158                                         <context link="distribution" field="holding_lib" />
6159                                 </create>
6160                                 <retrieve />
6161                                 <update permission="ADMIN_SERIAL_STREAM">
6162                                         <context link="distribution" field="holding_lib" />
6163                                 </update>
6164                                 <delete permission="ADMIN_SERIAL_STREAM">
6165                                         <context link="distribution" field="holding_lib" />
6166                                 </delete>
6167                         </actions>
6168                 </permacrud>
6169         </class>
6170
6171         <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">
6172                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6173                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6174                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6175                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6176                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6177                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6178                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6179                 </fields>
6180                 <links>
6181                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6182                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6183                 </links>
6184                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6185                         <actions>
6186                                 <create permission="ADMIN_SERIAL_STREAM">
6187                                         <context link="stream" jump="distribution" field="holding_lib" />
6188                                 </create>
6189                                 <retrieve permission="RECEIVE_SERIAL">
6190                                         <context link="stream" jump="distribution" field="holding_lib" />
6191                                 </retrieve>
6192                                 <update permission="ADMIN_SERIAL_STREAM">
6193                                         <context link="stream" jump="distribution" field="holding_lib" />
6194                                 </update>
6195                                 <delete permission="ADMIN_SERIAL_STREAM">
6196                                         <context link="stream" jump="distribution" field="holding_lib" />
6197                                 </delete>
6198                         </actions>
6199                 </permacrud>
6200         </class>
6201
6202         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6203                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6204                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6205                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6206                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6207                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6208                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6209                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6210                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6211                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6212                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6213                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6214                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6215                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6216                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6217                 </fields>
6218                 <links>
6219                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6220                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6221                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6222                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6223                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6224                 </links>
6225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6226                         <actions>
6227                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6228                                         <context link="subscription" field="owning_lib" />
6229                                 </create>
6230                                 <retrieve/>
6231                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6232                                         <context link="subscription" field="owning_lib" />
6233                                 </update>
6234                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6235                                         <context link="subscription" field="owning_lib" />
6236                                 </delete>
6237                         </actions>
6238                 </permacrud>
6239         </class>
6240
6241         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6242                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6243                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6244                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6245                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6246                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6247                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6248                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6249                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6250                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6251                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6252                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6253                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6255                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6256                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6257                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6258                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6259                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6260                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6261                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6262                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6263                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6264                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6265                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6266                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6267                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6268                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6269                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6270                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6271                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6272                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6273                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6274                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6275                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6276                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6277                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6278                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6279                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6280                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6281                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6282                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6283                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6284                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6285                 </fields>
6286                 <links>
6287                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6288                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6289                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6290                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6291                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6292                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6293                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6294                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6295                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6296                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6297                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6298                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6299                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6300                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6301                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6302                 </links>
6303                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6304                         <actions>
6305                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6306                                 <retrieve/>
6307                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6308                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6309                         </actions>
6310                 </permacrud>
6311         </class>
6312
6313         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6314                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6315                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6316                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6317                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6318                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6319                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6320                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6321                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6322                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6323                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6324                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6325                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6326                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6327                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6328                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6329                 </fields>
6330                 <links>
6331                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6332                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6333                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6334                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6335                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6336                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6337                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6338                 </links>
6339                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6340                         <actions>
6341                                 <create permission="ADMIN_SERIAL_ITEM">
6342                                         <context link="stream" jump="distribution" field="holding_lib" />
6343                                 </create>
6344                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6345                                         <context link="stream" jump="distribution" field="holding_lib" />
6346                                 </retrieve>
6347                                 <update permission="ADMIN_SERIAL_ITEM">
6348                                         <context link="stream" jump="distribution" field="holding_lib" />
6349                                 </update>
6350                                 <delete permission="ADMIN_SERIAL_ITEM">
6351                                         <context link="stream" jump="distribution" field="holding_lib" />
6352                                 </delete>
6353                         </actions>
6354                 </permacrud>
6355         </class>
6356
6357         <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">
6358                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6359                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6360                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6361                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6362                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6363                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6364                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6365                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6366                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6367                 </fields>
6368                 <links>
6369                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6370                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6371                 </links>
6372                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6373                         <actions>
6374                                 <create permission="ADMIN_SERIAL_ITEM">
6375                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6376                                 </create>
6377                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6378                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6379                                 </retrieve>
6380                                 <update permission="ADMIN_SERIAL_ITEM">
6381                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6382                                 </update>
6383                                 <delete permission="ADMIN_SERIAL_ITEM">
6384                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6385                                 </delete>
6386                         </actions>
6387                 </permacrud>
6388         </class>
6389         <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">
6390                 <fields>
6391                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6392                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6393                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6394                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6395                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6396                 </fields>
6397                 <links>
6398                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6399                 </links>
6400         </class>
6401         <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">
6402                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6403                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6404                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6405                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6406                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6407                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6408                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6409                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6410                 </fields>
6411                 <links>
6412                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6413                 </links>
6414         </class>
6415         <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">
6416                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6417                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6418                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6419                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6420                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6421                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6422                 </fields>
6423                 <links>
6424                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6425                 </links>
6426                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6427                         <actions>
6428                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6429                                         <context link="distribution" field="holding_lib" />
6430                                 </create>
6431                                 <retrieve/>
6432                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6433                                         <context link="distribution" field="holding_lib" />
6434                                 </update>
6435                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6436                                         <context link="distribution" field="holding_lib" />
6437                                 </delete>
6438                         </actions>
6439                 </permacrud>
6440         </class>
6441
6442         <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">
6443                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6444                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6445                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6446                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6447                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6448                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6449                 </fields>
6450                 <links>
6451                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6452                 </links>
6453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6454                         <actions>
6455                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6456                                         <context link="distribution" field="holding_lib" />
6457                                 </create>
6458                                 <retrieve/>
6459                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6460                                         <context link="distribution" field="holding_lib" />
6461                                 </update>
6462                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6463                                         <context link="distribution" field="holding_lib" />
6464                                 </delete>
6465                         </actions>
6466                 </permacrud>
6467         </class>
6468
6469         <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">
6470                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6471                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6472                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6473                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6474                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6475                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6476                 </fields>
6477                 <links>
6478                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6479                 </links>
6480                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6481                         <actions>
6482                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6483                                         <context link="distribution" field="holding_lib" />
6484                                 </create>
6485                                 <retrieve/>
6486                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6487                                         <context link="distribution" field="holding_lib" />
6488                                 </update>
6489                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6490                                         <context link="distribution" field="holding_lib" />
6491                                 </delete>
6492                         </actions>
6493                 </permacrud>
6494         </class>
6495
6496         <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">
6497                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6498                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6499                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6500                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6501                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6502                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6503                 </fields>
6504                 <links>
6505                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6506                 </links>
6507                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6508                         <actions>
6509                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6510                                 <retrieve/>
6511                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6512                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6513                         </actions>
6514                 </permacrud>
6515         </class>
6516
6517         <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">
6518                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6519                         <field name="id" reporter:datatype="id" />
6520                         <field name="owning_copy" reporter:datatype="link"/>
6521                         <field name="stat_cat" reporter:datatype="link"/>
6522                         <field name="stat_cat_entry" reporter:datatype="link"/>
6523                 </fields>
6524                 <links>
6525                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6526                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6527                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6528                 </links>
6529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6530                         <actions>
6531                                 <retrieve/>
6532                         </actions>
6533                 </permacrud>
6534         </class>
6535         <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">
6536                 <fields oils_persist:primary="code">
6537                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6538                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6539                 </fields>
6540                 <links/>
6541         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6542             <actions>
6543                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6544                 <retrieve/>
6545                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6546                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6547             </actions>
6548         </permacrud>
6549         </class>
6550         <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">
6551                 <fields oils_persist:primary="code">
6552                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6553                         <field reporter:label="Bib Level" 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="CREATE_MARC_CODE" global_required="true"/>
6559                 <retrieve/>
6560                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6561                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6562             </actions>
6563         </permacrud>
6564         </class>
6565         <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">
6566                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6567                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6568                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6569                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6570                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6571                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6572                 </fields>
6573                 <links>
6574             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6575         </links>
6576         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6577             <actions>
6578                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6579                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6580                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6581                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6582             </actions>
6583         </permacrud>
6584         </class>
6585         <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">
6586                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6587                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6588                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6589                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6590                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6591                 </fields>
6592                 <links>
6593                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6594         </links>
6595         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6596             <actions>
6597                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6598                 <retrieve/>
6599                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6600                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6601             </actions>
6602         </permacrud>
6603         </class>
6604         <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">
6605                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6606                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6607                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6608                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6609                 </fields>
6610                 <links>
6611                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6612                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6613                 </links>
6614         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6615             <actions>
6616                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6617                 <retrieve/>
6618                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6619                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6620             </actions>
6621         </permacrud>
6622         </class>
6623         <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">
6624                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6625                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6626                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6627                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6628                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6629                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6630                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6631                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6632                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6633                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6634                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6635                 </fields>
6636                 <links>
6637                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6638                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6639                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6640                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6641                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6642                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6643                 </links>
6644         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6645             <actions>
6646                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6647                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6648                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6649                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6650             </actions>
6651         </permacrud>
6652         </class>
6653         <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">
6654                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6655                         <field name="id" reporter:datatype="id" />
6656                         <field name="from_org" reporter:datatype="org_unit"/>
6657                         <field name="to_org" reporter:datatype="org_unit"/>
6658                         <field name="prox" reporter:datatype="int" />
6659                 </fields>
6660                 <links>
6661                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6662                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6663                 </links>
6664         </class>
6665         <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">
6666                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6667                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6668                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6669                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6670                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6671                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6672                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6673                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6674                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6675                 </fields>
6676                 <links/>
6677         </class>
6678         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6679                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6680                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6681                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6682                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6683                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6684                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6685                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6686                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6687                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6688                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6689                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6690                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6691                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6692                 </fields>
6693                 <links>
6694                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6695                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6696                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6697                 </links>
6698         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6699             <actions>
6700                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6701                 <retrieve/>
6702                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6703                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6704             </actions>
6705         </permacrud>
6706         </class>
6707         <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">
6708                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6709                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6710                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6711                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6712                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6713                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6714                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6715                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6716                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6717                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6718                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6719                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6720                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6721                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6722                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6723                 </fields>
6724                 <links>
6725                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6726                 </links>
6727         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6728             <actions>
6729                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6730                 <retrieve/>
6731                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6732                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6733             </actions>
6734         </permacrud>
6735         </class>
6736         <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">
6737                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6738                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6739                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6740                         <field name="query_text" reporter:datatype="text"/>
6741                 </fields>
6742         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6743             <actions>
6744                 <retrieve/>
6745             </actions>
6746         </permacrud>
6747         </class>
6748
6749         <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">
6750                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6751                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6752                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6753                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6754                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6755                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6756                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6757                 </fields>
6758                 <links>
6759                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6760                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6761                 </links>
6762         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6763             <actions>
6764                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6765                 <retrieve/>
6766                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6767                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6768             </actions>
6769         </permacrud>
6770         </class>
6771         <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">
6772                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6773                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6774                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6775                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6776                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6777                 </fields>
6778                 <links>
6779                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6780                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6781                 </links>
6782         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6783             <actions>
6784                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6785                     <context link="grp" field="owner"/>
6786                 </create>
6787                 <retrieve/>
6788                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6789                     <context link="grp" field="owner"/>
6790                 </update>
6791                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6792                     <context link="grp" field="owner"/>
6793                 </delete>
6794             </actions>
6795         </permacrud>
6796         </class>
6797
6798         <!-- A note: Please update alhr and ahopl when updating ahr -->
6799         <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">
6800                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6801                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6802                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6803                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6804                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6805                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6806                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6807                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6808                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6809                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6810                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6811                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6812                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6813                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6814                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6815                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6816                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6817                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6818                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6819                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6820                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6821                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6822                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6823                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6824                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6825                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6826                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6827                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6828                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6829                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6830                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6831                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6832                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6833                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6834                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6835                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6836                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6837                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6838                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6839                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6840                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6841                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6842                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6843                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6844                 </fields>
6845                 <links>
6846                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6847                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6848                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6849                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6850                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6851                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6852                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6853                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6854                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6855                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6856                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6857                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6858                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6859                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6860                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6861                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6862                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6863                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6864                 </links>
6865                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6866                         <actions>
6867                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6868                         </actions>
6869                 </permacrud>
6870         </class>
6871         <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">
6872                 <oils_persist:source_definition><![CDATA[
6873                 SELECT
6874                         ahr.*,
6875                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6876                                 copy_location_order_position,
6877                         CASE WHEN au.alias IS NOT NULL THEN
6878                                 au.alias
6879                         ELSE
6880                                 au.first_given_name
6881                         END AS usr_alias_or_first_given_name,
6882                         au.first_given_name AS usr_first_given_name,
6883                         au.second_given_name AS usr_second_given_name,
6884                         au.family_name AS usr_family_name,
6885                         au.prefix AS usr_prefix,
6886                         au.suffix AS usr_suffix,
6887                         au.alias AS usr_alias,
6888                         CASE WHEN au.alias IS NOT NULL THEN
6889                                 au.alias
6890                         ELSE
6891                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6892                                         COALESCE(au.family_name, ''),
6893                                         COALESCE(au.suffix, ''),
6894                                         ', ',
6895                                         COALESCE(au.prefix, ''),
6896                                         COALESCE(au.first_given_name, ''),
6897                                         COALESCE(au.second_given_name, '')
6898                                 ], ' '), E'\\s+,', ',')
6899                         END AS usr_alias_or_display_name,
6900                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6901                                 COALESCE(au.family_name, ''),
6902                                 COALESCE(au.suffix, ''),
6903                                 ', ',
6904                                 COALESCE(au.prefix, ''),
6905                                 COALESCE(au.first_given_name, ''),
6906                                 COALESCE(au.second_given_name, '')
6907                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6908                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6909                                 AS call_number_label,
6910                         siss.label AS issuance_label,
6911                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6912                         ahcm_1.copy_count AS potential_copies
6913                 FROM action.hold_request ahr
6914                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6915                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6916                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6917                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6918                 JOIN actor.usr au ON (au.id = ahr.usr)
6919                 JOIN (
6920                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6921                         FROM asset.copy_location
6922                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6923                 LEFT JOIN actor.usr_standing_penalty ausp 
6924                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6925                 LEFT JOIN config.standing_penalty csp
6926                         ON (
6927                                 csp.id = ausp.standing_penalty AND 
6928                                 csp.block_list LIKE '%CAPTURE%' AND (
6929                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6930                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6931                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6932                                         )
6933                                 )
6934                         )
6935                 JOIN (
6936                         SELECT COUNT(target_copy) AS copy_count, hold
6937                         FROM action.hold_copy_map
6938                         GROUP BY 2
6939                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6940                 LEFT JOIN serial.issuance siss
6941                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6942                 LEFT JOIN asset.copy_location_order acplo
6943                         ON (acp.location = acplo.location AND
6944                                 acp.circ_lib = acplo.org)
6945                 WHERE
6946                         ahr.capture_time IS NULL AND
6947                         ahr.cancel_time IS NULL AND
6948                         csp.id IS NULL AND
6949                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6950                         acp.status IN (0,7)
6951                 ]]></oils_persist:source_definition>
6952                 <fields oils_persist:primary="id">
6953                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6954                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6955                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6956                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6957                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6958                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6959                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6960                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6961                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6962                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6963                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6964                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6965                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6966                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6967                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6968                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6969                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6970                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6971                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6972                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6973                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6974                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6975                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6976                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6977                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6978                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6979                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6980                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6981                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6982                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6983                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6984                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6985                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6986                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6987                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6988                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6989                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6990                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6991                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6992                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6993                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6994                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6995                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6996                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6997                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6998                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6999                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
7000                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
7001                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
7002                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
7003                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
7004                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
7005                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
7006                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7007                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7008                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7009                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7010                 </fields>
7011                 <links>
7012                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7013                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7014                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7015                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7016                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7017                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7018                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7019                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7020                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7021                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7022                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7023                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7024                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7025                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7026                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7027                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7028                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7029                 </links>
7030                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7031                         <actions>
7032                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7033                         </actions>
7034                 </permacrud>
7035         </class>
7036         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7037                 <oils_persist:source_definition><![CDATA[
7038                         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)
7039                 ]]></oils_persist:source_definition>
7040                 <fields oils_persist:primary="id">
7041                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7042                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7043                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7044                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7045                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7046                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7047                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7048                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7049                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7050                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7051                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7052                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7053                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7054                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7055                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7056                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7057                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7058                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7059                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7060                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7061                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7062                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7063                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7064                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7065                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7066                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7067                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7068                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7069                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7070                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7071                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7072                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7073                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7074                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7075                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7076                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7077                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7078                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7079                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7080                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7081                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7082                 </fields>
7083                 <links>
7084                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7085                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7086                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7087                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7088                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7089                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7090                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7091                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7092                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7093                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7094                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7095                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7096                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7097                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7098                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7099                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7100                 </links>
7101         </class>
7102
7103         <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">
7104                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7105                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7106                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7107                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7108                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7109                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7110                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7111                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7112                 </fields>
7113                 <links>
7114                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7115                 </links>
7116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7117                         <actions>
7118                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7119                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7120                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7121                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7122                         </actions>
7123                 </permacrud>
7124         </class>
7125         <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">
7126                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7127                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7128                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7129                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7130                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7131                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7132                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7133                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7134                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7135                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7136                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7137                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7138                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7139                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7140                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7141                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7142                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7143                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7144                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7145                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7146                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7147                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7148                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7149                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7150                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7151                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7152                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7153                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7154                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7155                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7156                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7157                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7158                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7159                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7160                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7161                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7162                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7163                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7164                 </fields>
7165                 <links>
7166                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7167                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7168                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7169                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7170                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7171                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7172                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7173                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7174                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7175                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7176                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7177                 </links>
7178                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7179                         <actions>
7180                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7181                         </actions>
7182                 </permacrud>
7183         </class>
7184         <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">
7185                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7186                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7187                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7188                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7189                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7190                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7191                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7192                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7193                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7194                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7195                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7196                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7197                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7198                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7199                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7200                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7201                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7202                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7203                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7204                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7205                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7206                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7207                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7208                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7209                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7210                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7211                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7212                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7213                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7214                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7215                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7216                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7217                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7218                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7219                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7220                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7221                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7222                 </fields>
7223                 <links>
7224                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7225                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7226                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7227                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7228                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7229                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7230                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7231                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7232                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7233                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7234                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7235                 </links>
7236                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7237                         <actions>
7238                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7239                         </actions>
7240                 </permacrud>
7241         </class>
7242
7243         <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">
7244                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7245                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7246                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7247                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7248                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7249                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7250                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7251                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7252                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7253                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7254                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7255                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7256                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7257                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7258                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7259                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7260                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7261                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7262                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7263                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7264                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7265                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7266                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7267                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7268                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7269                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7270                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7271                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7272                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7273                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7274                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7275                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7276                 </fields>
7277                 <links>
7278                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7279                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7280                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7281                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7282                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7283                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7284                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7285                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7286                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7287                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7288                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7289                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7290                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7291                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7292                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7293                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7294                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7295                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7296                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7297                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7298                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7299                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7300                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7301                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7302                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7303                 </links>
7304         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7305             <actions>
7306                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7307                 <retrieve />
7308                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7309                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7310             </actions>
7311         </permacrud>
7312         </class>
7313         <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">
7314                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7315                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7316                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7317                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7318                 </fields>
7319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7320                         <actions>
7321                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7322                                 <retrieve/>
7323                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7324                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7325                         </actions>
7326                 </permacrud>
7327         </class>
7328         <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">
7329                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7330                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7331                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7332                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7333                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7334                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7335                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7336                 </fields>
7337                 <links>
7338                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7339                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7340                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7341                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7342                 </links>
7343                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7344                         <actions>
7345                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7346                                 <retrieve/>
7347                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7348                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7349                         </actions>
7350                 </permacrud>
7351         </class>
7352         <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">
7353                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7354                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7355                         <field name="btype" reporter:datatype="text"/>
7356                         <field name="id" reporter:datatype="id" />
7357                         <field name="name"  reporter:datatype="text"/>
7358                         <field name="description" reporter:datatype="text"/>
7359                         <field name="owner" reporter:datatype="link"/>
7360                         <field name="pub" reporter:datatype="bool"/>
7361                         <field name="create_time" reporter:datatype="timestamp" />
7362                         <field name="owning_lib" reporter:datatype="org_unit" />
7363                 </fields>
7364                 <links>
7365                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7366                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7367                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7368                 </links>
7369                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7370                         <actions>
7371                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7372                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7373                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7374                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7375                         </actions>
7376                 </permacrud>
7377         </class>
7378         <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">
7379                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7380                         <field name="id" reporter:datatype="id" />
7381                         <field name="bucket" reporter:datatype="link"/>
7382                         <field name="note" reporter:datatype="text" />
7383                 </fields>
7384                 <links>
7385                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7386                 </links>
7387         </class>
7388         <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">
7389                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7390                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7391                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7392                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7393                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7394                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7395                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7396                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7397                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7398                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7399                 </fields>
7400                 <links>
7401                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7402                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7403                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7404                 </links>
7405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7406                         <actions>
7407                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7408                         </actions>
7409                 </permacrud>
7410         </class>
7411         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7412                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7413                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7414                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7415                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7416                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7417                 </fields>
7418                 <links>
7419                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7420                 </links>
7421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7422                         <actions>
7423                                 <retrieve permission="VIEW_USER user_request.view">
7424                                         <context link="usr" field="home_ou" />
7425                                 </retrieve>
7426                         </actions>
7427                 </permacrud>
7428         </class>
7429     <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">
7430         <fields oils_persist:primary="field">
7431             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7432             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7433             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7434         </fields>
7435         <links/>
7436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7437             <actions>
7438                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7439                 <retrieve />
7440                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7441                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7442             </actions>
7443         </permacrud>
7444     </class>
7445         <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">
7446                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7447                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7448                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7449                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7450                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7451                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7452                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7453                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7454                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7455                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7456                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7457                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7458                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7459                 </fields>
7460                 <links>
7461                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7462                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7463                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7464                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7465                 </links>
7466         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7467             <actions>
7468                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7469                 <retrieve />
7470                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7471                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7472             </actions>
7473         </permacrud>
7474         </class>
7475         <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">
7476                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7477                         <field name="field" reporter:datatype="link"/>
7478                         <field name="id" reporter:datatype="id" />
7479                         <field name="source" reporter:datatype="link"/>
7480                         <field name="value"  reporter:datatype="text"/>
7481                 </fields>
7482                 <links>
7483                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7484                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7485                 </links>
7486         </class>
7487         <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">
7488                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7489                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7490                         <field name="btype" reporter:datatype="text"/>
7491                         <field name="id" reporter:datatype="id" />
7492                         <field name="name"  reporter:datatype="text"/>
7493                         <field name="description" reporter:datatype="text"/>
7494                         <field name="owner" reporter:datatype="link"/>
7495                         <field name="pub" reporter:datatype="bool"/>
7496                         <field name="create_time" reporter:datatype="timestamp" />
7497                         <field name="owning_lib" reporter:datatype="org_unit" />
7498                 </fields>
7499                 <links>
7500                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7501                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7502                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7503                 </links>
7504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7505                         <actions>
7506                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7507                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7508                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7509                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7510                         </actions>
7511                 </permacrud>
7512         </class>
7513         <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">
7514                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7515                         <field name="id" reporter:datatype="id" />
7516                         <field name="bucket" reporter:datatype="link"/>
7517                         <field name="note" reporter:datatype="text" />
7518                 </fields>
7519                 <links>
7520                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7521                 </links>
7522         </class>
7523         <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">
7524                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7525                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7526                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7527                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7528                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7529                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7530                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7531                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7532                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7533                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7534                 </fields>
7535                 <links>
7536                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7537                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7538                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7539                 </links>
7540         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7541             <actions>
7542                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7543                     <context link="xact" jump="usr" field="home_ou"/>
7544                 </retrieve>
7545                         </actions>
7546                 </permacrud>
7547         </class>
7548         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7549                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7550                         <field name="id" reporter:datatype="id" />
7551                         <field name="ind1" />
7552                         <field name="ind2" />
7553                         <field name="record" />
7554                         <field name="subfield" />
7555                         <field name="tag" />
7556                         <field name="value" />
7557                 </fields>
7558                 <links>
7559                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7560                 </links>
7561         </class>
7562         <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">
7563                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7564                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7565                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7566                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7567                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7568                 </fields>
7569                 <links>
7570                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7571                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7572                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7573                 </links>
7574         </class>
7575         <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">
7576                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7577                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7578                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7579                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7580                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7581                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7582                 </fields>
7583                 <links>
7584                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7585                 </links>
7586         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7587             <actions>
7588                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7589                 <retrieve/>
7590                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7591                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7592             </actions>
7593         </permacrud>
7594
7595         </class>
7596         <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">
7597                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7598                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7599                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7600                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7601                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7602                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7603                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7604                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7605                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7606                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7607                 </fields>
7608                 <links>
7609                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7610                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7611                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7612                 </links>
7613         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7614             <actions>
7615                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7616                 <retrieve/>
7617                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7618                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7619             </actions>
7620         </permacrud>
7621         </class>
7622         <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">
7623                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7624                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7625                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7626                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7627                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7628                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7629                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7630                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7631                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7632                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7633                 </fields>
7634                 <links>
7635                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7636                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7637                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7638                 </links>
7639                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7640                 <actions>
7641                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7642                     <retrieve/>
7643                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7644                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7645                 </actions>
7646              </permacrud>
7647         </class>
7648         <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">
7649                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7650                         <field name="balance_owed" reporter:datatype="money" />
7651                         <field name="total_owed" reporter:datatype="money" />
7652                         <field name="total_paid" reporter:datatype="money" />
7653                         <field name="usr" reporter:datatype="link"/>
7654                 </fields>
7655                 <links>
7656                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7657                 </links>
7658         </class>
7659     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7660                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7661                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7662                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7663                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7664                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7665                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7666                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7667                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7668                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7669                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7670                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7671                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7672                 </fields>
7673                 <links>
7674                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7675                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7676                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7677                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7678                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7679                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7680                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7681                 </links>
7682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7683             <actions>
7684                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7685             </actions>
7686         </permacrud>
7687         </class>
7688         <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">
7689                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7690                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7691                         <field name="quality" reporter:datatype="int" />
7692                         <field name="source" reporter:datatype="text"/>
7693                         <field name="transcendant" reporter:datatype="bool"/>
7694                         <field name="can_have_copies" reporter:datatype="bool"/>
7695                 </fields>
7696                 <links/>
7697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7698             <actions>
7699                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7700                 <retrieve/>
7701                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7702                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7703             </actions>
7704         </permacrud>
7705         </class>
7706         <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">
7707                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7708                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7709                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7710                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7711                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7712                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7713                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7714                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7715                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7716                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7717                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7718                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7719                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7720                 </fields>
7721                 <links>
7722                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7723                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7724                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7725                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7726                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7727                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7728                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7729                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7730                 </links>
7731                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7732                         <actions>
7733                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7734                                         <context link="usr" field="home_ou" />
7735                                 </retrieve>
7736                         </actions>
7737                 </permacrud>
7738         </class>
7739         <class id="actsce" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7740                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7741                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7742                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7743                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7744                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7745                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7746                 </fields>
7747                 <links>
7748                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7749                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7750                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7751                 </links>
7752         </class>
7753         <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">
7754                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7755                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7756                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7757                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7758                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7759                 </fields>
7760                 <links>
7761                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7762                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7763                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7764                 </links>
7765         </class>
7766         <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">
7767                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7768                         <field name="bucket" reporter:datatype="link"/>
7769                         <field name="id" reporter:datatype="id" />
7770                         <field name="target_user" reporter:datatype="link"/>
7771                         <field name="create_time" reporter:datatype="timestamp" />
7772                         <field name="pos" reporter:datatype="int" />
7773                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7774                 </fields>
7775                 <links>
7776                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7777                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7778             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7779                 </links>
7780                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7781                         <actions>
7782                                 <retrieve permission="ADMIN_USER_BUCKET">
7783                     <context link="bucket" field="owning_lib"/>
7784                 </retrieve>
7785             </actions>
7786         </permacrud>
7787         </class>
7788         <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">
7789                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7790                         <field name="id" reporter:datatype="id" />
7791                         <field name="staff" reporter:datatype="link"/>
7792                         <field name="bucket" reporter:datatype="link"/>
7793                         <field name="target" reporter:datatype="int" />
7794                         <field name="hold_type" reporter:datatype="text" />
7795                         <field name="run_date" reporter:datatype="timestamp" />
7796                         <field name="cancelled" reporter:datatype="timestamp" />
7797                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7798                 </fields>
7799                 <links>
7800                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7801                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7802                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7803                 </links>
7804                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7805                         <actions>
7806                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7807                 <retrieve/>
7808                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7809                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7810             </actions>
7811         </permacrud>
7812         </class>
7813         <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">
7814                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7815                         <field name="id" reporter:datatype="id" />
7816                         <field name="batch_hold_event" reporter:datatype="link"/>
7817                         <field name="hold" reporter:datatype="link"/>
7818                 </fields>
7819                 <links>
7820                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7821                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7822                 </links>
7823                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7824                         <actions>
7825                 <retrieve/>
7826             </actions>
7827         </permacrud>
7828         </class>
7829         <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">
7830                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7831                         <field name="id" reporter:datatype="id" />
7832                         <field name="item" reporter:datatype="link"/>
7833                         <field name="note" reporter:datatype="text" />
7834                 </fields>
7835                 <links>
7836                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7837                 </links>
7838         </class>
7839         <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">
7840                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7841                         <field name="balance_owed" reporter:datatype="money" />
7842                         <field name="total_owed" reporter:datatype="money" />
7843                         <field name="total_paid" reporter:datatype="money" />
7844                         <field name="usr" reporter:datatype="link"/>
7845                 </fields>
7846                 <links>
7847                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7848                 </links>
7849                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7850                         <actions>
7851                                 <retrieve permission="VIEW_USER">
7852                                         <context link="usr" field="home_ou"/>
7853                                 </retrieve>
7854                         </actions>
7855                 </permacrud>
7856         </class>
7857         <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">
7858                 <fields oils_persist:primary="code" oils_persist:sequence="">
7859                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7860                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7861                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7862                 </fields>
7863                 <links/>
7864         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7865             <actions>
7866                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7867                 <retrieve/>
7868                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7869                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7870             </actions>
7871         </permacrud>
7872         </class>
7873         <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">
7874                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7875                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7876                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7877                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7878                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7879                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7880                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7881                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7882                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7883                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7884                 </fields>
7885                 <links>
7886                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7887                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7888                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7889                 </links>
7890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7891             <actions>
7892                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7893                     <context link="xact" jump="usr" field="home_ou"/>
7894                 </retrieve>
7895                         </actions>
7896                 </permacrud>
7897         </class>
7898         <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">
7899                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7900                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7901                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7902                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7903                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7904                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7905                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7906                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7907                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7908                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7909                 </fields>
7910                 <links>
7911                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7912                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7913                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7914                 </links>
7915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7916             <actions>
7917                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7918                     <context link="xact" jump="usr" field="home_ou"/>
7919                 </retrieve>
7920                         </actions>
7921                 </permacrud>
7922         </class>
7923         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7924                 <fields oils_persist:primary="id" oils_persist:sequence="">
7925                         <field name="checkin_lib" reporter:datatype="link"/>
7926                         <field name="checkin_staff" reporter:datatype="link"/>
7927                         <field name="checkin_time" reporter:datatype="timestamp"/>
7928                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7929                         <field name="circ_staff" reporter:datatype="link"/>
7930                         <field name="desk_renewal" reporter:datatype="bool"/>
7931                         <field name="due_date" reporter:datatype="timestamp"/>
7932                         <field name="duration" reporter:datatype="interval"/>
7933                         <field name="duration_rule" reporter:datatype="link"/>
7934                         <field name="fine_interval" reporter:datatype="interval"/>
7935                         <field name="id" reporter:datatype="id" />
7936                         <field name="max_fine" reporter:datatype="money" />
7937                         <field name="max_fine_rule" reporter:datatype="link"/>
7938                         <field name="opac_renewal" reporter:datatype="bool"/>
7939                         <field name="phone_renewal" reporter:datatype="bool"/>
7940                         <field name="recurring_fine" reporter:datatype="money" />
7941                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7942                         <field name="renewal_remaining" reporter:datatype="int" />
7943             <field name="grace_period" reporter:datatype="interval" />
7944                         <field name="stop_fines" reporter:datatype="text"/>
7945                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7946                         <field name="target_copy" reporter:datatype="link"/>
7947                         <field name="usr" reporter:datatype="link"/>
7948                         <field name="xact_finish" reporter:datatype="timestamp" />
7949                         <field name="xact_start" reporter:datatype="timestamp" />
7950                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7951                         <field name="auto_renewal" reporter:datatype="bool"/>
7952                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7953                 </fields>
7954                 <links>
7955                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7956                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7957                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7958                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7959                 </links>
7960         </class>
7961         <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">
7962                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7963                         <field name="field" reporter:datatype="link"/>
7964                         <field name="id" reporter:datatype="id" />
7965                         <field name="source" reporter:datatype="link"/>
7966                         <field name="value" reporter:datatype="text"/>
7967                 </fields>
7968                 <links>
7969                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7970                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7971                 </links>
7972         </class>
7973         <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">
7974                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7975                         <field name="high" reporter:datatype="money" />
7976                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7977                         <field name="low" reporter:datatype="money" />
7978                         <field name="name" reporter:datatype="text"/>
7979                         <field name="normal" reporter:datatype="money" />
7980                         <field name="recurrence_interval" reporter:datatype="interval"/>
7981             <field name="grace_period" reporter:datatype="interval" />
7982                 </fields>
7983                 <links/>
7984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7985             <actions>
7986                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7987                 <retrieve/>
7988                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7989                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7990             </actions>
7991         </permacrud>
7992         </class>
7993         <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">
7994                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7995                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7996                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7997                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7998                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7999                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
8000                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8001                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8002                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8003                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8004                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8005                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8006                 </fields>
8007                 <links>
8008                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8009                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8010                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8011                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8012                 </links>
8013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8014             <actions>
8015                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8016                     <context link="xact" jump="usr" field="home_ou"/>
8017                 </retrieve>
8018                         </actions>
8019                 </permacrud>
8020         </class>
8021         <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">
8022                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8023                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8024                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8025                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8026                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8027                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8028                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8029                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8030                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8031                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8032                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8033                 </fields>
8034                 <links>
8035                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8036                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8037                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8038                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8039                 </links>
8040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8041             <actions>
8042                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8043                     <context link="xact" jump="usr" field="home_ou"/>
8044                 </retrieve>
8045                         </actions>
8046                 </permacrud>
8047         </class>
8048         <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">
8049                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8050                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8051                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8052                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8053                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8054                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8055                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8056                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8057                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8058                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8059                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8060                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8061                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8062                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8063                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8064                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8065                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8066                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8067                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8068                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8069                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8070                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8071                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8072                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8073                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8074                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8075                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8076                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8077                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8078                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8079                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8080                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8081                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8082                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8083                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8084                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8085                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8086                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8087                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8088                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8089                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8090                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8091                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8092                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8093                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8094                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8095                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8096                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8097                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8098                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8099                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8100                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8101                 </fields>
8102                 <links>
8103                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8104                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8105                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8106                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8107                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8108                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8109                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8110                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8111                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8112                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8113                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8114                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8115                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8116                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8117                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8118                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8119                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8120                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8121                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8122                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8123                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8124                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8125                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8126                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8127                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8128                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8129                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8130                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8131                 </links>
8132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8133             <actions>
8134                 <create permission="CREATE_COPY">
8135                     <context link="call_number" field="owning_lib"/>
8136                 </create>
8137                 <retrieve/>
8138                 <update permission="UPDATE_COPY">
8139                     <context link="call_number" field="owning_lib"/>
8140                 </update>
8141                 <delete permission="DELETE_COPY">
8142                     <context link="call_number" field="owning_lib"/>
8143                 </delete>
8144             </actions>
8145         </permacrud>
8146         </class>
8147
8148         <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">
8149                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8150                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8151                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8152                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8153                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8154                 </fields>
8155                 <links>
8156                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8157                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8158                 </links>
8159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8160                         <actions>
8161                 <create permission="STAFF_LOGIN"/>
8162                 <retrieve/>
8163                 <update permission="STAFF_LOGIN"/>
8164                 <delete permission="STAFF_LOGIN"/>
8165                         </actions>
8166                 </permacrud>
8167         </class>
8168
8169         <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">
8170                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8171             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8172                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8173                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8174                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8175                 </fields>
8176                 <links>
8177                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8178                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8179                 </links>
8180         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8181             <actions>
8182                                 <retrieve/>
8183             </actions>
8184         </permacrud>
8185         </class>
8186
8187         <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">
8188                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8189                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8190                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8191                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8192                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8193                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8194                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8195                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8196                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8197                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8198                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8199                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8200                 </fields>
8201                 <links>
8202                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8203                 </links>
8204         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8205             <actions>
8206                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8207                 <retrieve/>
8208                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8209                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8210             </actions>
8211         </permacrud>
8212         </class>
8213
8214         <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">
8215                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8216                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8217                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8218                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8219                 </fields>
8220                 <links>
8221                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8222                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8223                 </links>
8224         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8225             <actions>
8226                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8227                 <retrieve/>
8228                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8229                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8230             </actions>
8231         </permacrud>
8232         </class>
8233
8234         <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">
8235                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8236                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8237                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8238                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8239                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8240                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8241                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8242                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8243                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8244                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8245                 </fields>
8246                 <links>
8247                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8248                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8249                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8250                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8251                 </links>
8252         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8253             <actions>
8254                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8255                     <context link="copy" field="circ_lib"/>
8256                 </create>
8257                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8258                     <context link="copy" field="circ_lib"/>
8259                                 </retrieve>
8260                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8261                     <context link="copy" field="circ_lib"/>
8262                                 </update>
8263                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8264                     <context link="copy" field="circ_lib"/>
8265                                 </delete>
8266             </actions>
8267         </permacrud>
8268         </class>
8269
8270         <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">
8271                 <fields oils_persist:primary="id">
8272                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8273                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8274                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8275                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8276                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8277                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8278                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8279                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8280                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8281                 </fields>
8282                 <links>
8283                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8284                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8285                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8286                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8287                 </links>
8288         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8289             <actions>
8290                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8291                     <context link="copy" field="circ_lib"/>
8292                 </create>
8293                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8294                     <context link="copy" field="circ_lib"/>
8295                                 </retrieve>
8296                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8297                     <context link="copy" field="circ_lib"/>
8298                                 </update>
8299                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8300                     <context link="copy" field="circ_lib"/>
8301                                 </delete>
8302             </actions>
8303         </permacrud>
8304         </class>
8305
8306         <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">
8307                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8308                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8309                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8310                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8311                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8312                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8313                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8314                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8315                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8316                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8317                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8318                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8319                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8320                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8321                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8322                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8323                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8324                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8325                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8326                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8327                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8328                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8329                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8330                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8331                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8332                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8333                 </fields>
8334                 <links>
8335                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8336                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8337                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8338                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8339                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8340                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8341                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8342                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8343                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8344                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8345                 </links>
8346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8347                         <actions>
8348                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8349                                 <retrieve />
8350                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8351                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8352                         </actions>
8353                 </permacrud>
8354         </class>
8355
8356         <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">
8357                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8358                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8359                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8360                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8361                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8362                 </fields>
8363                 <links/>
8364         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8365             <actions>
8366                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8367                 <retrieve/>
8368                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8369                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8370             </actions>
8371         </permacrud>
8372         </class>
8373         <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">
8374                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8375                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8376                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8377                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8378                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8379                 </fields>
8380                 <links/>
8381         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8382             <actions>
8383                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8384                 <retrieve/>
8385                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8386                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8387             </actions>
8388         </permacrud>
8389         </class>
8390         <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">
8391                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8392                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8393                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8394                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8395                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8396                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8397                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8398                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8399                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8400                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8401                 </fields>
8402                 <links>
8403                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8404                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8405                 </links>
8406         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8407             <actions>
8408                 <create permission="CREATE_PERM" global_required="true"/>
8409                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8410                 <update permission="UPDATE_PERM" global_required="true"/>
8411                 <delete permission="DELETE_PERM" global_required="true"/>
8412             </actions>
8413         </permacrud>
8414         </class>
8415         <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">
8416                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8417                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8418                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8419                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8420                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8421                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8422                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8423                 </fields>
8424                 <links>
8425                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8426                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8427                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8428                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8429                 </links>
8430                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8431                         <actions>
8432                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8433                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8434                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8435                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8436                         </actions>
8437                 </permacrud>
8438         </class>
8439         <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">
8440                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8441                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8442                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8443                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8444                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8445                 </fields>
8446                 <links>
8447                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8448                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8449                 </links>
8450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8451             <actions>
8452                 <create permission="ADMIN_SURVEY">
8453                     <context link="question" jump="survey" field="owner"/>
8454                 </create>
8455                 <retrieve/>
8456                 <update permission="ADMIN_SURVEY">
8457                     <context link="question" jump="survey" field="owner"/>
8458                 </update>
8459                 <delete permission="ADMIN_SURVEY">
8460                     <context link="question" jump="survey" field="owner"/>
8461                 </delete>
8462             </actions>
8463         </permacrud>
8464         </class>
8465         <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">
8466                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8467                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8468                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8469                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8470                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8471                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8472                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8473                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8474                 </fields>
8475                 <links>
8476                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8477                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8478                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8479                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8480                 </links>
8481                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8482                         <actions>
8483                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8484                         </actions>
8485                 </permacrud>
8486         </class>
8487         <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">
8488                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8489                         <field name="balance_owed" reporter:datatype="money" />
8490                         <field name="total_owed" reporter:datatype="money" />
8491                         <field name="total_paid" reporter:datatype="money" />
8492                         <field name="usr" reporter:datatype="link"/>
8493                 </fields>
8494                 <links>
8495                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8496                 </links>
8497         </class>
8498         <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">
8499                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8500                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8501                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8502                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8503                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8504                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8505                 </fields>
8506                 <links>
8507                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8508                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8509                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8510                 </links>
8511         </class>
8512         <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">
8513                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8514                         <field name="field" reporter:datatype="link"/>
8515                         <field name="id" reporter:datatype="id" />
8516                         <field name="source" reporter:datatype="link"/>
8517                         <field name="value" reporter:datatype="text"/>
8518                 </fields>
8519                 <links>
8520                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8521                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8522                 </links>
8523         </class>
8524         <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">
8525                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8526                         <field name="field" reporter:datatype="link"/>
8527                         <field name="id" reporter:datatype="id" />
8528                         <field name="source" reporter:datatype="link"/>
8529                         <field name="value" reporter:datatype="text"/>
8530                 </fields>
8531                 <links>
8532                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8533                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8534                 </links>
8535         </class>
8536         <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">
8537                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8538                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8539                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8540                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8541                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8542                 </fields>
8543                 <links>
8544                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8545                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8546                 </links>
8547         </class>
8548         <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">
8549                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8550                         <field name="depth" reporter:datatype="int" />
8551                         <field name="grantable" reporter:datatype="bool"/>
8552                         <field name="grp" reporter:datatype="link"/>
8553                         <field name="id" reporter:datatype="id" />
8554                         <field name="perm" reporter:datatype="link"/>
8555                 </fields>
8556                 <links>
8557                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8558                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8559                 </links>
8560         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8561             <actions>
8562                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8563                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8564                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8565                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8566             </actions>
8567         </permacrud>
8568         </class>
8569         <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">
8570                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8571                         <field name="items" oils_persist:virtual="true" />
8572                         <field name="btype" reporter:datatype="text"/>
8573                         <field name="id" reporter:datatype="id" />
8574                         <field name="name" reporter:datatype="text"/>
8575                         <field name="description" reporter:datatype="text"/>
8576                         <field name="owner" reporter:datatype="link"/>
8577                         <field name="pub" reporter:datatype="bool"/>
8578                         <field name="create_time" reporter:datatype="timestamp" />
8579                         <field name="owning_lib" reporter:datatype="org_unit" />
8580                 </fields>
8581                 <links>
8582                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8583                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8584                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8585                 </links>
8586                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8587                         <actions>
8588                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8589                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8590                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8591                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8592                         </actions>
8593                 </permacrud>
8594         </class>
8595         <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">
8596                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8597                         <field name="id" reporter:datatype="id" />
8598                         <field name="bucket" reporter:datatype="link"/>
8599                         <field name="note" reporter:datatype="text" />
8600                 </fields>
8601                 <links>
8602                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8603                 </links>
8604         </class>
8605         <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">
8606                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8607                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8608                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8609                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8610                 </fields>
8611                 <links>
8612                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8613                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8614                 </links>
8615         </class>
8616         <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">
8617                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8618                         <field name="depth" reporter:datatype="int"/>
8619                         <field name="grantable" reporter:datatype="bool"/>
8620                         <field name="id" reporter:datatype="id" />
8621                         <field name="perm" reporter:datatype="link"/>
8622                         <field name="usr" reporter:datatype="link"/>
8623                 </fields>
8624                 <links>
8625                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8626                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8627                 </links>
8628         </class>
8629         <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">
8630                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8631                         <field name="object_id" reporter:datatype="text"/>
8632                         <field name="grantable" reporter:datatype="bool"/>
8633                         <field name="id" reporter:datatype="id" />
8634                         <field name="perm" reporter:datatype="link"/>
8635                         <field name="usr" reporter:datatype="link"/>
8636                         <field name="object_type" reporter:datatype="text"/>
8637                 </fields>
8638                 <links>
8639                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8640                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8641                 </links>
8642         </class>
8643         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8644                 <fields oils_persist:primary="id" oils_persist:sequence="">
8645                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8646                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8647                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8648                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8649                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8650                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8651                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8652                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8653                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8654                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8655                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8656                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8657                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8658                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8659                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8660                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8661                 </fields>
8662                 <links>
8663                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8664                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8665                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8666                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8667                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8668                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8669                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8670                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8671                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8672                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8673                 </links>
8674         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8675             <actions>
8676                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8677                     <context link="xact" jump="usr" field="home_ou"/>
8678                 </retrieve>
8679                         </actions>
8680                 </permacrud>
8681         </class>
8682         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8683                 oils_obj:fieldmapper="money::aged_payment" 
8684                 oils_persist:tablename="money.aged_payment" 
8685                 reporter:label="Payments: Aged">
8686                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8687                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8688                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8689                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8690                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8691                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8692                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8693                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8694                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8695                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8696                         <field name="billing" reporter:datatype="link"/>
8697                 </fields>
8698                 <links>
8699                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8700                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8701                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8702                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8703                 </links>
8704                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8705                         <actions>
8706                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8707                                         <context link="xact" field="usr_home_ou"/>
8708                                 </retrieve>
8709                         </actions>
8710                 </permacrud>
8711         </class>
8712         <class id="mallp" controller="open-ils.cstore" 
8713                 oils_obj:fieldmapper="money::all_payments" 
8714                 oils_persist:tablename="money.all_payments" 
8715                 oils_persist:readonly="true" reporter:core="true"
8716                 reporter:label="Payments: All">
8717                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8718                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8719                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8720                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8721                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8722                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8723                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8724                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8725                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8726                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8727                         <field name="billing" reporter:datatype="link"/>
8728                 </fields>
8729                 <links>
8730                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8731                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8732                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8733                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8734                 </links>
8735         </class>
8736
8737         <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">
8738                 <fields oils_persist:primary="id" oils_persist:sequence="">
8739                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8740                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8741                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8742                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8743                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8744                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8745                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8746                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8747                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8748                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8749                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8750                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8751                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8752                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8753                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8754                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8755                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8756                 </fields>
8757                 <links>
8758                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8759                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8760                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8761                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8762                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8763                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8764                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8765                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8766                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8767                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8768                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8769                 </links>
8770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8771                         <actions>
8772                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8773                                         <context link="xact" jump="usr" field="home_ou"/>
8774                                 </retrieve>
8775                         </actions>
8776                 </permacrud>
8777         </class>
8778         <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">
8779                 <fields oils_persist:primary="id" oils_persist:sequence="">
8780                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8781                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8782                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8783                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8784                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8785                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8786                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8787                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8788                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8789                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8790                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8791                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8792                 </fields>
8793                 <links>
8794                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8795                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8796                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8797                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8798                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8799                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8800                 </links>
8801         </class>
8802         <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">
8803                 <fields oils_persist:primary="id" oils_persist:sequence="">
8804                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8805                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8806                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8807                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8808                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8809                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8810                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8811                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8812                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8813                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8814                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8815                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8816                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8817                 </fields>
8818                 <links>
8819                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8820                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8821                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8822                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8823                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8824                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8825                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8826                 </links>
8827         </class>
8828         <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">
8829                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8830                         <field name="bucket" reporter:datatype="link"/>
8831                         <field name="id" reporter:datatype="id" />
8832                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8833                         <field name="create_time" reporter:datatype="timestamp" />
8834                         <field name="pos" reporter:datatype="int" />
8835                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8836                 </fields>
8837                 <links>
8838                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8839                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8840             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8841                 </links>
8842                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8843                         <actions>
8844                                 <retrieve permission="ADMIN_COPY_BUCKET">
8845                     <context link="bucket" field="owning_lib"/>
8846                 </retrieve>
8847             </actions>
8848         </permacrud>
8849         </class>
8850         <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">
8851                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8852                         <field name="id" reporter:datatype="id" />
8853                         <field name="item" reporter:datatype="link"/>
8854                         <field name="note" reporter:datatype="text" />
8855                 </fields>
8856                 <links>
8857                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8858                 </links>
8859         </class>
8860         <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">
8861                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8862                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8863                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8864                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8865                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8866                 </fields>
8867                 <links>
8868                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8869                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8870                 </links>
8871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8872                         <actions>
8873                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8874                         </actions>
8875                 </permacrud>
8876         </class>
8877     <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">
8878         <fields oils_persist:primary="field">
8879             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8880             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8881             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8882         </fields>
8883         <links/>
8884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8885             <actions>
8886                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8887                 <retrieve />
8888                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8889                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8890             </actions>
8891         </permacrud>
8892     </class>
8893         <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">
8894                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8895                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8896                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8897                 </fields>
8898                 <links/>
8899         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8900             <actions>
8901                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8902                 <retrieve/>
8903                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8904                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8905             </actions>
8906         </permacrud>
8907         </class>
8908
8909
8910         <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">
8911                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8912                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8913                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8914                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8915                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8916                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8917                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8918                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8919                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8920                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8921                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8922                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8923                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8924                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8925                 </fields>
8926                 <links>
8927                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8928                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8929                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8930                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8931                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8932                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8933                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8934                 </links>
8935         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8936             <actions>
8937                 <create permission="TRANSIT_COPY">
8938                     <context link="target_copy" field="owner"/>
8939                 </create>
8940                 <retrieve/>
8941                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8942                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8943             </actions>
8944         </permacrud>
8945         </class>
8946         <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">
8947                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8948                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8949                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8950                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8951                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8952                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8953                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8954                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8955                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8956                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8957                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8958                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8959                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8960                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8961                 </fields>
8962                 <links>
8963                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8964                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8965                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8966                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8967                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8968                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8969                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8970                 </links>
8971         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8972             <actions>
8973                 <create permission="TRANSIT_COPY" context_field="owner">
8974                     <context link="target_copy" field="circ_lib"/>
8975                 </create>
8976                 <retrieve/>
8977                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8978                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8979             </actions>
8980         </permacrud>
8981         </class>
8982         <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">
8983                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8984                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8985                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8986                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8987                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8988                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8989                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8990                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8991                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8992                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8993                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8994                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8995                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8996                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8997                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8998                 </fields>
8999                 <links>
9000                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9001                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9002                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9003                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
9004                 </links>
9005         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9006             <actions>
9007                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9008                     <context link="xact" jump="usr" field="home_ou"/>
9009                 </retrieve>
9010                         </actions>
9011                 </permacrud>
9012         </class>
9013         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9014                 oils_obj:fieldmapper="money::aged_billing" 
9015                 oils_persist:tablename="money.aged_billing" 
9016                 reporter:label="Aged Billing Line Item">
9017                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9018                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9019                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9020                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9021                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9022                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9023                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9024                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9025                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9026                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9027                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9028                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9029                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9030                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9031                 </fields>
9032                 <links>
9033                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9034                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9035                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9036                 </links>
9037                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9038                         <actions>
9039                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9040                                         <context link="xact" field="usr_home_ou"/>
9041                                 </retrieve>
9042                         </actions>
9043                 </permacrud>
9044         </class>
9045         <class id="mallb" controller="open-ils.cstore" 
9046                 oils_obj:fieldmapper="money::all_billings" 
9047                 oils_persist:tablename="money.all_billings" 
9048                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9049                 <fields oils_persist:primary="id" oils_persist:sequence="">
9050                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9051                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9052                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9053                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9054                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9055                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9056                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9057                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9058                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9059                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9060                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9061                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9062                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9063                 </fields>
9064                 <links>
9065                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9066                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9067                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9068                 </links>
9069         </class>
9070         <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">
9071                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9072                         <field name="grp" />
9073                         <field name="id" reporter:datatype="id" />
9074                         <field name="usr" />
9075                 </fields>
9076                 <links>
9077                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9078                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9079                 </links>
9080         </class>
9081         <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">
9082                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9083                         <field name="id" reporter:datatype="id" />
9084                         <field name="fq_field" reporter:datatype="text"/>
9085                         <field name="identity_value" reporter:datatype="text"/>
9086                         <field name="translation" reporter:datatype="text"/>
9087                         <field name="string" reporter:datatype="text"/>
9088                 </fields>
9089                 <links>
9090                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9091                 </links>
9092         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9093             <actions>
9094                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9095                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9096                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9097                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9098             </actions>
9099         </permacrud>
9100         </class>
9101         <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">
9102                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9103                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9104                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9105                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9106                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9107                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9108                 </fields>
9109                 <links>
9110                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9111                 </links>
9112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9113             <actions>
9114                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9115                 <retrieve/>
9116                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9117                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9118             </actions>
9119         </permacrud>
9120         </class>
9121         <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">
9122                 <fields oils_persist:primary="code">
9123                         <field name="code" reporter:datatype="id" />
9124                         <field name="marc_code" reporter:datatype="text"/>
9125                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9126                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9127                         <field name="rtl" reporter:datatype="bool"/>
9128                 </fields>
9129                 <links/>
9130         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9131             <actions>
9132                 <create permission="CREATE_LOCALE" global_required="true"/>
9133                 <retrieve/>
9134                 <update permission="UPDATE_LOCALE" global_required="true"/>
9135                 <delete permission="DELETE_LOCALE" global_required="true"/>
9136             </actions>
9137         </permacrud>
9138         </class>
9139         <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">
9140                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9141                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9142                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9143                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9144                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9145                 </fields>
9146                 <links>
9147                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9148                 </links>
9149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9150             <actions>
9151                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9152                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9153                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9154                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9155             </actions>
9156         </permacrud>
9157         </class>
9158
9159         <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">
9160                 <fields oils_persist:primary="id">
9161                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9162                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9163                 </fields>
9164                 <links/>
9165         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9166             <actions>
9167                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9168                 <retrieve/>
9169                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9170                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9171             </actions>
9172         </permacrud>
9173         </class>
9174
9175         <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">
9176                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9177                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9178                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9179                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9180                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9181                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9182                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9183                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9184                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9185                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9186                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9187                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9188                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9189                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9190                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9191                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9192                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9193                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9194                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9195                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9196                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9197                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9198                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9199                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9200                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9201                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9202                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9203                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9204                 </fields>
9205                 <links>
9206                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9207                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9208                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9209                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9210                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9211                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9212                 </links>
9213         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9214             <actions>
9215                 <create permission="user_request.create">
9216                     <context link="usr" field="home_ou"/>
9217                                 </create>
9218                 <retrieve permission="user_request.view">
9219                     <context link="usr" field="home_ou"/>
9220                                 </retrieve>
9221                 <update permission="user_request.update">
9222                     <context link="usr" field="home_ou"/>
9223                                 </update>
9224                 <delete permission="user_request.delete">
9225                     <context link="usr" field="home_ou"/>
9226                                 </delete>
9227             </actions>
9228         </permacrud>
9229         </class>
9230
9231         <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">
9232         <oils_persist:source_definition><![CDATA[
9233             SELECT r.*, CASE
9234                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9235                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9236                         WHEN l.state = 'received' THEN 5 -- Received
9237                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9238                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9239                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9240                         WHEN l.id IS NULL THEN 1 -- New
9241                         ELSE 0 -- Error
9242                     END AS request_status
9243                     ,u.home_ou
9244             FROM      acq.user_request r
9245             JOIN actor.usr u ON (r.usr = u.id)
9246             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9247             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9248             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9249         ]]></oils_persist:source_definition>
9250                 <fields oils_persist:primary="id">
9251                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9252                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9253                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9254                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9255                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9256                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9257                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9258                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9259                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9260                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9261                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9262                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9263                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9264                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9265                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9266                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9267                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9268                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9269                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9270                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9271                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9272                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9273                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9274                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9275                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9276                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9277                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9278                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9279                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9280                 </fields>
9281                 <links>
9282                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9283                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9284                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9285                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9286                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9287                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9288                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9289                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9290                 </links>
9291         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9292             <actions>
9293                 <retrieve permission="user_request.view">
9294                     <context link="usr" field="home_ou"/>
9295                                 </retrieve>
9296             </actions>
9297         </permacrud>
9298         </class>
9299
9300         <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">
9301                 <fields oils_persist:primary="id">
9302                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9303                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9304                 </fields>
9305                 <links/>
9306         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9307             <actions>
9308                 <retrieve/>
9309             </actions>
9310         </permacrud>
9311         </class>
9312
9313         <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">
9314                 <fields oils_persist:primary="code">
9315                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9316                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9317                 </fields>
9318                 <links/>
9319         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9320             <actions>
9321                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9322                 <retrieve/>
9323                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9324                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9325             </actions>
9326         </permacrud>
9327         </class>
9328
9329         <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">
9330                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9331                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9332                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9333                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9334                         <field reporter:label="Ratio" name="ratio" />
9335                 </fields>
9336                 <links>
9337                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9338                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9339                 </links>
9340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9341                         <actions>
9342                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9343                                 <retrieve/>
9344                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9345                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9346                         </actions>
9347                 </permacrud>
9348         </class>
9349
9350         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9351                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9352                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9353                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9354                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9355                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9356                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9357                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9358                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9359                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9360                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9361                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9362                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9363                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9364                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9365                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9366                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9367                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9368                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9369                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9370                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9371                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9372                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9373                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9374                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9375                 </fields>
9376                 <links>
9377                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9378                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9379                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9380                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9381                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9382                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9383                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9384                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9385                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9386                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9387                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9388                 </links>
9389         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9390             <actions>
9391                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9392                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9393                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9394                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9395             </actions>
9396         </permacrud>
9397         </class>
9398
9399         <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">
9400                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9401                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9402                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9403                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9404                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9405                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9406                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9407                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9408                 </fields>
9409                 <links>
9410                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9411                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9412                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9413                 </links>
9414         </class>
9415
9416         <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">
9417                 <fields oils_persist:primary="code">
9418                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9419                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9420                 </fields>
9421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9422             <actions>
9423                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9424                 <retrieve/>
9425                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9426                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9427             </actions>
9428                 </permacrud>
9429         </class>
9430
9431         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9432                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9433                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9434                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9435                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9436                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9437                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9438                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9439                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9440                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9441                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9442                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9443                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9444                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9445                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9446                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9447                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9448                 </fields>
9449                 <links>
9450                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9451                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9452                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9453                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9454                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9455                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9456                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9457                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9458                 </links>
9459         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9460             <actions>
9461                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9462                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9463                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9464                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9465             </actions>
9466         </permacrud>
9467         </class>
9468
9469         <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">
9470                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9471                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9472                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9473                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9474                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9475                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9476                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9477                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9478                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9479                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9480                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9481                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9482                 </fields>
9483                 <links>
9484                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9485                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9486                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9487                 </links>
9488         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9489             <actions>
9490                 <create   permission="ADMIN_INVOICE">
9491                                         <context link="invoice" field="receiver"/>
9492                                 </create>
9493                 <retrieve permission="ADMIN_INVOICE">
9494                                         <context link="invoice" field="receiver"/>
9495                                 </retrieve>
9496                 <update   permission="ADMIN_INVOICE">
9497                                         <context link="invoice" field="receiver"/>
9498                                 </update>
9499                                 <delete   permission="ADMIN_INVOICE">
9500                                         <context link="invoice" field="receiver"/>
9501                                 </delete>
9502             </actions>
9503         </permacrud>
9504         </class>
9505
9506         <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">
9507                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9508                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9509                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9510                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9511                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9512                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9513                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9514                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9515                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9516                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9517                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9518                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9519                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9520                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9521                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9522                 </fields>
9523                 <links>
9524                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9525                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9526                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9527                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9528                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9529                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9530                 </links>
9531         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9532             <actions>
9533                 <create   permission="ADMIN_INVOICE">
9534                                         <context link="invoice" field="receiver"/>
9535                                 </create>
9536                 <retrieve permission="ADMIN_INVOICE">
9537                                         <context link="invoice" field="receiver"/>
9538                                 </retrieve>
9539                 <update   permission="ADMIN_INVOICE">
9540                                         <context link="invoice" field="receiver"/>
9541                                 </update>
9542                                 <delete   permission="ADMIN_INVOICE">
9543                                         <context link="invoice" field="receiver"/>
9544                                 </delete>
9545             </actions>
9546         </permacrud>
9547         </class>
9548
9549         <class id="acqsn" 
9550                 controller="open-ils.cstore open-ils.pcrud" 
9551                 oils_obj:fieldmapper="acq::shipment_notification" 
9552                 oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9553                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9554                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9555                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9556                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9557                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9558                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp" />
9559                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9560                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp" />
9561                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link" />
9562                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" />
9563                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text" />
9564                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9565                         <field reporter:label="Shipment Notification Entries" name="entries" 
9566                                 reporter:datatype="link" oils_persist:virtual="true"/>
9567                 </fields>
9568                 <links>
9569                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9570                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9571                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9572                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9573                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9574                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9575                 </links>
9576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9577                         <actions>
9578                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9579                                 <update   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9580                                 <delete   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9581                         </actions>
9582                 </permacrud>
9583         </class>
9584
9585         <class id="acqsne" 
9586                 controller="open-ils.cstore open-ils.pcrud" 
9587                 oils_obj:fieldmapper="acq::shipment_notification_entry" 
9588                 oils_persist:tablename="acq.shipment_notification_entry" 
9589                 reporter:label="Shipment Notification Entry">
9590                 <fields oils_persist:primary="id" 
9591                         oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9592                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9593                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" />
9594                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9595                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" />
9596                 </fields>
9597                 <links>
9598                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9599                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9600                 </links>
9601                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9602                                 <actions>
9603                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9604                                                 <context link="shipment_notification" field="receiver"/>
9605                                         </retrieve>
9606                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9607                                                 <context link="shipment_notification" field="receiver"/>
9608                                         </update>
9609                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9610                                                 <context link="shipment_notification" field="receiver"/>
9611                                         </delete>
9612                                 </actions>
9613                         </permacrud>
9614         </class>
9615
9616         <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">
9617                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9618                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9619                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9620                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9621                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9622                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9623                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9624                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9625                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9626                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9627                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9628                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9629                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9630                 </fields>
9631                 <links>
9632                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9633                 </links>
9634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9635             <actions>
9636                 <create permission="ADMIN_PROVIDER">
9637                     <context link="provider" field="owner"/>
9638                 </create>
9639                 <retrieve permission="ADMIN_PROVIDER">
9640                     <context link="provider" field="owner"/>
9641                 </retrieve>
9642                 <update permission="ADMIN_PROVIDER">
9643                     <context link="provider" field="owner"/>
9644                 </update>
9645                 <delete permission="ADMIN_PROVIDER">
9646                     <context link="provider" field="owner"/>
9647                 </delete>
9648             </actions>
9649         </permacrud>
9650         </class>
9651
9652         <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">
9653                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9654                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9655                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9656                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9657                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9658                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9659                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9660                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9661         </fields>
9662                 <links>
9663                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9664                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9665                 </links>
9666         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9667             <actions>
9668                 <create permission="ADMIN_PROVIDER">
9669                     <context link="provider" field="owner"/>
9670                 </create>
9671                 <retrieve permission="ADMIN_PROVIDER">
9672                     <context link="provider" field="owner"/>
9673                 </retrieve>
9674                 <update permission="ADMIN_PROVIDER">
9675                     <context link="provider" field="owner"/>
9676                 </update>
9677                 <delete permission="ADMIN_PROVIDER">
9678                     <context link="provider" field="owner"/>
9679                 </delete>
9680             </actions>
9681         </permacrud>
9682     </class>
9683         <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">
9684                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9685                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9686                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9687                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9688                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9689                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9690                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9691                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9692                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9693                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9694                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9695                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9696                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9697                 </fields>
9698                 <links>
9699                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9700                 </links>
9701         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9702             <actions>
9703                 <create permission="ADMIN_PROVIDER">
9704                     <context link="contact" jump='provider' field="owner"/>
9705                 </create>
9706                 <retrieve permission="ADMIN_PROVIDER">
9707                     <context link="contact" jump='provider' field="owner"/>
9708                 </retrieve>
9709                 <update permission="ADMIN_PROVIDER">
9710                     <context link="contact" jump='provider' field="owner"/>
9711                 </update>
9712                 <delete permission="ADMIN_PROVIDER">
9713                     <context link="contact" jump='provider' field="owner"/>
9714                 </delete>
9715             </actions>
9716         </permacrud>
9717         </class>
9718
9719         <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">
9720                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9721                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9722                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9723                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9724                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9725                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9726                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9727                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9728                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9729                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9730                 </fields>
9731                 <links>
9732                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9733                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9734                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9735                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9736                 </links>
9737         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9738             <actions>
9739                 <create permission="ADMIN_ACQ_FUND">
9740                     <context link="src_fund" field="org"/>
9741                 </create>
9742                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9743                     <context link="src_fund" field="org"/>
9744                     <context link="dest_fund" field="org"/>
9745                 </retrieve>
9746                 <update permission="ADMIN_ACQ_FUND">
9747                     <context link="src_fund" field="org"/>
9748                 </update>
9749                 <delete permission="ADMIN_ACQ_FUND">
9750                     <context link="src_fund" field="org"/>
9751                 </delete>
9752             </actions>
9753         </permacrud>
9754         </class>
9755
9756         <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">
9757                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9758                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9759                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9760                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9761                 </fields>
9762                 <links>
9763             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9764                 </links>
9765                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9766                         <actions>
9767                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9768                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9769                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9770                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9771                         </actions>
9772                 </permacrud>
9773         </class>
9774
9775         <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">
9776                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9777                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9778                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9779                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9780                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9781                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9782                 </fields>
9783                 <links>
9784                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9785                 </links>
9786                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9787                         <actions>
9788                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9789                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9790                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9791                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9792                         </actions>
9793                 </permacrud>
9794         </class>
9795
9796         <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">
9797                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9798                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9799                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9800                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9801                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9802                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9803                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9804                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9805                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9806                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9807                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9808                 </fields>
9809                 <links>
9810                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9811                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9812             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9813             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9814                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9815                 </links>
9816         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9817             <actions>
9818                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9819                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9820                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9821                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9822             </actions>
9823         </permacrud>
9824         </class>
9825
9826         <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">
9827                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9828                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9829                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9830                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9831                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9832                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9833                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9834                 </fields>
9835                 <links>
9836                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9837                 </links>
9838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9839                         <actions>
9840                                 <create permission="ADMIN_FUNDING_SOURCE">
9841                     <context link="funding_source" field="owner"/>
9842                 </create>
9843                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9844                     <context link="funding_source" field="owner"/>
9845                 </retrieve>
9846                                 <update permission="ADMIN_FUNDING_SOURCE">
9847                     <context link="funding_source" field="owner"/>
9848                 </update>
9849                                 <delete permission="ADMIN_FUNDING_SOURCE">
9850                     <context link="funding_source" field="owner"/>
9851                 </delete>
9852                         </actions>
9853                 </permacrud>
9854         </class>
9855
9856         <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">
9857                 <fields oils_persist:primary="id">
9858                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9859                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9860                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9861                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9862                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9863                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9864                 </fields>
9865                 <links>
9866                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9867                 </links>
9868         </class>
9869
9870         <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">
9871                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9872                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9873                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9874                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9875                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9876                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9877                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9878                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9879                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9880                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9881                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9882                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9883                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9884                 </fields>
9885                 <links>
9886                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9887                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9888                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9889                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9890                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9891                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9892                 </links>
9893                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9894                         <actions>
9895                                 <create permission="ADMIN_ACQ_FUND">
9896                     <context link="fund" field="org"/>
9897                 </create>
9898                                 <retrieve permission="ADMIN_ACQ_FUND">
9899                     <context link="fund" field="org"/>
9900                 </retrieve>
9901                                 <update permission="ADMIN_ACQ_FUND">
9902                     <context link="fund" field="org"/>
9903                 </update>
9904                                 <delete permission="ADMIN_ACQ_FUND">
9905                     <context link="fund" field="org"/>
9906                 </delete>
9907                         </actions>
9908                 </permacrud>
9909         </class>
9910
9911         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9912                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9913                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9914                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9915                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9916                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9917                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9918                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9919                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9920                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9921                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9922                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9923                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9924                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9925                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9926                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9927                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9928                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9929                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9930                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9931                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9932                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9933                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9934                 </fields>
9935                 <links>
9936                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9937                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9938             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9939             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9940             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9941             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9942             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9943             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9944             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9945             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9946             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9947                 </links>
9948         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9949             <actions>
9950                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9951                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9952                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9953                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9954             </actions>
9955         </permacrud>
9956         </class>
9957
9958         <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">
9959                 <fields oils_persist:primary="fund">
9960                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9961                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9962                 </fields>
9963                 <links>
9964                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9965                 </links>
9966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9967             <actions>
9968                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9969                                         <context link="fund" field="org" />
9970                 </retrieve>
9971             </actions>
9972         </permacrud>
9973         </class>
9974
9975         <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">
9976                 <fields oils_persist:primary="fund">
9977                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9978                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9979                 </fields>
9980                 <links>
9981                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9982                 </links>
9983         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9984             <actions>
9985                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9986                                         <context link="fund" field="org" />
9987                 </retrieve>
9988             </actions>
9989         </permacrud>
9990         </class>
9991
9992         <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">
9993                 <fields oils_persist:primary="fund">
9994                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9995                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9996                 </fields>
9997                 <links>
9998                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9999                 </links>
10000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10001             <actions>
10002                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10003                                         <context link="fund" field="org" />
10004                 </retrieve>
10005             </actions>
10006         </permacrud>
10007         </class>
10008
10009         <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">
10010                 <fields oils_persist:primary="fund">
10011                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10012                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10013                 </fields>
10014                 <links>
10015                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10016                 </links>
10017         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10018             <actions>
10019                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10020                                         <context link="fund" field="org" />
10021                 </retrieve>
10022             </actions>
10023         </permacrud>
10024         </class>
10025
10026         <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">
10027                 <fields oils_persist:primary="fund">
10028                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10029                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
10030                 </fields>
10031                 <links>
10032                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10033                 </links>
10034         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10035             <actions>
10036                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10037                                         <context link="fund" field="org" />
10038                 </retrieve>
10039             </actions>
10040         </permacrud>
10041         </class>
10042
10043    <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">
10044         <fields oils_persist:primary="fund">
10045             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10046             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10047         </fields>
10048         <links>
10049             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10050         </links>
10051     </class>
10052
10053    <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">
10054         <fields oils_persist:primary="fund">
10055             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10056             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
10057         </fields>
10058         <links>
10059             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10060         </links>
10061     </class>
10062
10063    <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">
10064         <fields oils_persist:primary="fund">
10065             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10066             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10067         </fields>
10068         <links>
10069             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10070         </links>
10071     </class>
10072
10073    <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">
10074         <fields oils_persist:primary="fund">
10075             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10076             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10077         </fields>
10078         <links>
10079             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10080         </links>
10081     </class>
10082
10083    <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">
10084         <fields oils_persist:primary="fund">
10085             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10086             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10087         </fields>
10088         <links>
10089             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10090         </links>
10091     </class>
10092
10093         <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">
10094                 <fields oils_persist:primary="funding_source">
10095                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10096                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10097                 </fields>
10098                 <links>
10099                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10100                 </links>
10101         </class>
10102
10103         <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">
10104                 <fields oils_persist:primary="funding_source">
10105                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10106                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10107                 </fields>
10108                 <links>
10109                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10110                 </links>
10111         </class>
10112
10113         <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">
10114                 <fields oils_persist:primary="funding_source">
10115                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10116                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10117                 </fields>
10118                 <links>
10119                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10120                 </links>
10121         </class>
10122
10123         <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">
10124                 <fields oils_persist:primary="fund">
10125                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10126                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10127                 </fields>
10128                 <links>
10129                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10130                 </links>
10131         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10132             <actions>
10133                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10134                                         <context link="fund" field="org" />
10135                 </retrieve>
10136             </actions>
10137         </permacrud>
10138     </class>
10139     <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">
10140         <oils_persist:source_definition><![CDATA[
10141             SELECT
10142                 acqf.*,
10143                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10144                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10145                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10146                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10147             FROM
10148                 acq.fund acqf
10149                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10150                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10151                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10152                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10153         ]]></oils_persist:source_definition>
10154         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10155             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10156             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10157             <field reporter:label="Name" name="name" reporter:datatype="text" />
10158             <field reporter:label="Year" name="year" reporter:datatype="int" />
10159             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10160             <field reporter:label="Code" name="code" reporter:datatype="text" />
10161             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10162             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10163             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10164             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10165             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10166
10167             <!-- non fund-native fields -->
10168             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10169             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10170             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10171             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10172         </fields>
10173         <links>
10174             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10175             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10176             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10177         </links>
10178         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10179             <actions>
10180                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10181             </actions>
10182         </permacrud>
10183         </class>
10184         <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">
10185                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10186                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10187                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10188                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10189                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10190                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10191                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10192                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10193                 </fields>
10194                 <links>
10195                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10196                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10197                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10198                 </links>
10199                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10200                         <actions>
10201                                 <create permission="ADMIN_ACQ_FUND">
10202                     <context link="fund" field="org"/>
10203                 </create>
10204                                 <retrieve permission="ADMIN_ACQ_FUND">
10205                     <context link="fund" field="org"/>
10206                 </retrieve>
10207                                 <update permission="ADMIN_ACQ_FUND">
10208                     <context link="fund" field="org"/>
10209                 </update>
10210                                 <delete permission="ADMIN_ACQ_FUND">
10211                     <context link="fund" field="org"/>
10212                 </delete>
10213                         </actions>
10214                 </permacrud>
10215         </class>
10216
10217     <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">
10218         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10219             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10220             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10221             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10222             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10223             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10224             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10225             <field reporter:label="Note" name="note" reporter:datatype="text" />
10226             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10227         </fields>
10228         <links>
10229             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10230             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10231             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10232         </links>
10233                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10234                         <actions>
10235                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10236                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10237                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10238                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10239                         </actions>
10240                 </permacrud>
10241     </class>
10242
10243         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10244                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10245                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10246                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10247                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10248                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10249                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10250                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10251                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10252                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10253                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10254                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10255                 </fields>
10256                 <links>
10257                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10258                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10259                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10260                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10261                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10262                 </links>
10263                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10264                         <actions>
10265                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10266                         </actions>
10267                 </permacrud>
10268         </class>
10269
10270         <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">
10271                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10272                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10273                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10274                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10275                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10276                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10277                 </fields>
10278                 <links>
10279                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10280                 </links>
10281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10282                         <actions>
10283                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10284                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10285                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10286                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10287                         </actions>
10288                 </permacrud>
10289         </class>
10290
10291         <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">
10292                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10293                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10294                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10295                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10296                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10297                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10298                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10299                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10300                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10301                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10302                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10303                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10304                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10305                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10306                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10307                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10308                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10309                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10310                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10311                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10312                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10313                 </fields>
10314                 <links>
10315                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10316                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10317                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10318                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10319                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10320                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10321                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10322                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10323                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10324                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10325                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10326                 </links>
10327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10328                         <actions>
10329                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10330                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10331                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10332                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10333                         </actions>
10334                 </permacrud>
10335         </class>
10336
10337         <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">
10338                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10339                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10340                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10341                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10342                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10343                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10344                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10345                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10346                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10347                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10348                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10349                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10350                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10351                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10352                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10353                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10354                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10355                 </fields>
10356                 <links>
10357                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10358                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10359                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10360                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10361                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10362                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10363                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10364                 </links>
10365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10366             <actions>
10367                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10368             </actions>
10369                 </permacrud>
10370         </class>
10371
10372         <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">
10373                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10374                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10375                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10376                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10377                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10378                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10379                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10380                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10381                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10382                 </fields>
10383                 <links>
10384                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10385                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10386                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10387                 </links>
10388                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10389             <actions>
10390                 <create permission="CREATE_PURCHASE_ORDER">
10391                     <context link="purchase_order" field="ordering_agency"/>
10392                 </create>
10393                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10394                     <context link="purchase_order" field="ordering_agency"/>
10395                 </retrieve>
10396                 <update permission="CREATE_PURCHASE_ORDER">
10397                     <context link="purchase_order" field="ordering_agency"/>
10398                 </update>
10399                 <delete permission="CREATE_PURCHASE_ORDER">
10400                     <context link="purchase_order" field="ordering_agency"/>
10401                 </delete>
10402             </actions>
10403                 </permacrud>
10404         </class>
10405
10406         <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">
10407                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10408                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10409                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10410                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10411                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10412                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10413                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10414                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10415                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10416                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10417                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10418                 </fields>
10419                 <links>
10420                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10421                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10422                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10423                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10424                 </links>
10425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10426             <actions>
10427                 <create permission="CREATE_PURCHASE_ORDER">
10428                     <context link="purchase_order" field="ordering_agency"/>
10429                 </create>
10430                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10431                     <context link="purchase_order" field="ordering_agency"/>
10432                 </retrieve>
10433                 <update permission="CREATE_PURCHASE_ORDER">
10434                     <context link="purchase_order" field="ordering_agency"/>
10435                 </update>
10436                 <delete permission="CREATE_PURCHASE_ORDER">
10437                     <context link="purchase_order" field="ordering_agency"/>
10438                 </delete>
10439             </actions>
10440                 </permacrud>
10441         </class>
10442
10443         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10444                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10445                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10446                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10447                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10448                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10449                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10450                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10451                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10452                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10453                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10454                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10455                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10456                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10457                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10458                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10459                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10460                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10461                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10462                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10463                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10464                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10465                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10466                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10467                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10468                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10469                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10470                 </fields>
10471                 <links>
10472                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10473                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10474                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10475                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10476                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10477                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10478                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10479                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10480                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10481                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10482                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10483                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10484                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10485                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10486                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10487                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10488                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10489                 </links>
10490                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10491                         <actions>
10492                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10493                                         <context link="purchase_order" field="ordering_agency"/>
10494                                         <context link="picklist" field="org_unit"/>
10495                                 </retrieve>
10496                         </actions>
10497                 </permacrud>
10498         </class>
10499
10500         <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">
10501                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10502                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10503                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10504                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10505                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10506                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10507                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10508                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10509                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10510                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10511                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10512                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10513                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10514                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10515                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10516                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10517                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10518                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10519                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10520                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10521                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10522                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10523                 </fields>
10524                 <links>
10525                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10526                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10527                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10528                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10529                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10530                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10531                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10532                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10533                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10534                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10535                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10536                 </links>
10537                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10538                         <actions>
10539                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10540                                         <context link="purchase_order" field="ordering_agency"/>
10541                                         <context link="picklist" field="org_unit"/>
10542                                 </retrieve>
10543                         </actions>
10544                 </permacrud>
10545         </class>
10546
10547         <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">
10548                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10549                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10550                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10551                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10552                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10553                 </fields>
10554                 <links>
10555                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10556                 </links>
10557                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10558                         <actions>
10559                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10560                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10561                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10562                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10563                         </actions>
10564                 </permacrud>
10565         </class>
10566
10567         <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">
10568                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10569                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10570                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10571                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10572                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10573                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10574                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10575                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10576                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10577                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10578                 </fields>
10579                 <links>
10580                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10581                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10582                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10583                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10584                 </links>
10585         </class>
10586
10587         <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">
10588                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10589                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10590                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10591                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10592                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10593                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10594                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10595                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10596                 </fields>
10597                 <links>
10598                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10599                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10600                 </links>
10601         </class>
10602
10603         <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">
10604                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10605                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10606                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10607                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10608                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10609                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10610                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10611                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10612                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10613                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10614                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10615                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10616                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10617                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10618                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10619                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10620                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10621                 </fields>
10622                 <links>
10623                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10624                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10625                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10626                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10627                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10628                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10629                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10630                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10631                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10632                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10633                 </links>
10634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10635             <actions>
10636                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10637                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10638                     <context link="lineitem" jump="picklist" field="org_unit"/>
10639                 </retrieve>
10640             </actions>
10641         </permacrud>
10642         </class>
10643
10644         <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">
10645                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10646                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10647                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10648                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10649                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10650                 </fields>
10651                 <links/>
10652                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10653                         <actions>
10654                                 <retrieve />
10655                         </actions>
10656                 </permacrud>
10657         </class>
10658
10659         <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">
10660                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10661                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10662                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10663                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10664                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10665                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10666             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10667                 </fields>
10668                 <links/>
10669         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10670             <actions>
10671                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10672                 <retrieve />
10673                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10674                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10675             </actions>
10676         </permacrud>
10677         </class>
10678
10679         <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">
10680                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10681                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10682                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10683                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10684                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10685                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10686                 </fields>
10687                 <links/>
10688         </class>
10689         <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">
10690                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10691                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10692                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10693                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10694                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10695                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10696                 </fields>
10697                 <links>
10698                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10699                 </links>
10700         </class>
10701
10702         <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">
10703             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10704                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10705                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10706                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10707                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10708                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10709                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10710         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10711
10712             </fields>
10713             <links>
10714                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10715             </links>
10716             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10717                 <actions>
10718                     <create permission="ADMIN_PROVIDER">
10719                         <context link="provider" field="owner"/>
10720                     </create>
10721                     <retrieve permission="ADMIN_PROVIDER">
10722                         <context link="provider" field="owner"/>
10723                     </retrieve>
10724                     <update permission="ADMIN_PROVIDER">
10725                         <context link="provider" field="owner"/>
10726                     </update>
10727                     <delete permission="ADMIN_PROVIDER">
10728                         <context link="provider" field="owner"/>
10729                     </delete>
10730                 </actions>
10731             </permacrud>
10732         </class>
10733         
10734         <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">
10735             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10736                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10737                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10738                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10739                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10740             </fields>
10741             <links>
10742                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10743             </links>
10744             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10745                 <actions>
10746                     <create permission="ADMIN_PROVIDER">
10747                         <context link="provider" field="owner"/>
10748                     </create>
10749                     <retrieve permission="ADMIN_PROVIDER">
10750                         <context link="provider" field="owner"/>
10751                     </retrieve>
10752                     <update permission="ADMIN_PROVIDER">
10753                         <context link="provider" field="owner"/>
10754                     </update>
10755                     <delete permission="ADMIN_PROVIDER">
10756                         <context link="provider" field="owner"/>
10757                     </delete>
10758                 </actions>
10759             </permacrud>
10760         </class>
10761         
10762         <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">
10763             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10764                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10765                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10766                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10767                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10768                 </fields>
10769                 <links/>
10770         </class>
10771
10772         <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">
10773                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10774                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10775                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10776                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10777                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10778                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10779                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10780                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10781                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10782                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10783                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10784                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10785                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10786                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10787                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10788                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10789                 </fields>
10790                 <links>
10791                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10792                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10793                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10794                 </links>
10795         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10796             <actions>
10797                 <create permission="ADMIN_PROVIDER">
10798                     <context link="provider" field="owner"/>
10799                 </create>
10800                 <retrieve permission="ADMIN_PROVIDER">
10801                     <context link="provider" field="owner"/>
10802                 </retrieve>
10803                 <update permission="ADMIN_PROVIDER">
10804                     <context link="provider" field="owner"/>
10805                 </update>
10806                 <delete permission="ADMIN_PROVIDER">
10807                     <context link="provider" field="owner"/>
10808                 </delete>
10809             </actions>
10810         </permacrud>
10811         </class>
10812
10813         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10814                 oils_obj:fieldmapper="acq::edi_attr" 
10815                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10816                 <fields oils_persist:primary="key">
10817                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10818                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10819                 </fields>
10820         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10821             <actions>
10822                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10823                 <retrieve/>
10824                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10825                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10826             </actions>
10827         </permacrud>
10828         </class>
10829         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10830                 oils_obj:fieldmapper="acq::edi_attr_set" 
10831                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10832                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10833                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10834                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10835                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10836                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10837                 </fields>
10838                 <links>
10839                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10840                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10841                 </links>
10842         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10843             <actions>
10844                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10845                 <retrieve/>
10846                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10847                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10848             </actions>
10849         </permacrud>
10850         </class>
10851         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10852                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10853                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10854                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10855                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10856                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10857                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10858                 </fields>
10859                 <links>
10860                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10861                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10862                 </links>
10863         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10864             <actions>
10865                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10866                 <retrieve/>
10867                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10868                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10869             </actions>
10870         </permacrud>
10871         </class>
10872
10873
10874         <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">
10875                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10876                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10877                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10878                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10879                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10880                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10881                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10882                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10883                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10884                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10885                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10886                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10887                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10888                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10889                 </fields>
10890                 <links>
10891                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10892                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10893                 </links>
10894         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10895             <actions>
10896                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10897                     <context link="account" jump="provider" field="owner"/>
10898                 </retrieve>
10899                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10900                     <context link="account" jump="provider" field="owner"/>
10901                 </update>
10902                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10903                     <context link="account" jump="provider" field="owner"/>
10904                 </delete>
10905             </actions>
10906         </permacrud>
10907         </class>
10908
10909
10910         <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">
10911                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10912                         <field name="id" reporter:datatype="id" />
10913                         <field name="parent" reporter:datatype="link"/>
10914                         <field name="owner" reporter:datatype="link"/>
10915                         <field name="create_time" reporter:datatype="timestamp"/>
10916                         <field name="name" reporter:datatype="text"/>
10917                         <field name="shared" reporter:datatype="bool"/>
10918                         <field name="share_with" reporter:datatype="link"/>
10919                         <field name="simple_reporter" reporter:datatype="bool"/>
10920                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10921                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10922                 </fields>
10923                 <links>
10924                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10925                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10926                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10927                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10928                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10929                 </links>
10930         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10931             <actions>
10932                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10933                     <context link="owner" field="home_ou"/>
10934                 </create>
10935                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10936                     <context link="owner" field="home_ou"/>
10937                 </retrieve>
10938                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10939                     <context link="owner" field="home_ou"/>
10940                 </update>
10941                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10942                     <context link="owner" field="home_ou"/>
10943                 </delete>
10944             </actions>
10945         </permacrud>
10946         </class>
10947         <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">
10948                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10949                         <field name="id" reporter:datatype="id" />
10950                         <field name="parent" reporter:datatype="link"/>
10951                         <field name="owner" reporter:datatype="link"/>
10952                         <field name="create_time" reporter:datatype="timestamp"/>
10953                         <field name="name" reporter:datatype="text"/>
10954                         <field name="shared" reporter:datatype="bool"/>
10955                         <field name="share_with" reporter:datatype="link"/>
10956                         <field name="simple_reporter" reporter:datatype="bool"/>
10957                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10958                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10959                 </fields>
10960                 <links>
10961                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10962                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10963                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10964                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10965                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10966                 </links>
10967         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10968             <actions>
10969                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10970                     <context link="owner" field="home_ou"/>
10971                 </create>
10972                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10973                     <context link="owner" field="home_ou"/>
10974                 </retrieve>
10975                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10976                     <context link="owner" field="home_ou"/>
10977                 </update>
10978                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10979                     <context link="owner" field="home_ou"/>
10980                 </delete>
10981             </actions>
10982         </permacrud>
10983         </class>
10984         <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">
10985                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10986                         <field name="id" reporter:datatype="id" />
10987                         <field name="parent" reporter:datatype="link"/>
10988                         <field name="owner" reporter:datatype="link"/>
10989                         <field name="create_time" reporter:datatype="timestamp"/>
10990                         <field name="name" reporter:datatype="text"/>
10991                         <field name="shared" reporter:datatype="bool"/>
10992                         <field name="share_with" reporter:datatype="link"/>
10993                         <field name="simple_reporter" reporter:datatype="bool"/>
10994                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10995                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10996                 </fields>
10997                 <links>
10998                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10999                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
11000                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
11001                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11002                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
11003                 </links>
11004         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11005             <actions>
11006                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11007                     <context link="owner" field="home_ou"/>
11008                 </create>
11009                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11010                     <context link="owner" field="home_ou"/>
11011                 </retrieve>
11012                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11013                     <context link="owner" field="home_ou"/>
11014                 </update>
11015                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11016                     <context link="owner" field="home_ou"/>
11017                 </delete>
11018             </actions>
11019         </permacrud>
11020         </class>
11021         <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">
11022                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
11023                         <field name="id" reporter:datatype="id" />
11024                         <field name="owner" reporter:datatype="link"/>
11025                         <field name="create_time" reporter:datatype="timestamp"/>
11026                         <field name="name" reporter:datatype="text"/>
11027                         <field name="data" reporter:datatype="text"/>
11028                         <field name="folder" reporter:datatype="link"/>
11029                         <field name="description" reporter:datatype="text"/>
11030                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11031                 </fields>
11032                 <links>
11033                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11034                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
11035                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
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="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">
11055                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11056                         <field name="id" reporter:datatype="id" />
11057                         <field name="owner" reporter:datatype="link"/>
11058                         <field name="create_time" reporter:datatype="timestamp"/>
11059                         <field name="template" reporter:datatype="link"/>
11060                         <field name="data" reporter:datatype="text"/>
11061                         <field name="folder" reporter:datatype="link"/>
11062                         <field name="recur" reporter:datatype="bool"/>
11063                         <field name="recurrence" reporter:datatype="interval"/>
11064                         <field name="name" reporter:datatype="text"/>
11065                         <field name="description" reporter:datatype="text"/>
11066                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11067                 </fields>
11068                 <links>
11069                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11070                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11071                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11072                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
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="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">
11092                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11093                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11094                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11095                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11096                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11097                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11098                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11099                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11100                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11101                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11102                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11103                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11104                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11105                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11106                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11107                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11108                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11109                 </fields>
11110                 <links>
11111                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11112                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11113                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11114                 </links>
11115         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11116             <actions>
11117                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11118                     <context link="runner" field="home_ou"/>
11119                 </create>
11120                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11121                     <context link="runner" field="home_ou"/>
11122                 </retrieve>
11123                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11124                     <context link="runner" field="home_ou"/>
11125                 </update>
11126                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11127                     <context link="runner" field="home_ou"/>
11128                 </delete>
11129             </actions>
11130         </permacrud>
11131         </class>
11132     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11133            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11134            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11135                 <fields oils_persist:primary="run">
11136             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11137             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11138             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11139             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11140             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11141             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11142             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11143             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11144             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11145             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11146             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11147             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11148             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11149             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11150             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11151             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11152                 </fields>
11153                 <links>
11154             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11155             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11156             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11157             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11158             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11159             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11160             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11161             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11162             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11163                 </links>
11164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11165             <actions>
11166                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11167                     <context link="runner" field="home_ou"/>
11168                 </retrieve>
11169             </actions>
11170         </permacrud>
11171     </class>
11172         <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">
11173                 <fields oils_persist:primary="id">
11174                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11175                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11176                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11177                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11178                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11179                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11180                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11181                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11182                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11183                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11184                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11185                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11186                 </fields>
11187                 <links>
11188                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11189                 </links>
11190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11191                         <actions>
11192                                 <retrieve />
11193                         </actions>
11194                 </permacrud>
11195         </class>
11196         <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">
11197                 <fields oils_persist:primary="id">
11198                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11199                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11200                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11201                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11202                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11203                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11204                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11205                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11206                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11207                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11208                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11209                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11210                 </fields>
11211                 <links>
11212                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11213                 </links>
11214         </class>
11215         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11216                 <fields oils_persist:primary="id">
11217                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11218                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11219                         <field reporter:label="Fingerprint" name="fingerprint" />
11220                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11221                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11222                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11223                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11224                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11225                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11226                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11227                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11228                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11229                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11230                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11231                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11232                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11233                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11234                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11235                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11236                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11237                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11238                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11239                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11240                 </fields>
11241                 <links>
11242                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11243                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11244                 </links>
11245         </class>
11246         <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">
11247                 <fields oils_persist:primary="id">
11248                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11249                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11250                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11251                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11252                 </fields>
11253                 <links>
11254                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11255                 </links>
11256         </class>
11257         <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">
11258                 <fields oils_persist:primary="id">
11259                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11260                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11261                 </fields>
11262                 <links>
11263                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11264                 </links>
11265         </class>
11266         <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">
11267                 <fields oils_persist:primary="id">
11268                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11269                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11270                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11271                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11272                 </fields>
11273                 <links>
11274                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11275                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11276                 </links>
11277                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11278                         <actions>
11279                                 <retrieve permission="VIEW_HOLD">
11280                                         <context link="id" field="pickup_lib"/>
11281                                 </retrieve>
11282                         </actions>
11283                 </permacrud>
11284         </class>
11285         <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">
11286                 <fields oils_persist:primary="xact">
11287                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11288                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11289                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11290                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11291                 </fields>
11292                 <links>
11293                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11294                 </links>
11295         </class>
11296         <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">
11297                 <fields oils_persist:primary="xact">
11298                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11299                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11300                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11301                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11302                 </fields>
11303                 <links>
11304                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11305                 </links>
11306         </class>
11307         <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)">
11308                 <fields oils_persist:primary="id">
11309                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11310                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11311                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11312                 </fields>
11313                 <links>
11314                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11315                 </links>
11316         </class>
11317         <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">
11318                 <fields oils_persist:primary="id">
11319                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11320                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11321                 </fields>
11322                 <links>
11323                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11324                 </links>
11325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11326                         <actions>
11327                                 <retrieve permission="STAFF_LOGIN">
11328                                         <context link="id" field="circ_lib"/>
11329                                 </retrieve>
11330                         </actions>
11331                 </permacrud>
11332         </class>
11333         <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">
11334                 <fields oils_persist:primary="bibid">
11335                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11336                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11337                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11338                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11339                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11340                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11341                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11342                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11343                 </fields>
11344                 <links>
11345                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11346                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11347                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11348                 </links>
11349         </class>
11350         <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">
11351                 <fields oils_persist:primary="copy_id">
11352                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11353                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11354                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11355                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11356                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11357                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11358                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11359                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11360                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11361                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11362                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11363                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11364                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11365                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11366                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11367                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11368                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11369                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11370                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11371                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11372                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11373                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11374                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11375                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11376                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11377                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11378                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11379                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11380                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11381                 </fields>
11382                 <links>
11383                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11384                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11385                 </links>
11386         </class>
11387         <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">
11388                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11389                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11390                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11391                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11392                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11393                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11394                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11395                 </fields>
11396                 <links>
11397                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11398                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11399                 </links>
11400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11401                         <actions>
11402                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11403                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11404                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11405                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11406                         </actions>
11407                 </permacrud>
11408         </class>
11409         <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">
11410                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11411                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11412                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11413                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11414                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11415                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11416                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11417                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11418                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11419                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11420                 </fields>
11421                 <links>
11422                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11423                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11424                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11425                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11426                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11427                 </links>
11428                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11429                         <actions>
11430                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11431                                         <context link="formula" field="owner"/>
11432                                 </create>
11433                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11434                                         <context link="formula" field="owner"/>
11435                                 </retrieve>
11436                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11437                                         <context link="formula" field="owner"/>
11438                                 </update>
11439                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11440                                         <context link="formula" field="owner"/>
11441                                 </delete>
11442                         </actions>
11443                 </permacrud>
11444         </class>
11445
11446         <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">
11447                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11448                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11449                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11450                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11451                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11452                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11453                 </fields>
11454                 <links>
11455                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11456                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11457                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11458                 </links>
11459                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11460                         <actions>
11461                                 <create permission="CREATE_PURCHASE_ORDER">
11462                                         <context link="formula" field="owner"/>
11463                 </create>
11464                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11465                                         <context link="formula" field="owner"/>
11466                 </retrieve>
11467                                 <update permission="CREATE_PURCHASE_ORDER">
11468                                         <context link="formula" field="owner"/>
11469                 </update>
11470                                 <delete permission="CREATE_PURCHASE_ORDER">
11471                                         <context link="formula" field="owner"/>
11472                 </delete>
11473                         </actions>
11474                 </permacrud>
11475         </class>
11476
11477         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11478                 <fields oils_persist:primary="id">
11479                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11480                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11481                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11482                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11483                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11484                 </fields>
11485                 <links>
11486                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11487                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11488                 </links>
11489         </class>
11490
11491         <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">
11492                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11493                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11494                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11495                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11496                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11497                 </fields>
11498                 <links>
11499                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11500                 </links>
11501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11502                         <actions>
11503                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11504                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11505                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11506                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11507                         </actions>
11508                 </permacrud>
11509         </class>
11510
11511         <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">
11512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11513                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11514                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11515                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11516                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11517                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11518                 </fields>
11519                 <links>
11520                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11521                 </links>
11522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11523                         <actions>
11524                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11525                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11526                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11527                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11528                         </actions>
11529                 </permacrud>
11530         </class>
11531
11532         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11533                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11534                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11535                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11536                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11537                 </fields>
11538                 <links>
11539                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11540                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11541                 </links>
11542         </class>
11543
11544         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11545                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11546                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11547                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11548                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11549                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11550                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11551                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11552                 </fields>
11553                 <links>
11554                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11555                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11556                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11557                 </links>
11558         </class>
11559
11560         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11561                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11562                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11563                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11564                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11565                 </fields>
11566                 <links>
11567                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11568                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11569                 </links>
11570         </class>
11571
11572         <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">
11573                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11574                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11575                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11576                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11577                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11578                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11579                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11580                 </fields>
11581                 <links>
11582                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11583                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11584                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11585                 </links>
11586         </class>
11587
11588         <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">
11589                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11590                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11591                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11592                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11593                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11594                 </fields>
11595                 <links>
11596                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11597                 </links>
11598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11599             <actions>
11600                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11601                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11602                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11603                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11604             </actions>
11605                 </permacrud>
11606         </class>
11607
11608         <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">
11609                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11610                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11611                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11612                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11613                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11614                 </fields>
11615                 <links>
11616                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11617                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11618                 </links>
11619                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11620                         <actions>
11621                                 <create permission="ADMIN_CLAIM_POLICY">
11622                                         <context link="claim_policy" field="org_unit"/>
11623                 </create>
11624                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11625                                         <context link="claim_policy" field="org_unit"/>
11626                 </retrieve>
11627                                 <update permission="ADMIN_CLAIM_POLICY">
11628                                         <context link="claim_policy" field="org_unit"/>
11629                 </update>
11630                                 <delete permission="ADMIN_CLAIM_POLICY">
11631                                         <context link="claim_policy" field="org_unit"/>
11632                 </delete>
11633                         </actions>
11634                 </permacrud>
11635         </class>
11636
11637     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11638         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11639             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11640             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11641             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11642             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11643             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11644             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11645             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11646             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11647             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11648             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11649             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11650             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11651             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11652             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11653             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11654             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11655                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11656                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11657                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11658         </fields>
11659         <links>
11660             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11661             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11662         </links>
11663     </class>
11664
11665     <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">
11666         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11667             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11668             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11669             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11670             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11671             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11672         </fields>
11673     </class>
11674
11675     <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">
11676         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11677             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11678             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11679             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11680             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11681             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11682             <field reporter:label="City" name="city" reporter:datatype="text"/>
11683             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11684             <field reporter:label="State" name="state" reporter:datatype="text"/>
11685             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11686             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11687             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11688         </fields>
11689     </class>
11690
11691     <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">
11692         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11693             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11694             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11695             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11696             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11697             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11698             <field reporter:label="City" name="city" reporter:datatype="text"/>
11699             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11700             <field reporter:label="State" name="state" reporter:datatype="text"/>
11701             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11702             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11703             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11704         </fields>
11705     </class>
11706
11707     <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">
11708         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11709             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11710             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11711             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11712             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11713             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11714             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11715         </fields>
11716     </class>
11717
11718     <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">
11719         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11720             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11721             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11722             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11723             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11724             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11725             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11726         </fields>
11727     </class>
11728
11729         <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">
11730                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11731                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11732                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11733                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11734                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11735                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11736                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11737                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11738                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11739                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11740                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11741                 </fields>
11742                 <links>
11743                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11744                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11745                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11746                 </links>
11747                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11748                         <actions>
11749                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11750                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11751                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11752                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11753                         </actions>
11754                 </permacrud>
11755         </class>
11756
11757         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11758                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11759                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11760                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11761                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11762                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11763                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11764                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11765                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11766                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11767                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11768                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11769                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11770                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11771                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11772                 </fields>
11773                 <links>
11774                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11775                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11776                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11777                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11778                 </links>
11779                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11780                         <actions>
11781                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11782                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11783                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11784                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11785                         </actions>
11786                 </permacrud>
11787         </class>
11788
11789         <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">
11790                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11791                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11792                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11793                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11794                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11795                 </fields>
11796                 <links>
11797                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11798                 </links>
11799                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11800                         <actions>
11801                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11802                     <context link="fieldset" field="owning_lib"/>
11803                 </create>
11804                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11805                     <context link="fieldset" field="owning_lib"/>
11806                 </retrieve>
11807                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11808                     <context link="fieldset" field="owning_lib"/>
11809                 </update>
11810                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11811                     <context link="fieldset" field="owning_lib"/>
11812                 </delete>
11813                         </actions>
11814                 </permacrud>
11815         </class>
11816
11817     <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">
11818         <fields>
11819             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11820             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11821             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11822         </fields>
11823                 <links>
11824                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11825                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11826                 </links>
11827     </class>
11828
11829     <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">
11830         <fields>
11831             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11832             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11833         </fields>
11834                 <links>
11835                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11836                 </links>
11837     </class>
11838
11839     <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">
11840         <fields>
11841             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11842             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11843             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11844         </fields>
11845                 <links>
11846                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11847                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11848                 </links>
11849     </class>
11850
11851     <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">
11852         <fields>
11853             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11854             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11855         </fields>
11856                 <links>
11857                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11858                 </links>
11859     </class>
11860
11861     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11862                 <oils_persist:source_definition><![CDATA[
11863
11864             SELECT  DISTINCT l.*
11865               FROM  action.unfulfilled_hold_loops l
11866                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11867               WHERE l.count = m.max
11868
11869                 ]]></oils_persist:source_definition>
11870         <fields>
11871             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11872             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11873             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11874         </fields>
11875                 <links>
11876                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11877                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11878                 </links>
11879     </class>
11880
11881         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11882                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11883                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11884                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11885                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11886                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11887                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11888                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11889                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11890                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11891                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11892                 </fields>
11893                 <links>
11894                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11895                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11896                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11897                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11898                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11899                 </links>
11900         </class>
11901
11902         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11903                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11904                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11905                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11906                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11907                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11908                 </fields>
11909                 <links>
11910                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11911                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11912                 </links>
11913         </class>
11914
11915         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11916                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11917                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11918                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11919                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11920                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11921                 </fields>
11922                 <links>
11923                 </links>
11924         </class>
11925
11926         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11927                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11928                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11929                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11930                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11931                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11932                 </fields>
11933                 <links>
11934                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11935                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11936                 </links>
11937         </class>
11938         
11939         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11940                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11941                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11942                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11943                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11944                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11945                 </fields>
11946                 <links>
11947                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11948                 </links>
11949         </class>
11950         
11951         <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">
11952                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11953                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11954                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11955                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11956                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11957                 </fields>
11958                 <links>
11959                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11960                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11961                 </links>
11962         </class>
11963
11964         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11965                 <fields oils_persist:primary="name">
11966                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11967                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11968                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11969                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11970                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11971                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11972                 </fields>
11973                 <links>
11974                 </links>
11975         </class>
11976
11977         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11978                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11979                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11980                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11981                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11982                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11983                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11984                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11985                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11986                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11987                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11988                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11989                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11990                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11991                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11992                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11993                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11994                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11995                 </fields>
11996                 <links>
11997                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11998                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11999                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12000                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12001                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12002                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12003                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12004                 </links>
12005         </class>
12006
12007         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
12008                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
12009                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
12010                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12011                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12012                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
12013                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
12014                 </fields>
12015                 <links>
12016                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12017                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
12018                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
12019                 </links>
12020         </class>
12021
12022         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
12023                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
12024                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
12025                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
12026                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
12027                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
12028                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
12029                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
12030                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12031                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
12032                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12033                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
12034                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
12035                 </fields>
12036                 <links>
12037                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12038                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
12039                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
12040                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
12041                 </links>
12042         </class>
12043
12044         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12045                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12046                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12047                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
12048                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12049                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12050                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
12051                 </fields>
12052                 <links>
12053                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12054                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12055                 </links>
12056         </class>
12057
12058         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12059                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12060                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12061                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12062                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12063                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12064                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12065                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12066                 </fields>
12067                 <links>
12068                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12069                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12070                 </links>
12071         </class>
12072
12073         <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">
12074                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12075                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12076                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12077                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12078                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12079                 </fields>
12080                 <links>
12081                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12082                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12083                 </links>
12084         </class>
12085
12086         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12087                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12088                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12089                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12090                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12091                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12092                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12093                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12094                 </fields>
12095                 <links>
12096                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12097                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12098                 </links>
12099         </class>
12100
12101         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12102                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12103                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12104                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12105                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12106                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12107                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12108                 </fields>
12109                 <links>
12110                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12111                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12112                 </links>
12113         </class>
12114
12115         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12116                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12117                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12118                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12119                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12120                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12121                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12122                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12123                 </fields>
12124                 <links>
12125                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12126                 </links>
12127         </class>
12128
12129         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12130                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12131                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12132                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12133                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12134                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12135                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12136                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12137                 </fields>
12138                 <links>
12139                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12140                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12141                 </links>
12142         </class>
12143
12144         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12145                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12146                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12147                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12148                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12149                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12150                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12151                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12152                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12153                 </fields>
12154                 <links>
12155                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12156                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12157                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12158                 </links>
12159         </class>
12160
12161         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12162                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12163                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12164                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12165                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12166                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12167                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12168                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12169                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12170                 </fields>
12171                 <links>
12172                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12173                 </links>
12174         </class>
12175
12176         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12177                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12178                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12179                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12180                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12181                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12182                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12183                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12184                 </fields>
12185                 <links>
12186                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12187                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12188                 </links>
12189         </class>
12190
12191         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12192                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12193                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12194                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12195                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12196                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12197                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12198                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12199                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12200                 </fields>
12201                 <links>
12202                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12203                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12204                 </links>
12205         </class>
12206
12207         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12208                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12209                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12210                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12211                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12212                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12213                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12214                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12215                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12216                 </fields>
12217                 <links>
12218                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12219                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12220                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12221                 </links>
12222         </class>
12223
12224         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12225                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12226                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12227                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12228                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12229                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12230                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12231                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12232                 </fields>
12233                 <links>
12234                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12235                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12236                 </links>
12237         </class>
12238
12239         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12240                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12241                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12242                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12243                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12244                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12245                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12246                 </fields>
12247                 <links>
12248                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12249                 </links>
12250         </class>
12251
12252         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12253                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12254                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12255                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12256                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12257                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12258                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12259                 </fields>
12260                 <links>
12261                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12262                 </links>
12263         </class>
12264
12265         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12266                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12267                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12268                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12269                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12270                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12271                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12272                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12273                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12274                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12275                 </fields>
12276                 <links>
12277                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12278                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12279                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12280                 </links>
12281         </class>
12282
12283         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12284                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12285                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12286                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12287                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12288                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12289                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12290                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12291                 </fields>
12292                 <links>
12293                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12294                 </links>
12295         </class>
12296
12297         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12298                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12299                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12300                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12301                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12302                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12303                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12304                 </fields>
12305                 <links>
12306                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12307                 </links>
12308         </class>
12309
12310         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12311                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12312                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12313                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12314                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12315                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12316                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12317                 </fields>
12318                 <links>
12319                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12320                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12321                 </links>
12322         </class>
12323
12324         <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">
12325                 <fields oils_persist:primary="id">
12326                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12327                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12328                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12329                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12330                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12331                 </fields>
12332                 <links>
12333                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12334                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12335                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12336                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12337                 </links>
12338         </class>
12339
12340         <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">
12341                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12342                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12343                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12344                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12345                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12346                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12347                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12348                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12349                 </fields>
12350                 <links/>
12351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12352                         <actions>
12353                                 <retrieve/>
12354                         </actions>
12355                 </permacrud>
12356         </class>
12357
12358         <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">
12359                 <fields oils_persist:primary="ptype_key">
12360                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12361                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12362                 </fields>
12363                 <links/>
12364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12365                         <actions>
12366                                 <retrieve/>
12367                         </actions>
12368                 </permacrud>
12369         </class>
12370
12371         <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">
12372                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12373                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12374                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12375                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12376                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12377                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12378                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12379                 </fields>
12380                 <links>
12381                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12382                 </links>
12383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12384                         <actions>
12385                                 <retrieve/>
12386                         </actions>
12387                 </permacrud>
12388         </class>
12389
12390         <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">
12391                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12392                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12393                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12394                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12395                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12396                 </fields>
12397                 <links>
12398                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12399                 </links>
12400                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12401                         <actions>
12402                                 <retrieve/>
12403                         </actions>
12404                 </permacrud>
12405         </class>
12406
12407     <class
12408         id="uvs"
12409         controller="open-ils.cstore open-ils.pcrud"
12410         oils_obj:fieldmapper="url_verify::session"
12411         oils_persist:tablename="url_verify.session"
12412         reporter:label="URL Verification Session"
12413     >
12414         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12415             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12416             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12417                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12418             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12419             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12420             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12421             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12422             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12423             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12424         </fields>
12425
12426         <links>
12427             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12428             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12429             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12430             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12431             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12432         </links>
12433
12434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12435             <actions>
12436                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12437             </actions>
12438         </permacrud>
12439
12440     </class>
12441
12442     <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">
12443         <oils_persist:source_definition><![CDATA[
12444             SELECT
12445                 cbrebi.id AS id,  -- so we can have a pkey in our view
12446                 uvs.id AS session,
12447                 uvs.owning_lib,
12448                 cbrebi.target_biblio_record_entry
12449             FROM url_verify.session uvs
12450             JOIN container.biblio_record_entry_bucket cbreb
12451                 ON (uvs.container = cbreb.id)
12452             JOIN container.biblio_record_entry_bucket_item cbrebi
12453                 ON (cbrebi.bucket = cbreb.id)
12454         ]]></oils_persist:source_definition>
12455         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12456             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12457             <field reporter:label="Session" name="session" reporter:datatype="link" />
12458             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12459             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12460         </fields>
12461         <links>
12462             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12463             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12464             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12465         </links>
12466         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12467             <actions>
12468                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12469             </actions>
12470         </permacrud>
12471     </class>
12472
12473     <class
12474         id="uvus"
12475         controller="open-ils.cstore open-ils.pcrud"
12476         oils_obj:fieldmapper="url_verify::url_selector"
12477         oils_persist:tablename="url_verify.url_selector"
12478         reporter:label="URL Verification URL Selector"
12479     >
12480         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12481             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12482             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12483                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12484             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12485         </fields>
12486
12487         <links>
12488             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12489             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12490         </links>
12491
12492         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12493             <actions>
12494                 <create permission="URL_VERIFY">
12495                     <context link="session" field="owning_lib"/>
12496                 </create>
12497                 <retrieve permission="URL_VERIFY">
12498                     <context link="session" field="owning_lib"/>
12499                 </retrieve>
12500                 <update permission="URL_VERIFY">
12501                     <context link="session" field="owning_lib"/>
12502                 </update>
12503                 <delete permission="URL_VERIFY">
12504                     <context link="session" field="owning_lib"/>
12505                 </delete>
12506             </actions>
12507         </permacrud>
12508
12509     </class>
12510
12511     <class
12512         id="uvu"
12513         controller="open-ils.cstore open-ils.pcrud"
12514         oils_obj:fieldmapper="url_verify::url"
12515         oils_persist:tablename="url_verify.url"
12516         reporter:label="URL Verification URL"
12517     >
12518         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12519             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12520                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12521                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12522                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12523                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12524             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12525             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12526             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12527             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12528             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12529             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12530             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12531             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12532             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12533             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12534             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12535             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12536             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12537         </fields>
12538
12539         <links>
12540             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12541             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12542             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12543             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12544             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12545         </links>
12546
12547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12548             <actions>
12549                 <create permission="URL_VERIFY">
12550                     <context link="session" field="owning_lib"/>
12551                 </create>
12552                 <retrieve permission="URL_VERIFY">
12553                     <context link="session" field="owning_lib"/>
12554                 </retrieve>
12555                 <update permission="URL_VERIFY">
12556                     <context link="session" field="owning_lib"/>
12557                 </update>
12558                 <delete permission="URL_VERIFY">
12559                     <context link="session" field="owning_lib"/>
12560                 </delete>
12561             </actions>
12562         </permacrud>
12563
12564     </class>
12565
12566     <class
12567         id="uvva"
12568         controller="open-ils.cstore open-ils.pcrud"
12569         oils_obj:fieldmapper="url_verify::verification_attempt"
12570         oils_persist:tablename="url_verify.verification_attempt"
12571         reporter:label="URL Verification Attempt"
12572     >
12573         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12574             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12575                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12576                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12577             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12578             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12579         </fields>
12580
12581         <links>
12582             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12583             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12584         </links>
12585
12586         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12587             <actions>
12588                 <create permission="URL_VERIFY">
12589                     <context link="session" field="owning_lib"/>
12590                 </create>
12591                 <retrieve permission="URL_VERIFY">
12592                     <context link="session" field="owning_lib"/>
12593                 </retrieve>
12594                 <update permission="URL_VERIFY">
12595                     <context link="session" field="owning_lib"/>
12596                 </update>
12597                 <delete permission="URL_VERIFY">
12598                     <context link="session" field="owning_lib"/>
12599                 </delete>
12600             </actions>
12601         </permacrud>
12602
12603     </class>
12604
12605     <class
12606         id="uvuv"
12607         controller="open-ils.cstore open-ils.pcrud"
12608         oils_obj:fieldmapper="url_verify::url_verification"
12609         oils_persist:tablename="url_verify.url_verification"
12610         reporter:label="URL Verification"
12611     >
12612         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12613             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12614                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12615                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12616             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12617             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12618             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12619             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12620                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12621         </fields>
12622
12623         <links>
12624             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12625             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12626             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12627         </links>
12628
12629         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12630             <actions>
12631                 <create permission="URL_VERIFY">
12632                     <context link="attempt" jump="session" field="owning_lib"/>
12633                 </create>
12634                 <retrieve permission="URL_VERIFY">
12635                     <context link="attempt" jump="session" field="owning_lib"/>
12636                 </retrieve>
12637                 <update permission="URL_VERIFY">
12638                     <context link="attempt" jump="session" field="owning_lib"/>
12639                 </update>
12640                 <delete permission="URL_VERIFY">
12641                     <context link="attempt" jump="session" field="owning_lib"/>
12642                 </delete>
12643             </actions>
12644         </permacrud>
12645
12646     </class>
12647
12648         <class
12649                 id="cfdi"
12650                 controller="open-ils.cstore open-ils.pcrud"
12651                 oils_obj:fieldmapper="config::filter_dialog_interface"
12652                 oils_persist:tablename="config.filter_dialog_interface"
12653                 reporter:label="FilterDialog Interface">
12654                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12655                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12656                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12657                 </fields>
12658                 <links>
12659                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12660                 </links>
12661                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12662                         <actions>
12663                                 <retrieve />
12664                         </actions>
12665                 </permacrud>
12666         </class>
12667
12668         <class
12669                 id="cfdfs"
12670                 controller="open-ils.cstore open-ils.pcrud"
12671                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12672                 oils_persist:tablename="config.filter_dialog_filter_set"
12673                 reporter:label="FilterDialog Filter Set">
12674                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12675                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12676                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12677                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12678                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12679                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12680                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12681                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12682                 </fields>
12683                 <links>
12684                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12685                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12686                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12687                 </links>
12688                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12689                         <actions>
12690                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12691                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12692                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12693                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12694                         </actions>
12695                 </permacrud>
12696
12697         </class>
12698
12699         <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">
12700                 <fields oils_persist:primary="code">
12701                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12702                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12703                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12704                 </fields>
12705                 <links/>
12706                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12707                         <actions>
12708                                 <retrieve/>
12709                         </actions>
12710                 </permacrud>
12711         </class>
12712
12713         <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">
12714                 <oils_persist:source_definition><![CDATA[
12715
12716             SELECT  b.id,
12717                     MAX(dcp.edit_date) AS last_delete_date
12718              FROM   biblio.record_entry b
12719                     JOIN asset.call_number cn ON (cn.record = b.id)
12720                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12721              WHERE  NOT b.deleted
12722              GROUP BY b.id
12723              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12724
12725                 ]]></oils_persist:source_definition>
12726                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12727                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12728                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12729                 </fields>
12730                 <links>
12731                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12732                 </links>
12733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12734                         <actions>
12735                                 <retrieve/>
12736                         </actions>
12737                 </permacrud>
12738         </class>
12739
12740         <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">
12741                 <fields oils_persist:primary="id">
12742                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12743                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12744                 </fields>
12745                 <links/>
12746                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12747                         <actions>
12748                                 <retrieve/>
12749                         </actions>
12750                 </permacrud>
12751         </class>
12752
12753         <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">
12754                 <fields oils_persist:primary="id">
12755                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12756                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12757                 </fields>
12758                 <links/>
12759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12760                         <actions>
12761                                 <retrieve/>
12762                         </actions>
12763                 </permacrud>
12764         </class>
12765
12766
12767         <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">
12768                 <oils_persist:source_definition><![CDATA[
12769                 SELECT
12770                     x.id,
12771                     COALESCE( y.copy_count, 0 ) AS copy_count,
12772                     x.hold_count AS hold_count,
12773                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12774                 FROM
12775                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12776                         FROM
12777                             action.hold_request ahr
12778                             JOIN reporter.hold_request_record rhrr USING (id)
12779                         WHERE
12780                             ahr.cancel_time IS NULL
12781                             AND ahr.fulfillment_time IS NULL
12782                         GROUP BY bib_record
12783                     )x
12784                     JOIN
12785                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12786                         FROM
12787                             action.hold_request ahr
12788                             JOIN reporter.hold_request_record rhrr USING (id)
12789                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12790                         WHERE
12791                             ahr.cancel_time IS NULL
12792                             AND ahr.fulfillment_time IS NULL
12793                             AND ahr.capture_time IS NULL
12794                             AND ahr.frozen IS FALSE
12795                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12796                             AND ahr.hold_type != 'M'
12797                            GROUP BY bib_record
12798                     )y
12799                     USING (id)
12800                 ]]></oils_persist:source_definition>
12801                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12802                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12803                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12804                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12805                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12806                 </fields>
12807                 <links>
12808                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12809                 </links>
12810                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12811                         <actions>
12812                                 <retrieve/>
12813                         </actions>
12814                 </permacrud>
12815         </class>
12816
12817         <class id="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">
12818                 <oils_persist:source_definition><![CDATA[
12819             SELECT *,
12820                 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,
12821                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12822             FROM
12823                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12824                     FROM
12825                         action.hold_request ahr
12826                         JOIN reporter.hold_request_record rhrr USING (id)
12827                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12828                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12829                     WHERE
12830                         ahr.cancel_time IS NULL
12831                         AND ahr.fulfillment_time IS NULL
12832                     GROUP BY bib_record, pickup_lib
12833                 )x
12834                 JOIN
12835                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12836                     FROM
12837                         action.hold_request ahr
12838                         JOIN reporter.hold_request_record rhrr USING (id)
12839                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12840                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12841                     WHERE
12842                         ahr.cancel_time IS NULL
12843                         AND ahr.fulfillment_time IS NULL
12844                         AND ahr.capture_time IS NULL
12845                         AND ahr.frozen IS FALSE
12846                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12847                         AND ahr.hold_type != 'M'
12848                     GROUP BY bib_record, pickup_lib
12849                 )y
12850                 USING(id,pickup_lib)
12851                 JOIN
12852                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12853                     FROM
12854                         action.hold_request ahr
12855                         JOIN reporter.hold_request_record rhrr USING (id)
12856                     WHERE
12857                         ahr.cancel_time IS NULL
12858                         AND ahr.fulfillment_time IS NULL
12859                     GROUP BY bib_record
12860                 )z
12861                 USING (id)
12862                 JOIN
12863                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12864                     FROM
12865                         action.hold_request ahr
12866                         JOIN reporter.hold_request_record rhrr USING (id)
12867                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12868                     WHERE
12869                         ahr.cancel_time IS NULL
12870                         AND ahr.fulfillment_time IS NULL
12871                         AND ahr.capture_time IS NULL
12872                         AND ahr.frozen IS FALSE
12873                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12874                         AND ahr.hold_type != 'M'
12875                         GROUP BY bib_record
12876                 )u
12877                 USING (id)
12878                 ]]></oils_persist:source_definition>
12879                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12880                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12881                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12882                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12883                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12884                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12885                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12886                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12887                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12888                 </fields>
12889                 <links>
12890                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12891                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12892                 </links>
12893                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12894                         <actions>
12895                                 <retrieve/>
12896                         </actions>
12897                 </permacrud>
12898         </class>
12899
12900         <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">
12901                 <oils_persist:source_definition><![CDATA[
12902             SELECT *,
12903                 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,
12904                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12905             FROM
12906                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12907                     FROM
12908                         action.hold_request ahr
12909                         JOIN actor.usr au ON (ahr.usr = au.id)
12910                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12911                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12912                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12913                     WHERE
12914                         ahr.cancel_time IS NULL
12915                         AND ahr.fulfillment_time IS NULL
12916                     GROUP BY bib_record, home_ou
12917                 )x
12918                 JOIN
12919                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12920                     FROM
12921                         action.hold_request ahr
12922                         JOIN actor.usr au ON (ahr.usr = au.id)
12923                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12924                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12925                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
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, home_ou
12934                 )y
12935                 USING (id,home_ou)
12936                 JOIN
12937                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12938                     FROM
12939                         action.hold_request ahr
12940                         JOIN reporter.hold_request_record rhrr USING (id)
12941                     WHERE
12942                         ahr.cancel_time IS NULL
12943                         AND ahr.fulfillment_time IS NULL
12944                     GROUP BY bib_record
12945                 )z
12946                 USING (id)
12947                 JOIN
12948                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12949                     FROM
12950                         action.hold_request ahr
12951                         JOIN reporter.hold_request_record rhrr USING (id)
12952                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12953                     WHERE
12954                         ahr.cancel_time IS NULL
12955                         AND ahr.fulfillment_time IS NULL
12956                         AND ahr.capture_time IS NULL
12957                         AND ahr.frozen IS FALSE
12958                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12959                         AND ahr.hold_type != 'M'
12960                     GROUP BY bib_record
12961                 )u
12962                 USING (id)
12963         ]]></oils_persist:source_definition>
12964         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12965                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12966                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12967                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12968                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12969                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12970                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12971                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12972                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12973         </fields>
12974         <links>
12975                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12976                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12977         </links>
12978         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12979                 <actions>
12980                         <retrieve/>
12981                 </actions>
12982         </permacrud>
12983 </class>
12984
12985         <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) ">
12986                 <oils_persist:source_definition><![CDATA[
12987                 WITH counts_at_ou AS (
12988                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12989                 FROM
12990                     (SELECT rhrr.bib_record AS id,
12991                             aou.id AS pickup_lib_or_desc,
12992                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12993                        FROM actor.org_unit aou
12994                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12995                             action.hold_request ahr
12996                             JOIN reporter.hold_request_record rhrr USING (id)
12997                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12998                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12999                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
13000                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13001                             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
13002                       GROUP BY 1, 2
13003                 ) a
13004                 JOIN
13005                     (SELECT rhrr.bib_record AS id,
13006                             aou.id AS pickup_lib_or_desc,
13007                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
13008                        FROM actor.org_unit aou
13009                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13010                             action.hold_request ahr
13011                             JOIN reporter.hold_request_record rhrr USING (id)
13012                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13013                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13014                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
13015                             -- Comment out the next line to count copies included from other bibs by metarecord holds
13016                             AND ahr.hold_type != 'M'
13017                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13018                             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
13019                       GROUP BY 1, 2
13020                 ) b
13021                 USING (id,pickup_lib_or_desc)
13022             )
13023             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13024                    y.holds_everywhere, z.copy_count_everywhere,
13025                 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,
13026                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13027             FROM counts_at_ou x
13028                 JOIN
13029                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13030                     FROM
13031                         action.hold_request ahr
13032                         JOIN reporter.hold_request_record rhrr USING (id)
13033                     WHERE
13034                         ahr.cancel_time IS NULL
13035                         AND ahr.fulfillment_time IS NULL
13036                     GROUP BY bib_record
13037                 )y
13038                 USING (id)
13039                 JOIN
13040                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13041                     FROM
13042                         action.hold_request ahr
13043                         JOIN reporter.hold_request_record rhrr USING (id)
13044                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13045                     WHERE
13046                         ahr.cancel_time IS NULL
13047                         AND ahr.fulfillment_time IS NULL
13048                         AND ahr.capture_time IS NULL
13049                         AND ahr.frozen IS FALSE
13050                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13051                         AND ahr.hold_type != 'M'
13052                         GROUP BY bib_record
13053                 )z
13054                 USING (id)
13055                 ]]></oils_persist:source_definition>
13056                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13057                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13058                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13059                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13060                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13061                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13062                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13063                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13064                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13065                 </fields>
13066                 <links>
13067                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13068                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13069                 </links>
13070                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13071                         <actions>
13072                                 <retrieve/>
13073                         </actions>
13074                 </permacrud>
13075         </class>
13076
13077         <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">
13078                 <oils_persist:source_definition><![CDATA[
13079             SELECT
13080                 ac.id,
13081                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13082                 MAX(actac.xact_start) AS last_circ
13083             FROM asset.copy ac
13084                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13085             GROUP BY ac.id
13086
13087             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13088             --SELECT
13089             --    ac.id,
13090             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13091             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13092             --FROM asset.copy ac
13093             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13094             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13095             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13096                 ]]></oils_persist:source_definition>
13097                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13098                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13099                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13100                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13101                 </fields>
13102                 <links>
13103                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13104                 </links>
13105                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13106                         <actions>
13107                                 <retrieve/>
13108                         </actions>
13109                 </permacrud>
13110         </class>
13111
13112         <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">
13113                 <fields oils_persist:primary="id">
13114                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13115                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13116                 </fields>
13117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13118                         <actions>
13119                                 <retrieve/>
13120                         </actions>
13121                 </permacrud>
13122         </class>
13123
13124         <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">
13125                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13126                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13127                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13128                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13129                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13130                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13131                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13132                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13133                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13134                 </fields>
13135                 <links>
13136                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13137                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13138                 </links>
13139                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13140                         <actions>
13141                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13142                                 <retrieve/>
13143                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13144                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13145                         </actions>
13146                 </permacrud>
13147         </class>
13148
13149         <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">
13150                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13151                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13152                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13153                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13154                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13155                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13156                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13157                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13158                 </fields>
13159                 <links>
13160                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13161                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13162                 </links>
13163                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13164                         <actions>
13165                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13166                                 <retrieve/>
13167                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13168                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13169                         </actions>
13170                 </permacrud>
13171         </class>
13172
13173
13174         <!-- ********************************************************************************************************************* -->
13175         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13176         <!-- ********************************************************************************************************************* -->
13177         <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">
13178                 <fields oils_persist:primary="id">
13179                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13180                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13181                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13182                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13183                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13184                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13185                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13186                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13187                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13188                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13189                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13190                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13191                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13192                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13193                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13194                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13195                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13196                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13197                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13198                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13199                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13200                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13201                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13202                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13203                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13204                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13205                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13206                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13207                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13208                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13209                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13210                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13211                 </fields>
13212                 <links>
13213                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13214                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13215                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13216                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13217                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13218                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13219                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13220                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13221                 </links>
13222         </class>
13223
13224         <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">
13225                 <fields oils_persist:primary="id">
13226                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13227                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13228                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13229                 </fields>
13230                 <links>
13231                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13232                 </links>
13233         </class>
13234
13235         <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">
13236                 <fields oils_persist:primary="id">
13237                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13238                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13239                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13240                 </fields>
13241                 <links>
13242                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13243                 </links>
13244         </class>
13245
13246         <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">
13247                 <fields oils_persist:primary="id">
13248                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13249
13250                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13251                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13252                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13253
13254                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13255                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13256                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13257
13258                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13259                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13260
13261                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13262                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13263                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13264
13265                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13266                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13267
13268                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13269                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13270                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13271
13272                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13273                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13274                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13275
13276                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13277                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13278                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13279                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13280
13281                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13282                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13283
13284                 </fields>
13285                 <links>
13286                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13287                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13288                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13289                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13290                 </links>
13291         </class>
13292
13293         <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">
13294                 <oils_persist:source_definition><![CDATA[
13295
13296             SELECT
13297                 po.ordering_agency AS ordering_agency,
13298                 po.id AS purchase_order,
13299                 li.id AS lineitem,
13300                 lid.id AS lineitem_detail,
13301                 cpa.id AS claim_policy_action
13302             FROM
13303                 acq.lineitem_detail lid
13304                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13305                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13306                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13307                 JOIN acq.claim_policy_action cpa ON (
13308                     cpa.claim_policy = cp.id
13309
13310                     -- we only care about claim policy actions whose claim
13311                     -- interval we'd reached or exceeded
13312                     AND (NOW() - cpa.action_interval) > po.order_date
13313
13314                     -- filter out all claim policy actions where claim events
13315                     -- have occurred on or after the action's action_interval
13316                     AND NOT EXISTS (
13317                         SELECT 1
13318                         FROM
13319                             acq.claim_event evt
13320                             JOIN acq.claim claim ON (
13321                                 claim.id = evt.claim
13322                                 AND claim.lineitem_detail = lid.id
13323                             )
13324                         WHERE
13325                             evt.event_date >= (po.order_date + cpa.action_interval)
13326                     )
13327                 )
13328             WHERE
13329                 lid.cancel_reason IS NULL
13330                 AND li.cancel_reason IS NULL -- belt/suspenders
13331                 AND po.cancel_reason IS NULL -- belt/suspenders
13332                 AND lid.recv_time IS NULL
13333                 AND po.state = 'on-order'
13334             ORDER BY 1, 2, 3, 4, 5
13335
13336                 ]]></oils_persist:source_definition>
13337                 <fields>
13338                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13339                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13340                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13341                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13342                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13343                 </fields>
13344                 <links>
13345                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13346                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13347                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13348                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13349                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13350                 </links>
13351         </class>
13352         <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">
13353                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13354                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13355                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13356                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13357                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13358                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13359                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13360                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13361                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13362                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13363                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13364                 </fields>
13365                 <links>
13366                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13367                 </links>
13368     </class>
13369         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13370                 <oils_persist:source_definition><![CDATA[
13371             SELECT * FROM acq.lineitem_summary 
13372                                 WHERE item_count > (invoice_count + cancel_count)
13373         ]]></oils_persist:source_definition>
13374                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13375                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13376                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13377                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13378                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13379                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13380                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13381                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13382                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13383                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13384                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13385                 </fields>
13386                 <links>
13387                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13388                 </links>
13389     </class>
13390         <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">
13391                 <oils_persist:source_definition><![CDATA[
13392
13393                         SELECT  t.*
13394                           FROM  action.transit_copy t
13395                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13396                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13397                           WHERE s.parent_ou <> d.parent_ou
13398
13399                 ]]></oils_persist:source_definition>
13400                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13401                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13402                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13403                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13404                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13405                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13406                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13407                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13408                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13409                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13410                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13411                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13412                 </fields>
13413                 <links>
13414                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13415                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13416                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13417                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13418                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13419                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13420                 </links>
13421         </class>
13422
13423     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13424                 <oils_persist:source_definition><![CDATA[
13425
13426         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13427                 SELECT
13428                         cp.id as copy,
13429                         COUNT(circ.id),
13430                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13431                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13432                 FROM
13433                         asset.copy cp
13434                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13435                 GROUP BY 1, 3, 4
13436                 UNION ALL
13437                 SELECT
13438                         cp.id as copy,
13439                         COUNT(circ.id),
13440                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13441                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13442                 FROM
13443                         asset.copy cp
13444                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13445                 GROUP BY 1, 3, 4
13446                 UNION ALL
13447                 SELECT
13448                         id as copy,
13449                         circ_count,
13450                         -1 AS year,
13451                         false as is_renewal
13452                 FROM
13453                         extend_reporter.legacy_circ_count
13454         )x GROUP BY 1, 3, 4
13455
13456                 ]]></oils_persist:source_definition>
13457         <fields>
13458             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13459             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13460             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13461             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13462         </fields>
13463                 <links>
13464                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13465                 </links>
13466                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13467                         <actions>
13468                                 <retrieve/>
13469                         </actions>
13470                 </permacrud>
13471     </class>
13472
13473         <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">
13474                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13475                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13476                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13477                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13478                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13479                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13480                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13481                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13482                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13483                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13484                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13485                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13486                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13487                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13488                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13489                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13490                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13491                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13492                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13493                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13494                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13495                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13496                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13497                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13498                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13499                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13500                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13501                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13502                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13503                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13504                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13505                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13506                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13507                 </fields>
13508                 <links>
13509                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13510                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13511                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13512                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13513                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13514                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13515                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13516                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13517                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13518                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13519                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13520                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13521                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13522                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13523                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13524                 </links>
13525         </class>
13526
13527     <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">
13528         <fields oils_persist:primary="id">
13529             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13530             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13531             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13532             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13533             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13534             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13535             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13536             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13537             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13538             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13539             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13540             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13541             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13542             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13543             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13544             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13545             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13546             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13547             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13548             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13549             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13550             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13551             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13552             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13553             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13554             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13555             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13556             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13557             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13558             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13559             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13560             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13561             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13562             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13563         </fields>
13564         <links>
13565             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13566             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13567             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13568             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13569             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13570             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13571             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13572             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13573         </links>
13574     </class>
13575
13576     <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">
13577         <fields oils_persist:primary="id">
13578             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13579             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13580             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13581             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13582         </fields>
13583         <links>
13584             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13585             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13586         </links>
13587     </class>
13588
13589     <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">
13590         <fields oils_persist:primary="owning_lib">
13591             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13592             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13593             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13594         </fields>
13595         <links>
13596             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13597         </links>
13598     </class>
13599
13600     <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">
13601         <fields oils_persist:primary="id">
13602             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13603             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13604             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13605             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13606             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13607         </fields>
13608         <links>
13609             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13610             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13611             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13612         </links>
13613     </class>
13614
13615     <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">
13616         <fields oils_persist:primary="circ_lib">
13617             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13618             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13619             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13620             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13621         </fields>
13622         <links>
13623             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13624             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13625         </links>
13626     </class>
13627
13628     <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">
13629         <fields oils_persist:primary="id">
13630             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13631             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13632             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13633             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13634             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13635         </fields>
13636         <links>
13637             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13638             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13639             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13640         </links>
13641     </class>
13642
13643     <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">
13644         <fields oils_persist:primary="home_ou">
13645             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13646             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13647             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13648             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13649         </fields>
13650         <links>
13651             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13652             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13653         </links>
13654     </class>
13655         <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">
13656                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13657                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13658                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13659                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13660                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13661                 </fields>
13662                 <links>
13663                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13664                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13665                 </links>
13666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13667                         <actions>
13668                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13669                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13670                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13671                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13672                         </actions>
13673                 </permacrud>
13674         </class>
13675         <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">
13676                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13677                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13678                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13679                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13680                 </fields>
13681                 <links>
13682                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13683                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13684                         </links>
13685                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13686                 <actions>
13687                                 <create permission="ADMIN_ACQ_FUND_TAG">
13688                                         <context link="tag" field="owner"/>
13689                                 </create>
13690                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13691                                         <context link="tag" field="owner"/>
13692                                 </retrieve>
13693                                 <update permission="ADMIN_ACQ_FUND_TAG">
13694                                         <context link="tag" field="owner"/>
13695                                 </update>
13696                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13697                                         <context link="tag" field="owner"/>
13698                                 </delete>
13699                         </actions>
13700                 </permacrud>
13701         </class>
13702         <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">
13703                 <oils_persist:source_definition><![CDATA[
13704                 SELECT
13705                         poi.purchase_order AS purchase_order,
13706                         ii.invoice AS invoice,
13707                         NULL AS lineitem,
13708                         poi.id AS po_item,
13709                         NULL AS picklist
13710                 FROM
13711                         acq.po_item poi
13712                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13713                 UNION SELECT
13714                         jub.purchase_order AS purchase_order,
13715                         ie.invoice AS invoice,
13716                         jub.id AS lineitem,
13717                         NULL AS po_item,
13718                         jub.picklist AS picklist
13719                 FROM
13720                         acq.lineitem jub
13721                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13722                 UNION SELECT
13723                         ii.purchase_order AS purchase_order,
13724                         ii.invoice AS invoice,
13725                         NULL AS lineitem,
13726                         NULL AS po_item,
13727                         NULL AS picklist
13728                 FROM
13729                         acq.invoice_item ii
13730                 WHERE ii.po_item IS NULL
13731                 UNION SELECT
13732                         ie.purchase_order AS purchase_order,
13733                         ie.invoice AS invoice,
13734                         NULL AS lineitem,
13735                         NULL AS po_item,
13736                         NULL AS picklist
13737                 FROM
13738                         acq.invoice_entry ie
13739                 WHERE ie.lineitem IS NULL
13740                 UNION SELECT
13741                         NULL AS purchase_order,
13742                         NULL AS invoice,
13743                         jub.id AS lineitem,
13744                         NULL AS po_item,
13745                         jub.picklist AS picklist
13746                 FROM
13747                         acq.lineitem jub
13748                 WHERE jub.purchase_order IS NULL
13749                 ]]></oils_persist:source_definition>
13750                 <fields>
13751                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13752                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13753                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13754                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13755                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13756                 </fields>
13757                 <links>
13758                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13759                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13760                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13761                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13762                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13763                 </links>
13764         </class>
13765         <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">
13766                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13767                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13768                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13769                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13770                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13771                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13772                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13773                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13774                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13775                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13776                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13777                 </fields>
13778                 <links>
13779                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13780                 </links>
13781                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13782                         <actions>
13783                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13784                                 <retrieve/>
13785                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13786                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13787                         </actions>
13788                 </permacrud>
13789         </class>
13790
13791         <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">
13792                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13793                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13794                         <field name="date_applied" reporter:datatype="timestamp"/>
13795                         <field name="org" reporter:datatype="org_unit"/>
13796                         <field name="original_value" reporter:datatype="text"/>
13797                         <field name="new_value" reporter:datatype="text"/>
13798                         <field name="field_name" reporter:datatype="link"/>
13799                 </fields>
13800                 <links>
13801                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13802                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13803                 </links>
13804         </class>
13805         <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">
13806                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13807                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13808                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13809                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13810                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13811                 </fields>
13812                 <links>
13813                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13814                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13815                 </links>
13816         </class>
13817         <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">
13818                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13819                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13820                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13821                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13822                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13823                 </fields>
13824                 <links>
13825                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13826                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13827                 </links>
13828         </class>
13829         <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">
13830                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13831                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13832                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13833                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13834                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13835                 </fields>
13836                 <links>
13837                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13838                 </links>
13839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13840                         <actions>
13841                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13842                                 <retrieve/>
13843                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13844                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13845                         </actions>
13846                 </permacrud>
13847         </class>
13848         <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">
13849                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13850                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13851                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13852                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13853                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13854                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13855                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13856                 </fields>
13857                 <links>
13858                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13859                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13860                 </links>
13861                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13862                         <actions>
13863                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13864                                 <retrieve/>
13865                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13866                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13867                         </actions>
13868                 </permacrud>
13869         </class>
13870         <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">
13871                 <fields oils_persist:primary="code">
13872                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13873                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13874                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13875                 </fields>
13876                 <links>
13877                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13878                 </links>
13879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13880                         <actions>
13881                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13882                                 <retrieve/>
13883                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13884                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13885                         </actions>
13886                 </permacrud>
13887         </class>
13888         <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">
13889                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13890                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13891                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13892                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13893                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13894                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13895                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13896                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13897                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13898                 </fields>
13899                 <links>
13900                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13901                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13902                 </links>
13903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13904                         <actions>
13905                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13906                                 <retrieve/>
13907                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13908                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13909                         </actions>
13910                 </permacrud>
13911         </class>
13912         <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">
13913                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13914                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13915                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13916                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13917                 </fields>
13918                 <links>
13919                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13920                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13921                 </links>
13922                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13923                         <actions>
13924                                 <create permission="UPDATE_COPY">
13925                     <context link="copy" field="circ_lib"/>
13926                 </create>
13927                                 <retrieve/>
13928                                 <update permission="UPDATE_COPY">
13929                     <context link="copy" field="circ_lib"/>
13930                 </update>
13931                                 <delete permission="UPDATE_COPY">
13932                     <context link="copy" field="circ_lib"/>
13933                 </delete>
13934                         </actions>
13935                 </permacrud>
13936         </class>
13937         <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">
13938         <oils_persist:source_definition><![CDATA[
13939         SELECT ahcm.target_copy AS id,count(*) AS count
13940          FROM
13941          action.hold_request ahr,
13942          action.hold_copy_map ahcm
13943          WHERE
13944          ahr.cancel_time IS NULL AND
13945          ahr.fulfillment_time IS NULL AND
13946          ahr.capture_time IS NULL AND
13947          ahr.id = ahcm.hold
13948          GROUP BY ahcm.target_copy
13949         ]]></oils_persist:source_definition>
13950         <fields oils_persist:primary="id">
13951             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13952             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13953         </fields>
13954         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13955             <actions>
13956                <retrieve/>
13957             </actions>
13958         </permacrud>
13959         </class>
13960
13961         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13962                 oils_obj:fieldmapper="config::workstation_setting_type" 
13963                 oils_persist:tablename="config.workstation_setting_type" 
13964                 reporter:label="Workstation Setting Type">
13965                 <fields oils_persist:primary="name">
13966                         <field name="name" reporter:datatype="text"/>
13967                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13968                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13969                         <field name="datatype" reporter:datatype="text"/>
13970                         <field name="fm_class" reporter:datatype="text"/>
13971                         <field name="grp" reporter:datatype="link"/>
13972                 </fields>
13973                 <links>
13974                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13975                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13976                 </links>
13977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13978                         <actions>
13979                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13980                                 <retrieve/>
13981                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13982                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13983                         </actions>
13984                 </permacrud>
13985         </class>
13986
13987         <!-- no pcrud access is granted for now, because it's assumed these
13988                          setting values will be applied and retrived via the API. -->
13989         <class id="awss" 
13990                 controller="open-ils.cstore"
13991                 oils_obj:fieldmapper="actor::workstation_setting" 
13992                 oils_persist:tablename="actor.workstation_setting" 
13993                 reporter:label="Workstation Setting">
13994                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13995                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13996                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13997                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13998                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13999                 </fields>
14000                 <links>
14001                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
14002                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
14003                 </links>
14004         </class>
14005
14006         <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">
14007         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
14008                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
14009                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
14010                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
14011         </fields>
14012         </class>
14013
14014         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
14015                 oils_obj:fieldmapper="config::print_template" 
14016                 oils_persist:tablename="config.print_template" 
14017                 reporter:label="Print Templates">
14018                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
14019                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
14020                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
14021                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14022                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
14023                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
14024                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
14025                         <field name="content_type" reporter:datatype="text"/>
14026                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
14027                 </fields>
14028                 <links>
14029                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14030                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14031                 </links>
14032                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14033                         <actions>
14034                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14035                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14036                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14037                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14038                         </actions>
14039                 </permacrud>
14040         </class>
14041
14042         <class id="cct" 
14043                 controller="open-ils.cstore open-ils.pcrud"
14044                 oils_obj:fieldmapper="config::carousel_type" 
14045                 oils_persist:tablename="config.carousel_type" 
14046                 reporter:label="Carousel Types">
14047                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14048                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
14049                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14050                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14051                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14052                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14053                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14054                 </fields>
14055                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14056                         <actions>
14057                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14058                                 <retrieve/>
14059                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14060                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14061                         </actions>
14062                 </permacrud>
14063         </class>
14064
14065         <class id="cc" 
14066                 controller="open-ils.cstore open-ils.pcrud"
14067                 oils_obj:fieldmapper="container::carousel" 
14068                 oils_persist:tablename="container.carousel" 
14069                 reporter:label="Carousels">
14070                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14071                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14072                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14073                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14074                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14075                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14076                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14077                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14078                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14079                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14080                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14081                         <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 -->
14082                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14083                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14084                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14085                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14086                 </fields>
14087                 <links>
14088                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14089                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14090                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14091                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14092                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14093                 </links>
14094                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14095                         <actions>
14096                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14097                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14098                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14099                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14100                         </actions>
14101                 </permacrud>
14102         </class>
14103
14104         <class id="ccou" 
14105                 controller="open-ils.cstore open-ils.pcrud"
14106                 oils_obj:fieldmapper="container::carousel_org_unit" 
14107                 oils_persist:tablename="container.carousel_org_unit" 
14108                 reporter:label="Carousels Visible at Library">
14109                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14110                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14111                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14112                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14113                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14114                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14115                 </fields>
14116                 <links>
14117                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14118                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14119                 </links>
14120                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14121                         <actions>
14122                                 <create permission="ADMIN_CAROUSEL">
14123                                     <context link="carousel" field="owner" />
14124                                 </create>
14125                                 <retrieve permission="ADMIN_CAROUSEL">
14126                                     <context link="carousel" field="owner" />
14127                                 </retrieve>
14128                                 <update permission="ADMIN_CAROUSEL">
14129                                     <context link="carousel" field="owner" />
14130                                 </update>
14131                                 <delete permission="ADMIN_CAROUSEL">
14132                                     <context link="carousel" field="owner" />
14133                                 </delete>
14134                         </actions>
14135                 </permacrud>
14136         </class>
14137
14138         <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">
14139                 <fields oils_persist:primary="name">
14140                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14141                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14142                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14143                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14144                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14145                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14146                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14147                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14148                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14149                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14150                 </fields>
14151                 <links>
14152                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14153                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14154                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14155                 </links>
14156                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14157                         <actions>
14158                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14159                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14160                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14161                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14162                         </actions>
14163                 </permacrud>
14164         </class>
14165         <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">
14166                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14167                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14168                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14169                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14170                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14171                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14172                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14173                 </fields>
14174                 <links>
14175                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14176                 </links>
14177                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14178                         <actions>
14179                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14180                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14181                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14182                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14183                         </actions>
14184                 </permacrud>
14185         </class>
14186
14187     <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">
14188         <fields oils_persist:primary="code">
14189             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14190             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14191         </fields>
14192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14193                         <actions>
14194                                 <retrieve/>
14195                         </actions>
14196                 </permacrud>
14197         </class>
14198
14199     <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">
14200         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14201             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14202             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14203             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14204             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14205             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14206             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14207             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14208             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14209                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14210         </fields>
14211                 <links>
14212                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14213                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14214                 </links>
14215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14216             <actions>
14217                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14218                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14219                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14220                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14221             </actions>
14222         </permacrud>
14223     </class>
14224
14225         <!-- Simple Reporter classes are currently used only by the SR UI -->
14226     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14227         <oils_persist:source_definition><![CDATA[
14228             SELECT
14229               -- Circ id; just for counting
14230               combcirc.id AS circ_id,
14231
14232               -- User info, currently limiting to what's available from action.all_circulation
14233               combcirc.usr_post_code AS usr_post_code,
14234               combcirc.usr_birth_year AS usr_bith_year,
14235               combcirc.usr_profile AS usr_profile_id,
14236               pgtu.name AS usr_profile,
14237               combcirc.usr_home_ou AS usr_home_ou_id,
14238               aouuh.shortname AS usr_home_ou_shortname,
14239               aouuh.name AS usr_home_ou_name,
14240               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14241               aouus.shortname AS usr_sys_shortname,
14242               aouus.name AS usr_sys_name,
14243
14244               -- Circ info
14245               -- Checkout
14246               combcirc.xact_start AS xact_start,
14247               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14248               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14249               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14250               combcirc.circ_lib AS circ_lib_id,
14251               aouco.shortname AS circ_lib_shortname,
14252               aouco.name AS circ_lib_name,
14253               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14254               aoucos.shortname AS circ_sys_shortname,
14255               aoucos.name AS circ_sys_name,
14256               auco.usrname AS circ_staff,
14257               awso.name AS checkout_workstation,
14258
14259               combcirc.due_date AS due_date,
14260               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14261               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14262               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14263
14264               -- Checkin
14265               combcirc.xact_finish AS xact_finish,
14266               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14267               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14268               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14269               aouci.shortname AS checkin_lib_shortname,
14270               aouci.name AS checkin_lib_name,
14271               auci.usrname AS checkin_staff,
14272               awsi.name AS checkin_workstation,
14273               aoucis.shortname AS checkin_sys_shortname,
14274               aoucis.name AS checkin_sys_name,
14275
14276               combcirc.checkin_time AS checkin_time,
14277
14278               -- Misc circ info
14279               combcirc.renewal_remaining AS renewal_remaining,
14280               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14281               combcirc.grace_period AS grace_period,
14282
14283               combcirc.stop_fines AS stop_fines,
14284               combcirc.stop_fines_time AS stop_fines_time,
14285
14286               combcirc.duration AS duration,
14287               combcirc.fine_interval AS fine_interval,
14288               combcirc.recurring_fine AS recurring_fine,
14289               combcirc.max_fine AS max_fine,
14290               combcirc.duration_rule AS duration_rule,
14291               combcirc.recurring_fine_rule AS recurring_fine_rule,
14292               combcirc.max_fine_rule AS max_fine_rule,
14293               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14294               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,
14295               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14296
14297               -- Copy info
14298               acp.barcode AS copy_barcode,
14299               acp.circ_modifier AS copy_circ_modifier_code,
14300               ccm.name AS copy_circ_modifier_name,
14301               acp.circ_lib AS copy_circ_lib_id,
14302               acp.location AS location_id,
14303               acpl.name AS location_name,
14304               aoucp.shortname AS copy_circ_lib_shortname,
14305               aoucp.name AS copy_circ_lib_name,
14306               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14307               aoucps.shortname AS copy_sys_shortname,
14308               aoucps.name AS copy_sys_name,
14309               combcirc.copy_owning_lib AS copy_owning_lib_id,
14310               aoucpo.shortname AS copy_owning_lib_shortname,
14311               aoucpo.name AS copy_owning_lib_name,
14312               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14313               acnp.label AS copy_call_number_prefix,
14314               acn.label AS copy_call_number_label,
14315               acns.label AS copy_call_number_suffix,
14316               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14317               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14318               acn.label_sortkey AS copy_call_number_label_sortkey,
14319               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14320               COALESCE(rmsr.title, acp.dummy_title) AS title,
14321               COALESCE(rmsr.author, acp.dummy_author) AS author,
14322               rmsr.publisher AS publisher,
14323               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14324               array_to_string(rmsr.isbn, ', ') AS isbn,
14325               array_to_string(rmsr.issn, ', ') AS issn,
14326               part.label AS part_label,
14327               part.label_sortkey AS part_label_sortkey,
14328               acn.record AS bib_id,
14329               rmsr.tcn_value AS tcn_value
14330
14331             FROM
14332               action.all_circulation combcirc
14333
14334               -- User
14335               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14336               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14337               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14338
14339               -- Circ
14340               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14341               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14342               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14343               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14344               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14345               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14346               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14347               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14348
14349               -- Copy / call / title
14350               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14351                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14352               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14353               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14354               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14355               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14356               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14357               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14358               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14359               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14360               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14361               LEFT JOIN (
14362                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14363                 FROM biblio.monograph_part bmp
14364                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14365                 WHERE NOT bmp.deleted
14366               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14367         ]]></oils_persist:source_definition>
14368         <field_groups>
14369             <group name="common" reporter:label="Common Fields"/>
14370             <group name="item" reporter:label="Item Fields"/>
14371             <group name="user" reporter:label="Patron Fields"/>
14372             <group name="title" reporter:label="Call Number and Title Fields"/>
14373             <group name="org" reporter:label="Libraries"/>
14374         </field_groups>
14375         <fields oils_persist:primary="circ_id">
14376             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14377             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14378             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14379             <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"/>
14380             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14381             <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"/>
14382             <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"/>
14383             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14384             <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"/>
14385             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14386             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14387             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14388             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14389             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14390             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14391             <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"/>
14392             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14393             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14394             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14395             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14396             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14397             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14398             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14399             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14400             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14401             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14402             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14403             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14404             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14405             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14406             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14407             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14408             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14409             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14410             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14411             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14412             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14413             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14414             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14415             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14416             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14417             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14418             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14419             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14420             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14421             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14422             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14423             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14424             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14425             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14426             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14427             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14428             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14429             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14430             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14431             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14432             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14433             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14434             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14435             <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"/>
14436             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14437             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14438             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14439             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14440             <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"/>
14441             <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"/>
14442             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14443             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14444             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14445             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14446             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14447             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14448             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14449             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14450             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14451             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14452             <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"/>
14453             <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"/>
14454             <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"/>
14455             <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"/>
14456             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14457             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14458             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14459             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14460             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14461             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14462             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14463             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14464             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14465             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14466         </fields>
14467         <links>
14468             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14469             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14470             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14471         </links>
14472     </class>
14473
14474     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14475         <oils_persist:source_definition><![CDATA[
14476             SELECT
14477               au.home_ou AS home_ou_filter,
14478               au.id AS user_id,
14479               cardp.barcode AS barcode_primary,
14480               au.usrname AS usrname,
14481               au.email AS email,
14482               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14483               au.prefix AS prefix,
14484               au.first_given_name AS first_given_name,
14485               au.second_given_name AS second_given_name,
14486               au.family_name AS family_name,
14487               au.suffix AS suffix,
14488               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14489               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14490               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14491               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14492               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14493               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14494               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14495               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14496               au.profile AS profile_id,
14497               pgt.name AS profile,
14498               au.alias AS alias,
14499               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14500               au.day_phone AS day_phone,
14501               au.evening_phone AS evening_phone,
14502               au.other_phone AS other_phone,
14503               au.dob AS dob,
14504               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14505               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14506               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14507               au.active AS active,
14508               au.barred AS barred,
14509               au.deleted AS deleted,
14510               au.juvenile AS juvenile,
14511               au.claims_returned_count AS claims_returned_count,
14512               au.credit_forward_balance AS credit_forward_balance,
14513               au.create_date AS create_date,
14514               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14515               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14516               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14517               au.expire_date AS expire_date,
14518               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14519               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14520               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14521               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14522               au.last_update_time AS last_update_time,
14523               au.home_ou AS home_ou_id,
14524               aouh.shortname AS home_ou_shortname,
14525               aouh.name AS home_ou_name,
14526               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14527               aous.shortname AS home_sys_shortname,
14528               aous.name AS home_sys_name,
14529               auam.valid AS mailing_valid,
14530               auam.address_type AS mailing_address_type,
14531               auam.street1 AS mailing_street1,
14532               auam.street2 AS mailing_street2,
14533               auam.city AS mailing_city,
14534               auam.state AS mailing_state,
14535               auam.country AS mailing_country,
14536               auam.post_code AS mailing_post_code,
14537               auam.county AS mailing_county,
14538               auam.within_city_limits AS mailing_within_city_limits,
14539               auam.pending AS mailing_pending,
14540               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14541               auap.valid AS physical_valid,
14542               auap.address_type AS physical_address_type,
14543               auap.street1 AS physical_street1,
14544               auap.street2 AS physical_street2,
14545               auap.city AS physical_city,
14546               auap.state AS physical_state,
14547               auap.country AS physical_country,
14548               auap.post_code AS physical_post_code,
14549               auap.county AS physical_county,
14550               auap.within_city_limits AS physical_within_city_limits,
14551               auap.pending AS physical_pending,
14552               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14553               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14554               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14555               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14556               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14557               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14558               asceum1.stat_cat_entry AS legacy_stat_cat1,
14559               asceum2.stat_cat_entry AS legacy_stat_cat2,
14560
14561               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14562               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14563               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14564               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14565               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,
14566               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14567
14568             FROM
14569               actor.usr au
14570               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14571               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14572               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14573               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14574               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14575               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14576               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14577               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14578               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14579               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14580               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14581               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14582               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14583               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14584               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14585               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14586
14587             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14588               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14589               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14590               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14591               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14592               76,77,78,79,80,81
14593         ]]></oils_persist:source_definition>
14594         <field_groups>
14595             <group name="common" reporter:label="Common Fields"/>
14596             <group name="name" reporter:label="Name Fields"/>
14597             <group name="contact" reporter:label="Contact Fields"/>
14598             <group name="address" reporter:label="Address Related Fields"/>
14599             <group name="org" reporter:label="Libraries"/>
14600         </field_groups>
14601         <fields oils_persist:primary="user_id">
14602             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14603                 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"/>
14604             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14605             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14606             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14607             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14608             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14609             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14610             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14611             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14612             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14613             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14614             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14615             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14616             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14617             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14618             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14619             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14620             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14621             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14622             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14623             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14624             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14625             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14626             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14627             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14628             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14629             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14630             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14631             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14632             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14633             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14634             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14635             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14636             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14637             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14638             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14639             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14640             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14641             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14642             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14643             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14644             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14645             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14646             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14647             <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"/>
14648             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14649             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14650             <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"/>
14651             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14652             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14653             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14654             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14655             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14656             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14657             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14658             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14659             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14660             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14661             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14662             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14663             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14664             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14665             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14666             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14667             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14668             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14669             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14670             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14671             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14672             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14673             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14674             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14675             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14676             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14677             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14678             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14679             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14680             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14681             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14682             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14683             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14684             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14685             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14686             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14687             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14688             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14689         </fields>
14690         <links>
14691             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14692         </links>
14693     </class>
14694
14695     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14696         <oils_persist:source_definition><![CDATA[
14697             SELECT
14698               -- ids
14699               acp.id AS copy_id,
14700               acp.floating AS floating_id,
14701               acn.id AS acn_id,
14702               acp.circ_lib AS circ_lib_id,
14703               acp.status AS status_id,
14704               acp.location AS location_id,
14705               acp.age_protect AS age_protect_id,
14706               aous.id AS circ_sys_id,
14707               acn.owning_lib AS owning_lib_id,
14708               aouos.id AS owning_sys_id,
14709               awsi.id AS inv_workstation_id,
14710
14711               -- OUs
14712               aou.shortname AS circ_lib_shortname,
14713               aou.name AS circ_lib_name,
14714               aous.shortname AS circ_sys_shortname,
14715               aous.name AS circ_sys_name,
14716               aouo.shortname AS owning_lib_shortname,
14717               aouo.name AS owning_lib_name,
14718               aouos.shortname AS owning_sys_shortname,
14719               aouos.name AS owning_sys_name,
14720
14721               -- dates
14722               acp.create_date AS create_date_time,
14723               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14724               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14725               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14726               acp.active_date AS active_date_time,
14727               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14728               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14729               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14730               acp.edit_date AS edit_date_time,
14731               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14732               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14733               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14734               acp.status_changed_time AS status_changed_time_time,
14735               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14736               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14737               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14738               ali.inventory_date AS latest_inv_date,
14739               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14740               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14741               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14742
14743               -- acp
14744               acp.barcode AS barcode,
14745               ccs.name AS status,
14746               acpl.name AS location_name,
14747                                                         acp.circ_modifier AS copy_circ_modifier_code,
14748                                                         ccm.name AS copy_circ_modifier_name,
14749               acp.price AS price,
14750               acp.cost AS acq_price,
14751               acp.deleted AS copy_deleted,
14752               acp.ref AS reference,
14753               acp.circulate AS copy_circulate,
14754               (acp.circulate AND acpl.circulate) AS circulate,
14755               acp.holdable AS copy_holdable,
14756               acp.deposit AS deposit,
14757               acp.deposit_amount AS deposit_amount,
14758               acp.alert_message AS alert_message,
14759               acp.opac_visible AS copy_opac_visible,
14760               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14761               crahp.name AS age_protect,
14762               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14763               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14764               acp.copy_number AS copy_number,
14765               acp.circ_as_type AS circ_as_type,
14766               acp.loan_duration AS loan_duration_int,
14767               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14768               acp.fine_level AS fine_level_int,
14769               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14770
14771               -- Call Number
14772               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14773               acnp.label AS copy_call_number_prefix,
14774               acn.label AS copy_call_number_label,
14775               acns.label AS copy_call_number_suffix,
14776               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14777               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14778               acn.label_sortkey AS copy_call_number_label_sortkey,
14779               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14780               racnd.dewey AS call_number_dewey,
14781               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14782               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14783               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14784               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14785
14786               -- Misc
14787               COALESCE(rmsr.title, acp.dummy_title) AS title,
14788               COALESCE(rmsr.author, acp.dummy_author) AS author,
14789               rmsr.publisher AS publisher,
14790               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14791               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14792               array_to_string(rmsr.issn, ', ') AS issn,
14793               part.label AS part_label,
14794               part.label_sortkey AS part_label_sortkey,
14795               acn.record AS bib_id,
14796               rmsr.tcn_value AS tcn_value,
14797               acn.deleted AS call_deleted,
14798               bre.deleted AS bib_deleted,
14799               ccs.holdable AS status_holdable,
14800               acpl.holdable AS location_holdable,
14801               acp.circulate AS location_circulate,
14802               awsi.name AS inventory_workstation,
14803               aucr.usrname AS creating_user,
14804               aued.usrname AS editing_user,
14805
14806               -- Aggregates
14807               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14808               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,
14809               COUNT(DISTINCT combcirc.id) AS circ_total,
14810               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14811
14812             FROM
14813               asset.copy acp
14814               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14815               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14816               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14817               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14818               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14819               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14820               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14821               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14822               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14823               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14824               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14825               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14826               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14827               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14828               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14829               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14830               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14831               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14832               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14833               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14834               LEFT JOIN (
14835                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14836                 FROM biblio.monograph_part bmp
14837                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14838                 WHERE NOT bmp.deleted
14839               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14840
14841             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14842               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14843               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14844               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14845               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14846               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14847               91,92,93,94,95,96
14848
14849         ]]></oils_persist:source_definition>
14850         <field_groups>
14851             <group name="common" reporter:label="Common Fields"/>
14852             <group name="dates" reporter:label="Date Fields"/>
14853             <group name="title" reporter:label="Call Number and Title Fields"/>
14854             <group name="org" reporter:label="Libraries"/>
14855         </field_groups>
14856         <fields oils_persist:primary="copy_id">
14857             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14858             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14859             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14860             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14861             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14862             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14863             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14864             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14865             <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"/>
14866             <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"/>
14867             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14868             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14869             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14870             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14871             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14872             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14873             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14874             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14875             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14876             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14877             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14878             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14879             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14880             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14881             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14882             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14883             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14884             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14885             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14886             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14887             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14888             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14889             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14890             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14891             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14892             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14893             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14894             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14895             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14896             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14897             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14898             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14899             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14900             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14901             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14902             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14903             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14904             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14905             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14906             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14907             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14908             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14909             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14910             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14911             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14912             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14913             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14914             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14915             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14916             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14917             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14918             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14919             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14920             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14921             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14922             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14923             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14924             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14925             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14926             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14927             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14928             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14929             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14930             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14931             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14932             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14933             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14934             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14935             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14936             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14937             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14938             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14939             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14940             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14941             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14942             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14943             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14944             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14945             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14946             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14947             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14948             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14949             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14950             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14951         </fields>
14952         <links>
14953             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14954             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14955             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14956             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14957             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14958             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14959         </links>
14960     </class>
14961
14962     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14963         <oils_persist:source_definition><![CDATA[
14964
14965             SELECT
14966               -- ids
14967               acp.id AS copy_id,
14968               acn.id AS acn_id,
14969               acp.circ_lib AS circ_lib_id,
14970               acp.status AS status_id,
14971               acp.location AS location_id,
14972               acp.age_protect AS age_protect_id,
14973               aous.id AS circ_sys_id,
14974               acn.owning_lib AS owning_lib_id,
14975               aouos.id AS owning_sys_id,
14976               awsi.id AS inv_workstation_id,
14977
14978               -- OUs
14979               aou.shortname AS circ_lib_shortname,
14980               aou.name AS circ_lib_name,
14981               aous.shortname AS circ_sys_shortname,
14982               aous.name AS circ_sys_name,
14983               aouo.shortname AS owning_lib_shortname,
14984               aouo.name AS owning_lib_name,
14985               aouos.shortname AS owning_sys_shortname,
14986               aouos.name AS owning_sys_name,
14987
14988               -- dates
14989               acp.create_date AS create_date_time,
14990               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14991               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14992               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14993               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14994               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14995               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14996               acp.active_date AS active_date_time,
14997               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14998               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14999               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
15000               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
15001               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
15002               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
15003               acp.edit_date AS edit_date_time,
15004               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
15005               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
15006               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
15007               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
15008               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
15009               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
15010               acp.status_changed_time AS status_changed_time_time,
15011               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
15012               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
15013               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
15014               ali.inventory_date AS latest_inv_date,
15015               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
15016               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
15017               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
15018               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
15019               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
15020               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
15021
15022               -- acp
15023               acp.barcode AS barcode,
15024               ccs.name AS status,
15025               acpl.name AS location_name,
15026               acp.circ_modifier AS circ_modifier_code,
15027               ccm.name AS circ_modifier_name,
15028               acp.price AS price,
15029               acp.cost AS acq_price,
15030               acp.deleted AS copy_deleted,
15031               acp.ref AS reference,
15032               acp.circulate AS copy_circulate,
15033               (acp.circulate AND acpl.circulate) AS circulate,
15034               acp.holdable AS copy_holdable,
15035               acp.deposit AS deposit,
15036               acp.deposit_amount AS deposit_amount,
15037               acp.alert_message AS alert_message,
15038               acp.opac_visible AS copy_opac_visible,
15039               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
15040               crahp.name AS age_protect,
15041               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15042               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15043               acp.copy_number AS copy_number,
15044               acp.circ_as_type AS circ_as_type,
15045               acp.loan_duration AS loan_duration_int,
15046               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15047               acp.fine_level AS fine_level_int,
15048               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15049
15050               -- Call Number
15051               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15052               acnp.label AS copy_call_number_prefix,
15053               acn.label AS copy_call_number_label,
15054               acns.label AS copy_call_number_suffix,
15055               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15056               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15057               acn.label_sortkey AS copy_call_number_label_sortkey,
15058               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15059               racnd.dewey AS call_number_dewey,
15060               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15061               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15062               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15063               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15064
15065               -- Misc
15066               COALESCE(rmsr.title, acp.dummy_title) AS title,
15067               COALESCE(rmsr.author, acp.dummy_author) AS author,
15068               rmsr.publisher AS publisher,
15069               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15070               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15071               array_to_string(rmsr.issn, ', ') AS issn,
15072               part.label AS part_label,
15073               part.label_sortkey AS part_label_sortkey,
15074               acn.record AS bib_id,
15075               rmsr.tcn_value AS tcn_value,
15076               acn.deleted AS call_deleted,
15077               bre.deleted AS bib_deleted,
15078               ccs.holdable AS status_holdable,
15079               acpl.holdable AS location_holdable,
15080               acp.circulate AS location_circulate,
15081               awsi.name AS inventory_workstation,
15082
15083               -- Aggregates
15084               -- may decide these price games aren't worth it, but estimated collection value is useful
15085               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,
15086               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15087               MAX(combcirc.xact_start) AS last_circ_datetime,
15088               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15089               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15090               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15091               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15092               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15093               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15094               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15095               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15096               (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,
15097               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15098               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15099               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15100               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15101               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15102               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15103               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,
15104               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,
15105               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,
15106               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
15107
15108             FROM
15109               asset.copy acp
15110               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15111               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15112               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15113               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15114               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15115               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15116               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15117               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15118               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15119               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15120               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15121               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15122               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15123               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15124               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15125               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15126               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15127               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15128               LEFT JOIN (
15129                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15130                 FROM biblio.monograph_part bmp
15131                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15132                 WHERE NOT bmp.deleted
15133               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15134
15135             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15136               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15137               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15138               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15139               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15140               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15141               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15142
15143         ]]></oils_persist:source_definition>
15144         <field_groups>
15145             <group name="common" reporter:label="Common Fields"/>
15146             <group name="dates" reporter:label="Date Fields"/>
15147             <group name="inv" reporter:label="Inventory Fields"/>
15148             <group name="title" reporter:label="Call Number and Title Fields"/>
15149             <group name="org" reporter:label="Libraries"/>
15150         </field_groups>
15151         <fields oils_persist:primary="copy_id">
15152              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15153              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15154              <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"/>
15155              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15156              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15157              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15158              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15159              <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"/>
15160              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15161              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15162              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15163              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15164              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15165              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15166              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15167              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15168              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15169              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15170              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15171              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15172              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15173              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15174              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15175              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15176              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15177              <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"/>
15178              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15179              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15180              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15181              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15182              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15183              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15184              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15185              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15186              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15187              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15188              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15189              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15190              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15191              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15192              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15193              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15194              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15195              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15196              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15197              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15198              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15199              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15200              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15201              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15202              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15203              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15204              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15205              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15206              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15207              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15208              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15209              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15210              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15211              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15212              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15213              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15214              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15215              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15216              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15217              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15218              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15219              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15220              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15221              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15222              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15223              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15224              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15225              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15226              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15227              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15228              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15229              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15230              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15231              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15232              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15233              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15234              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15235              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15236              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15237              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15238              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15239              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15240              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15241              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15242              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15243              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15244              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15245              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15246              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15247              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15248              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15249              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15250              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15251              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15252              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15253              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15254              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15255              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15256              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15257              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15258              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15259              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15260              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15261              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15262              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15263              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15264              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15265              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15266              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15267              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15268              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15269              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15270              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15271              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15272              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15273              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15274              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15275              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15276              <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"/>
15277              <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"/>
15278              <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"/>
15279         </fields>
15280         <links>
15281             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15282             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15283             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15284             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15285             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15286         </links>
15287     </class>
15288
15289     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15290         <oils_persist:source_definition><![CDATA[
15291
15292             SELECT
15293               -- ids
15294               xact.id AS xact_id,
15295               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15296               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15297
15298               -- OUs
15299               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15300               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15301               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15302               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15303
15304               -- billings
15305               billings.total_amount AS billing_grand_total,
15306               billings.total_unvoided_amount AS billing_total,
15307
15308               billings.voided_billing_count AS billing_voided_count,
15309               billings.all_billing_types AS all_billing_types,
15310               billings.billing_types AS billing_types,
15311
15312               billings.total_voided_amount AS billing_total_voided,
15313               billings.total_overdue_amount AS billing_overdue_amount,
15314               billings.total_lost_amount AS billing_lost_amount,
15315               billings.total_long_od_amount AS billing_long_od_amount,
15316               billings.total_damaged_amount AS billing_damaged_amount,
15317               billings.total_deposit_amount AS billing_deposit_amount,
15318               billings.total_rental_amount AS billing_rental_amount,
15319
15320               -- payments
15321               payments.total_amount AS payment_grand_total,
15322               payments.total_unvoided_amount AS payment_total,
15323
15324               payments.voided_payment_count AS payment_voided_count,
15325               payments.all_payment_types AS all_payment_types,
15326               payments.payment_types AS payment_types,
15327
15328               payments.total_voided_amount AS payment_total_voided,
15329               payments.total_account_adjustment AS payment_account_adjustment_amount,
15330               payments.total_cash_payment AS payment_cash_amount,
15331               payments.total_check_payment AS payment_check_amount,
15332               payments.total_credit_card_payment AS payment_credit_card_amount,
15333               payments.total_debit_card_payment AS payment_debit_card_amount,
15334               payments.total_credit_payment AS payment_credit_amount,
15335               payments.total_forgive_payment AS payment_forgive_amount,
15336               payments.total_work_payment AS payment_work_amount,
15337               payments.total_goods_payment AS payment_goods_amount,
15338               payments.total_currency_payment AS payment_currency_amount,
15339               payments.total_non_currency_payment AS payment_non_currency_amount,
15340
15341               -- dates
15342               xact.xact_start AS xact_start,
15343               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15344               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15345               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15346               xact.xact_finish AS xact_finish,
15347               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15348               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15349               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15350               billings.earliest_billing_ts AS earliest_billing_ts,
15351               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15352               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15353               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15354               billings.latest_billing_ts AS latest_billing_ts,
15355               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15356               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15357               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15358               payments.earliest_payment_ts AS earliest_payment_ts,
15359               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15360               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15361               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15362               payments.latest_payment_ts AS latest_payment_ts,
15363               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15364               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15365               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15366
15367               -- Misc
15368               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15369               (xact.xact_finish IS NOT NULL) AS xact_closed
15370
15371             FROM
15372               money.billable_xact xact
15373               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15374               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15375               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15376               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15377               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15378               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15379
15380               -- oohh nooo.... If not done this way you encounter situations
15381               -- like multiplying billing totals x number of payments and
15382               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15383               LEFT JOIN (
15384                 SELECT
15385                   xact,
15386                   MIN(billing_ts) AS earliest_billing_ts,
15387                   MAX(billing_ts) AS latest_billing_ts,
15388
15389                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15390                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15391                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15392
15393                   SUM(amount) AS total_amount,
15394                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15395                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15396                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15397                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15398                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15399                   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.
15400                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15401                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15402
15403                 FROM
15404                   money.all_billings
15405                 GROUP BY 1
15406               ) billings ON (xact.id = billings.xact)
15407               -- Can't include accepting user or cash_drawer because that will "duplicate"
15408               -- rows if multiple staff accept payments on a single xact...
15409               LEFT JOIN (
15410                 SELECT
15411                   xact,
15412                   MIN(payment_ts) AS earliest_payment_ts,
15413                   MAX(payment_ts) AS latest_payment_ts,
15414
15415                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15416                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15417                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15418
15419                   SUM(amount) AS total_amount,
15420                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15421                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15422                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15423                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15424                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15425                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15426                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15427                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15428                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15429                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15430                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15431                   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,
15432                   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
15433
15434                 FROM
15435                   money.all_payments
15436                 GROUP BY 1
15437               ) payments ON (xact.id = payments.xact)
15438
15439         ]]></oils_persist:source_definition>
15440         <field_groups>
15441             <group name="common" reporter:label="Common Fields"/>
15442             <group name="bill" reporter:label="Billing Fields"/>
15443             <group name="pay" reporter:label="Payment Fields"/>
15444             <group name="dates" reporter:label="Date Fields"/>
15445             <group name="org" reporter:label="Libraries"/>
15446         </field_groups>
15447         <fields oils_persist:primary="xact_id">
15448              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15449              <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"/>
15450              <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"/>
15451              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15452              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15453              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15454              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15455              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15456              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15457              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15458              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15459              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15460              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15461              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15462              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15463              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15464              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15465              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15466              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15467              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15468              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15469              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15470              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15471              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15472              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15473              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15474              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15475              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15476              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15477              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15478              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15479              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15480              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15481              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15482              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15483              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15484              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15485              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15486              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15487              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15488              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15489              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15490              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15491              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15492              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15493              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15494              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15495              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15496              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15497              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15498              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15499              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15500              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15501              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15502              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15503              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15504              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15505              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15506              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15507              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15508              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15509              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15510         </fields>
15511     </class>
15512
15513         <class id="coauf" 
15514                 controller="open-ils.cstore open-ils.pcrud"
15515                 oils_obj:fieldmapper="config::openathens_uid_field" 
15516                 oils_persist:tablename="config.openathens_uid_field" 
15517                 reporter:label="OpenAthens unique identifiers">
15518                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15519                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15520                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15521                 </fields>
15522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15523                         <actions>
15524                                 <retrieve/>
15525                         </actions>
15526                 </permacrud>
15527         </class>
15528
15529         <class id="coanf" 
15530                 controller="open-ils.cstore open-ils.pcrud"
15531                 oils_obj:fieldmapper="config::openathens_name_field" 
15532                 oils_persist:tablename="config.openathens_name_field" 
15533                 reporter:label="OpenAthens name fields">
15534                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15535                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15536                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15537                 </fields>
15538                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15539                         <actions>
15540                                 <retrieve/>
15541                         </actions>
15542                 </permacrud>
15543         </class>
15544
15545         <class id="coai" 
15546                 controller="open-ils.cstore open-ils.pcrud"
15547                 oils_obj:fieldmapper="config::openathens_identity" 
15548                 oils_persist:tablename="config.openathens_identity" 
15549                 reporter:label="Sign-on to OpenAthens">
15550                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15551                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15552                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15553                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15554                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15555                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15556                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15557                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15558                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15559                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15560                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15561                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15562                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15563                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15564                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15565                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15566                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15567                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15568                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15569                 </fields>
15570                 <links>
15571                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15572                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15573                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15574                 </links>
15575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15576                         <actions>
15577                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15578                                 <retrieve/>
15579                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15580                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15581                         </actions>
15582                 </permacrud>
15583         </class>
15584
15585         <!-- ********************************************************************************************************************* -->
15586 </IDL>
15587
15588 <!--
15589     vim:noet:ts=4:sw=4:
15590 -->