]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
lp1857911 angularized stat cat admin interfaces
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77
78         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio"
79                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
80                    oils_persist:tablename="oai.biblio">
81                 <fields oils_persist:primary="rec_id">
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
83                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
84                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
85                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
86                 </fields>
87         </class>
88         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority"
89                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
90                    oils_persist:tablename="oai.authority">
91                 <fields oils_persist:primary="rec_id">
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
93                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
94                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
95                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
96                 </fields>
97         </class>
98
99         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
100                 <fields>
101                         <field name="usr" oils_persist:virtual="true" />
102                         <field name="forgive_payment" oils_persist:virtual="true" />
103                         <field name="work_payment" oils_persist:virtual="true" />
104                         <field name="credit_payment" oils_persist:virtual="true" />
105                         <field name="goods_payment" oils_persist:virtual="true" />
106                         <field name="account_adjustment" oils_persist:virtual="true" />
107                 </fields>
108                 <links>
109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
110                 </links>
111         </class>
112
113         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
114                 <fields>
115                         <field name="workstation" oils_persist:virtual="true" />
116                         <field name="cash_payment" oils_persist:virtual="true" />
117                         <field name="check_payment" oils_persist:virtual="true" />
118                         <field name="credit_card_payment" oils_persist:virtual="true" />
119                         <field name="debit_card_payment" oils_persist:virtual="true" />
120                 </fields>
121                 <links>
122                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
123                 </links>
124         </class>
125
126         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
127                 <fields>
128                         <field name="id" oils_persist:virtual="true" />
129                         <field name="children" oils_persist:virtual="true" />
130                         <field name="owner_doc" oils_persist:virtual="true" />
131                         <field name="intra_doc_id" oils_persist:virtual="true" />
132                         <field name="parent_node" oils_persist:virtual="true" />
133                         <field name="node_type" oils_persist:virtual="true" />
134                         <field name="namespace_uri" oils_persist:virtual="true" />
135                         <field name="name" oils_persist:virtual="true" />
136                         <field name="value" oils_persist:virtual="true" />
137                 </fields>
138         </class>
139
140         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
141                 <fields>
142                         <field name="title" oils_persist:virtual="true" />
143                         <field name="author" oils_persist:virtual="true" />
144                         <field name="doc_id" oils_persist:virtual="true" />
145                         <field name="doc_type" oils_persist:virtual="true" />
146                         <field name="pubdate" oils_persist:virtual="true" />
147                         <field name="isbn" oils_persist:virtual="true" />
148                         <field name="publisher" oils_persist:virtual="true" />
149                         <field name="tcn" oils_persist:virtual="true" />
150                         <field name="subject" oils_persist:virtual="true" />
151                         <field name="types_of_resource" oils_persist:virtual="true" />
152                         <field name="call_numbers" oils_persist:virtual="true" />
153                         <field name="edition" oils_persist:virtual="true" />
154                         <field name="online_loc" oils_persist:virtual="true" />
155                         <field name="synopsis" oils_persist:virtual="true" />
156                         <field name="physical_description" oils_persist:virtual="true" />
157                         <field name="toc" oils_persist:virtual="true" />
158                         <field name="copy_count" oils_persist:virtual="true" />
159                         <field name="series" oils_persist:virtual="true" />
160                         <field name="serials" oils_persist:virtual="true" />
161                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
162                 </fields>
163         </class>
164
165         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
166                 <fields>
167                         <field name="err_msg" oils_persist:virtual="true" />
168                         <field name="type" oils_persist:virtual="true" />
169                 </fields>
170         </class>
171
172         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
173                 <fields>
174                         <field name="err_msg" oils_persist:virtual="true" />
175                         <field name="type" oils_persist:virtual="true" />
176                 </fields>
177         </class>
178
179         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
180                 <fields oils_persist:primary="matchpoint">
181                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
182                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
183                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
184                 </fields>
185                 <links>
186                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
187                 </links>
188         </class>
189
190         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
191         <!-- when the time is right, turn me into a view.  -->
192                 <fields>
193             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
194             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
195             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
196             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
197             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
198             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
199             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
200             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
201             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
202             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
203                 </fields>
204         </class>
205
206         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
207                 <fields>
208                         <field name="public_name" oils_persist:virtual="true" />
209                         <field name="target_url" oils_persist:virtual="true" />
210                         <field name="target_coverage" oils_persist:virtual="true" />
211                         <field name="target_embargo" oils_persist:virtual="true" />
212                 </fields>
213         </class>
214
215         <!-- Actually in the DB -->
216         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
219                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
220                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
221                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
222                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
223                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
224                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
225                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
226                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
227                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
228                 </fields>
229                 <links>
230                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
231                 </links>
232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
233                         <actions>
234                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
235                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
236                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
237                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
238                         </actions>
239                 </permacrud>
240         </class>
241
242         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
243                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
244                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
245                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
246                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
247                 </fields>
248                 <links>
249                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
250                 </links>
251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
252                         <actions>
253                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
254                     <context link="grp" field="owner"/>
255                 </create>
256                                 <retrieve/>
257                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
258                     <context link="grp" field="owner"/>
259                 </update>
260                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
261                     <context link="grp" field="owner"/>
262                 </delete>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rrbs" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::record_badge_score" 
270             oils_persist:tablename="rating.record_badge_score" 
271             reporter:label="Statistical Popularity Badge">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.record_badge_score_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
276                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
277                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
278                 </fields>
279         <links>
280             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
281             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
282         </links>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <retrieve/>
286                         </actions>
287                 </permacrud>
288         </class>
289
290         <class  id="rp" 
291             controller="open-ils.cstore open-ils.pcrud" 
292             oils_obj:fieldmapper="rating::popularity_parameter" 
293             oils_persist:tablename="rating.popularity_parameter" 
294             reporter:label="Statistical Popularity Parameter">
295                 <fields oils_persist:primary="id" 
296                 oils_persist:sequence="rating.popularity_parameter_id_seq">
297                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
299                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
300                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
301                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
302                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
303                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
304                 </fields>
305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
306                         <actions>
307                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
308                                 <retrieve/>
309                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
310                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
311                         </actions>
312                 </permacrud>
313         </class>
314
315         <class  id="rb" 
316             controller="open-ils.cstore open-ils.pcrud" 
317             oils_obj:fieldmapper="rating::badge" 
318             oils_persist:tablename="rating.badge" 
319             reporter:label="Statistical Popularity Badge">
320                 <fields oils_persist:primary="id" 
321                 oils_persist:sequence="rating.badge_id_seq">
322                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
323                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
325                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
326                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
327                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
328                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
329                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
330                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
331                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
332                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
333                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
334                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
335                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
336                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
337                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
338                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
339                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
340                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
341                 </fields>
342                 <links>
343                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
344                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
345                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
346                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
347                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
348                 </links>
349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
350                         <actions>
351                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
352                                 <retrieve/>
353                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
354                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
355                         </actions>
356                 </permacrud>
357         </class>
358
359         <class  id="vibtg" 
360             controller="open-ils.cstore open-ils.pcrud" 
361             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
362             oils_persist:tablename="vandelay.import_bib_trash_group" 
363             reporter:label="Import/Overlay Field Groups for Removal">
364                 <fields oils_persist:primary="id" 
365                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
366                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
367                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
368                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
369                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
370                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
371                 </fields>
372                 <links>
373                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
374                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
375                 </links>
376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
377                         <actions>
378                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
379                                 <retrieve/>
380                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
381                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
382                         </actions>
383                 </permacrud>
384         </class>
385
386
387         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
388                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
389                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
390                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
391                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
392                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
393                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
394                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
395                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
396                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
397                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
398                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
399                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
400                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
401                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
402                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
403                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
404                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
405                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
406                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
407                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
408                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
409                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
410                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
411                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
412                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
413                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
414                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
415                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
416                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
417                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
418                 </fields>
419                 <links>
420                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
421                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
422                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
423                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
424                 </links>
425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
426                         <actions>
427                                 <create permission="CREATE_IMPORT_ITEM">
428                     <context link="definition" field="owner"/>
429                                 </create>
430                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
431                     <context link="definition" field="owner"/>
432                                 </retrieve>
433                                 <update permission="UPDATE_IMPORT_ITEM">
434                     <context link="definition" field="owner"/>
435                                 </update>
436                                 <delete permission="DELETE_IMPORT_ITEM">
437                     <context link="definition" field="owner"/>
438                                 </delete>
439                         </actions>
440                 </permacrud>
441         </class>
442
443         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
444                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
445                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
446                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
448                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
449                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
450                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
451                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
452                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
453                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
454                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
455                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
456                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
457                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
458                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
459                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
460                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
462                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
463                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
464                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
465                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
466                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
467                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
468                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
469                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
470                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
471                 </fields>
472                 <links>
473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
474                 </links>
475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
476                         <actions>
477                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
478                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
479                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
480                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
481                         </actions>
482                 </permacrud>
483         </class>
484
485         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
486                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
487                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
488                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
489                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
490                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
491                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
492                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
493                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
494                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
495                 </fields>
496                 <links>
497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
498                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
499                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
500                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
501                 </links>
502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
503                         <actions>
504                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
505                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
506                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
507                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
508                         </actions>
509                 </permacrud>
510         </class>
511
512         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
513                 <fields oils_persist:primary="code">
514                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
516                 </fields>
517                 <links>
518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
519                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
520                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
521                 </links>
522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
523                         <actions>
524                                 <retrieve/>
525                         </actions>
526                 </permacrud>
527         </class>
528
529         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
530                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
531                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
532                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
533                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
534                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
535                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
536                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
537                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
538                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
539                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
540                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
541                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
542                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
543                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
544                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
545                 </fields>
546                 <links>
547                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
548                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
549                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
550                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
551             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
552             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
553             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
554                 </links>
555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
556                         <actions>
557                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
558                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
559                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
560                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
561                         </actions>
562                 </permacrud>
563         </class>
564
565         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
566                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
568                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
569                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
570                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
571                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
572                 </fields>
573                 <links/>
574                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
575                         <actions>
576                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
577                 <retrieve/>
578                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
579                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
580                         </actions>
581                 </permacrud>
582         </class>
583
584         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
585                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
586                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
587                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
588                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
589                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
594                 </links>
595                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
596                         <actions>
597                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
598                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
599                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
600                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
601                         </actions>
602                 </permacrud>
603         </class>
604
605         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
607                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
608                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
609                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
610                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
611                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
612                 </fields>
613                 <links>
614                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
615                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
616                 </links>
617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
618                         <actions>
619                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
620                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
621                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
622                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
623                         </actions>
624                 </permacrud>
625         </class>
626
627         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
628                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
629                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
630                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
632                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
633                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
634                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
635                 </fields>
636                 <links>
637                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
638                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
639                 </links>
640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
641                         <actions>
642                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
643                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
644                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
645                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
646                         </actions>
647                 </permacrud>
648         </class>
649
650         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
651                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
652                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
653                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
654                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
655                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
656                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
657                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
658                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
659                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
660                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
661                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
662                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
663                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
664                 </fields>
665                 <links>
666                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
667                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
668                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
669             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
670             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
671                 </links>
672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
673                         <actions>
674                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
675                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
676                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
677                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
678                         </actions>
679                 </permacrud>
680         </class>
681
682         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
683                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
685                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
686                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
687                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
688                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
689                 </fields>
690                 <links/>
691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
692                         <actions>
693                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
694                 <retrieve/>
695                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
696                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
697                         </actions>
698                 </permacrud>
699         </class>
700
701         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
702                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
703                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
704                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
705                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
706                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
711                 </links>
712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
713                         <actions>
714                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
716                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
717                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
718                         </actions>
719                 </permacrud>
720         </class>
721
722         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
724                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
725                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
726                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
727                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
728                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
729                 </fields>
730                 <links>
731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
732                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
733                 </links>
734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735                         <actions>
736                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
737                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
738                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
739                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
740                         </actions>
741                 </permacrud>
742         </class>
743
744         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
745                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
746                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
748                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
749                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
750                 </fields>
751                 <links>
752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
753                 </links>
754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
755                         <actions>
756                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
757                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
758                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
759                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
760                         </actions>
761                 </permacrud>
762         </class>
763
764         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
765                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
766                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
767                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
768                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
769                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
770                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
771                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
772                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
773             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
774                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
775                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
776                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
777                 </fields>
778                 <links>
779                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
780                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
781                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
782                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
783                 </links>
784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
785                         <actions>
786                                 <create permission="ADMIN_IMPORT_MATCH_SET">
787                     <context link="match_set" field="owner"/>
788                                 </create>
789                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
790                     <context link="match_set" field="owner"/>
791                                 </retrieve>
792                                 <update permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </update>
795                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </delete>
798                         </actions>
799                 </permacrud>
800         </class>
801
802         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
803                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
804                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
805                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
806                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
807                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
808                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
809                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
810                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
811                 </fields>
812                 <links>
813                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
814                 </links>
815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
816                         <actions>
817                                 <create permission="ADMIN_IMPORT_MATCH_SET">
818                     <context link="match_set" field="owner"/>
819                                 </create>
820                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
821                     <context link="match_set" field="owner"/>
822                                 </retrieve>
823                                 <update permission="ADMIN_IMPORT_MATCH_SET">
824                     <context link="match_set" field="owner"/>
825                                 </update>
826                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
827                     <context link="match_set" field="owner"/>
828                                 </delete>
829                         </actions>
830                 </permacrud>
831         </class>
832
833         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
834                 oils_obj:fieldmapper="vandelay::session_tracker" 
835                 oils_persist:tablename="vandelay.session_tracker" 
836                 reporter:label="Vandelay Session Tracker">
837                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
839                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
840                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
842                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
843                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
844                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
845                                          queue or an auth queue and there's no IDL class for vandelay.queue .
846                                          parent table.
847                         -->
848                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
849                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
850                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
851                         <field reporter:label="State" name="state" reporter:datatype="text"/>
852                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
853                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
854                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
855                 </fields>
856                 <links>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
859                 </links>
860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
861                         <actions>
862                                 <!-- created by the API -->
863                                 <retrieve global_required="true"
864                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
865                                 <update global_required="true"
866                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
867                                         <context link="workstation" field="owning_lib"/>
868                                 </update>
869                                 <delete 
870                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
871                                         <context link="workstation" field="owning_lib"/>
872                                 </delete>
873                         </actions>
874                 </permacrud>
875         </class>
876
877         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
879                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
880                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
881                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
882                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
883                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
884                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
885                 </fields>
886                 <links>
887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
889                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
890                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
891                 </links>
892         </class>
893
894     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
895         <fields oils_persist:primary="name">
896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
897             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
898             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
899             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
900         </fields>
901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
902             <actions>
903                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
904                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
905                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
906                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
907             </actions>
908         </permacrud>
909     </class>
910
911     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
912         <fields oils_persist:primary="id">
913             <field reporter:label="ID" name="id" reporter:datatype="id"/>
914             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
915             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
916             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
917             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
918         </fields>
919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
920             <actions>
921                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922                 <retrieve/>
923                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
924                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
925             </actions>
926         </permacrud>
927     </class>
928
929         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
932                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
933                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
934                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
935                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
936                 </fields>
937                 <links>
938                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
939                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
940                 </links>
941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
942             <actions>
943                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
944                 <retrieve/>
945                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
946                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
947             </actions>
948         </permacrud>
949         </class>
950
951         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
952                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
953                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
954                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
956         </fields>
957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
958             <actions>
959                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
960                 <retrieve/>
961                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
962                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
963             </actions>
964         </permacrud>
965         </class>
966
967         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
968                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
969                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
970                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
971                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
972                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
974                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
975                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
976                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
977                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
978                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
979                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
980         </fields>
981                 <links>
982                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
984         </links>
985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
986             <actions>
987                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
988                 <retrieve/>
989                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
991             </actions>
992         </permacrud>
993         </class>
994
995         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:field_safe="true">
996                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
997                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
998                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
999                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
1001                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
1002                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1003                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
1004                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
1005                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
1006                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
1007         </fields>
1008                 <links>
1009                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
1010                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1011         </links>
1012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1013             <actions>
1014                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
1015                 <retrieve/>
1016                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
1017                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
1018             </actions>
1019         </permacrud>
1020         </class>
1021
1022         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
1023                 <fields oils_persist:primary="name">
1024                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1025                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1026                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1027                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1028                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1029                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1030                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1031                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1032                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1033                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1034                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1035                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1036                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1037                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1038                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1039                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1040                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1041                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1042                 </fields>
1043                 <links>
1044                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1045                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1046                 </links>
1047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1048             <actions>
1049                 <create permission="ADMIN_SVF" global_required="true"/>
1050                 <retrieve/>
1051                 <update permission="ADMIN_SVF" global_required="true"/>
1052                 <delete permission="ADMIN_SVF" global_required="true"/>
1053             </actions>
1054         </permacrud>
1055         </class>
1056
1057         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
1058                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1060                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1061                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1062             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1063                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1064                 </fields>
1065                 <links/>
1066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1067             <actions>
1068                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1069                 <retrieve/>
1070                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1071                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1077                 <fields oils_persist:primary="coded_value">
1078                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1087                 <retrieve/>
1088                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1089                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1090             </actions>
1091         </permacrud>
1092         </class>
1093
1094         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1096                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1097                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1098                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1099                 </fields>
1100                 <links>
1101                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1102                 </links>
1103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1104             <actions>
1105                 <retrieve/>
1106             </actions>
1107         </permacrud>
1108         </class>
1109
1110
1111         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1112                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1113                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1114                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1115                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1116                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1117                 </fields>
1118                 <links>
1119                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1120                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1121                 </links>
1122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1123             <actions>
1124                 <retrieve/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129
1130         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1131                 <fields oils_persist:primary="source">
1132                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1134                 </fields>
1135                 <links>
1136                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1137                 </links>
1138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1139             <actions>
1140                 <retrieve/>
1141             </actions>
1142         </permacrud>
1143         </class>
1144
1145         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1146                 <fields>
1147                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1148                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1149                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1150                 </fields>
1151                 <links>
1152                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1153                 </links>
1154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1155             <actions>
1156                 <retrieve/>
1157             </actions>
1158         </permacrud>
1159         </class>
1160
1161         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1162                 <fields oils_persist:primary="id">
1163                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1164                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1165                 </fields>
1166                 <links>
1167                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1168                 </links>
1169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1170             <actions>
1171                 <retrieve/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1179                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1180                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1181                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1182                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1183                 </fields>
1184                 <links>
1185                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1186                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1187                 </links>
1188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1189             <actions>
1190                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1191                 <retrieve/>
1192                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1193                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1194             </actions>
1195         </permacrud>
1196         </class>
1197
1198         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1199                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1200                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1201                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1202                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1203                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1204                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1205                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1206                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1207             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1208             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1209             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1210                 </fields>
1211                 <links>
1212                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1213                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1218                 <retrieve/>
1219                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1220                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1226                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1227                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1228                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1229                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1230                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1231                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1232                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1233                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1234                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1235                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1236                 </fields>
1237                 <links>
1238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1239                 </links>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1243                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1244                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1245                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1251         <fields oils_persist:primary="name">
1252             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1253             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1255             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1256             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1257             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1258             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1259             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1260             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1261             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1262         </fields>
1263         <links>
1264             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1265             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1266         </links>
1267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1268             <actions>
1269                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <retrieve/>
1271                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1272                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273             </actions>
1274         </permacrud>
1275     </class>
1276
1277     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1278         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1279             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1280             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1281             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1282             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1283             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1284             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1285             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1286         </fields>
1287         <links>
1288             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1289         </links>
1290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291             <actions>
1292                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1293                 <retrieve/>
1294                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1296             </actions>
1297         </permacrud>
1298     </class>
1299
1300     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1301                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1302                         oils_persist:tablename="config.z3950_index_field_map" 
1303                         reporter:label="Z39.50 Index Field Map">
1304         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1305             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1306             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1307             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1308             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1309             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1310             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1311         </fields>
1312         <links>
1313             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1314             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1315             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1316         </links>
1317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1318             <actions>
1319                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1320                 <retrieve/>
1321                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1322                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1323             </actions>
1324         </permacrud>
1325     </class>
1326
1327
1328         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1329                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1330                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1331                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1332                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1333                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1334                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1335                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1336             <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1337                 </fields>
1338                 <links>
1339             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1340             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1341                 </links>
1342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1343                         <actions>
1344                                 <retrieve/>
1345                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1346                         </actions>
1347                 </permacrud>
1348         </class>
1349
1350         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1351                 <fields oils_persist:primary="key">
1352                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1353                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1354                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1355                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1356                 </fields>
1357                 <links/>
1358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1359                         <actions>
1360                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1361                                 <retrieve/>
1362                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1363                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1364                         </actions>
1365                 </permacrud>
1366         </class>
1367
1368         <class id="atcol" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1369                 <fields oils_persist:primary="module">
1370                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1371                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1372                 </fields>
1373                 <links/>
1374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1375                         <actions>
1376                                 <retrieve/>
1377                         </actions>
1378                 </permacrud>
1379         </class>
1380
1381         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1382                 <fields oils_persist:primary="module">
1383                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1385                 </fields>
1386                 <links/>
1387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1388                         <actions>
1389                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1390                                 <retrieve/>
1391                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1392                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1393                         </actions>
1394                 </permacrud>
1395         </class>
1396
1397         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1398                 <fields oils_persist:primary="module">
1399                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1400                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1401                 </fields>
1402                 <links/>
1403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1404                         <actions>
1405                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1406                                 <retrieve/>
1407                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1408                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1409                         </actions>
1410                 </permacrud>
1411         </class>
1412
1413         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1414                 <fields oils_persist:primary="module">
1415                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                 </fields>
1418                 <links/>
1419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1420                         <actions>
1421                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1422                                 <retrieve/>
1423                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1424                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1425                         </actions>
1426                 </permacrud>
1427         </class>
1428
1429         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1430                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1431                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1432                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1433                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1434                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1435                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1436                 </fields>
1437                 <links>
1438                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1439                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1440                 </links>
1441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1442                         <actions>
1443                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1444                     <context link="event_def" field="owner"/>
1445                 </create>
1446                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1447                     <context link="event_def" field="owner"/>
1448                 </retrieve>
1449                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1450                     <context link="event_def" field="owner"/>
1451                 </update>
1452                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1453                     <context link="event_def" field="owner"/>
1454                 </delete>
1455                         </actions>
1456                 </permacrud>
1457         </class>
1458
1459         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1460                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1461                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1462                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1463                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1464                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1467                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1468                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1469                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1471                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1473                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1474                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1475                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1477                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1478                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1479                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1480                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1481                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1482                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1483                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1485                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1486                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1489                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1490                 </fields>
1491                 <links>
1492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1493                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1494                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1495                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1496                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1498                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1499                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1500                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1501                 </links>
1502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503                         <actions>
1504                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                         </actions>
1509                 </permacrud>
1510         </class>
1511
1512     <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1513         <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1514             <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1515             <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1516             <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1517             <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1518             <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1519             <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1520             <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1521         </fields>
1522         <links>
1523             <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1524             <link field="locale" relteype="has_a" key="code" map="" class="i18n_l"/>
1525          </links>
1526          <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1527              <actions>
1528                  <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1529                      <context link="event_def" field="owner"/>
1530                  </create>
1531                  <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1532                      <context link="event_def" field="owner"/>
1533                  </retrieve>
1534                  <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1535                      <context link="event_def" field="owner"/>
1536                  </update>
1537                  <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1538                      <context link="event_def" field="owner"/>
1539                  </delete>
1540             </actions>
1541         </permacrud>
1542     </class>
1543
1544
1545         <class id="atevdefg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group" oils_persist:tablename="action_trigger.event_def_group" reporter:label="Trigger Event Definition Group" oils_persist:restrict_primary="100">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1547                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1549                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1550                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1551                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1552                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1553                 </fields>
1554                 <links>
1555                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1556                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1557                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1558                 </links>
1559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560                         <actions>
1561                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1562                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1563                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1564                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1565                         </actions>
1566                 </permacrud>
1567         </class>
1568
1569         <class id="atevdefgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group_member" oils_persist:tablename="action_trigger.event_def_group_member" reporter:label="Trigger Event Definition Group Member">
1570                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1572                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1573                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1574                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1575                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1576                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1577                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1578                 </fields>
1579                 <links>
1580                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1581                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1582                 </links>
1583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1584                         <actions>
1585                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1586                     <context link="grp" field="owner"/>
1587                 </create>
1588                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1589                     <context link="grp" field="owner"/>
1590                 </retrieve>
1591                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1592                     <context link="grp" field="owner"/>
1593                 </update>
1594                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1595                     <context link="grp" field="owner"/>
1596                 </delete>
1597                         </actions>
1598                 </permacrud>
1599         </class>
1600
1601         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1602                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1603                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1604                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1605                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1606                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1607                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1608                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1609                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1610                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1611                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1612                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1613                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1614                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1615                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1616                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1617                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1618                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1619                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1620                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1621                 </fields>
1622                 <links>
1623                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1624                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1625                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1626                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1627                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1628                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1629                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1630                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1631                 </links>
1632         </class>
1633
1634         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1635                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1636                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1637                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1638                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1639                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1640                 </fields>
1641                 <links>
1642                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1643                 </links>
1644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1645                         <actions>
1646                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1647                     <context link="event_def" field="owner"/>
1648                 </create>
1649                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1650                     <context link="event_def" field="owner"/>
1651                 </retrieve>
1652                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1653                     <context link="event_def" field="owner"/>
1654                 </update>
1655                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1656                     <context link="event_def" field="owner"/>
1657                 </delete>
1658                         </actions>
1659                 </permacrud>
1660         </class>
1661
1662         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1663                 <oils_persist:source_definition><![CDATA[
1664                 SELECT  atevdef.hook,
1665                         atevdef.name,
1666                         atevdef.reactor,
1667                         atev.id,
1668                         atev.event_def,
1669                         atev.add_time,
1670                         atev.run_time,
1671                         atev.start_time,
1672                         atev.update_time,
1673                         atev.complete_time,
1674                         atev.update_process,
1675                         atev.state,
1676                         atev.user_data,
1677                         atev.template_output,
1678                         atev.error_output,
1679                         atev.async_output,
1680                         targ_circ.id AS target_circ,
1681                         targ_ahr.id AS target_hold,
1682                         COALESCE(
1683                                 targ_circ.circ_lib,
1684                                 targ_ahr.pickup_lib
1685                         ) AS perm_lib
1686                 FROM action_trigger.event atev
1687                 JOIN action_trigger.event_definition atevdef ON
1688                         (atevdef.id = atev.event_def)
1689                 JOIN action_trigger.hook ath ON
1690                         (ath.key = atevdef.hook)
1691                 LEFT JOIN action.circulation targ_circ ON
1692                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1693                 LEFT JOIN action.hold_request targ_ahr ON
1694                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1695                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1696                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1697                                 'circ.staff.max_visible_event_age',
1698                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1699                         ) UNION
1700                         SELECT '1000 YEARS'::INTERVAL AS value
1701                 ) ous)
1702                 ]]></oils_persist:source_definition>
1703                 <fields oils_persist:primary="id">
1704                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1705                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1706                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1707                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1708                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1709                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1710                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1711                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1712                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1713                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1714                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1715                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1716                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1717                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1718                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1719                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1720                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1721                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1722                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1723                 </fields>
1724                 <links>
1725                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1726                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1727                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1728                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1729                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1730                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1731                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1732                 </links>
1733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1734                         <actions>
1735                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1736                         </actions>
1737                 </permacrud>
1738         </class>
1739
1740         <class id="atoul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::optimized_user_log" reporter:label="Action Trigger Optimized User Log" oils_persist:readonly="true">
1741                 <oils_persist:source_definition><![CDATA[
1742                 SELECT  atevdef.hook,
1743                         atevdef.name,
1744                         atevdef.reactor,
1745                         atev.id,
1746                         atev.event_def,
1747                         atev.add_time,
1748                         atev.run_time,
1749                         atev.start_time,
1750                         atev.update_time,
1751                         atev.complete_time,
1752                         atev.update_process,
1753                         atev.state,
1754                         atev.user_data,
1755                         atev.template_output,
1756                         atev.error_output,
1757                         atev.async_output,
1758             atev.target,
1759                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1760                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1761             atev.context_user,
1762                         atev.context_library,
1763             atev.context_bib,
1764             atev.context_item,
1765             rssr.title,
1766             rssr.author
1767                 FROM action_trigger.event atev
1768                 JOIN action_trigger.event_definition atevdef ON
1769                         (atevdef.id = atev.event_def)
1770                 JOIN action_trigger.hook ath ON
1771                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1772         LEFT JOIN reporter.super_simple_record rssr ON
1773             (atev.context_bib = rssr.id)
1774                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1775                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1776                                 'circ.staff.max_visible_event_age',
1777                                 atev.context_library
1778                         ) UNION
1779                         SELECT '1000 YEARS'::INTERVAL AS value
1780                 ) ous)
1781                 ]]></oils_persist:source_definition>
1782                 <fields oils_persist:primary="id">
1783                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1785                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1786                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1787                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1788                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1789                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1790                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1791                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1792                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1793                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1794                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1795                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1796                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1797                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1798                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1799                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1800                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1801                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1802                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1803                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1804                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1805                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1806                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1807                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1808                 </fields>
1809                 <links>
1810                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1811                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1812                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1813                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1814                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1815                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1816                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1817                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1818                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1819                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1820                 </links>
1821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1822                         <actions>
1823                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1824                         </actions>
1825                 </permacrud>
1826         </class>
1827
1828         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1829                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1830                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1831                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1832                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1833                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1834                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1835                 </fields>
1836                 <links>
1837                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1838                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1839                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1840                 </links>
1841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1842                         <actions>
1843                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1844                         </actions>
1845                 </permacrud>
1846         </class>
1847
1848         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1849                 <fields oils_persist:primary="code">
1850                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1851                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1852                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1853                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1854                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1855                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1863                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1871                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1872                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1873                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1874                 </fields>
1875                 <links/>
1876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1877             <actions>
1878                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1879                 <retrieve/>
1880                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1881                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1882             </actions>
1883         </permacrud>
1884         </class>
1885
1886         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1887                 <fields oils_persist:primary="code">
1888                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1889                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1890                 </fields>
1891                 <links/>
1892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1893             <actions>
1894                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1895                 <retrieve/>
1896                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1897                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1898             </actions>
1899         </permacrud>
1900         </class>
1901
1902         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1903                 <fields oils_persist:primary="code">
1904                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1905                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1906                 </fields>
1907                 <links/>
1908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1909             <actions>
1910                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1913                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1914             </actions>
1915         </permacrud>
1916         </class>
1917
1918         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1919                 <fields oils_persist:primary="code">
1920                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1921                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1922                 </fields>
1923                 <links/>
1924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1925             <actions>
1926                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1927                 <retrieve/>
1928                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1929                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1930             </actions>
1931         </permacrud>
1932         </class>
1933
1934         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1935                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1936                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1937                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1938                 </fields>
1939                 <links/>
1940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1941             <actions>
1942                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1943                 <retrieve/>
1944                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1945                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1946             </actions>
1947         </permacrud>
1948         </class>
1949
1950         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1951                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1952                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1953                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1954                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1955                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1956                 </fields>
1957         <links>
1958             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1959             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1960             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1961         </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="UPDATE_COPY">
1965                     <context link="target_copy" field="circ_lib"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="UPDATE_COPY">
1969                     <context link="target_copy" field="circ_lib"/>
1970                 </update>
1971                 <delete permission="UPDATE_COPY">
1972                     <context link="target_copy" field="circ_lib"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977
1978         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1979                 <fields oils_persist:primary="code">
1980                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1981                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1982                 </fields>
1983                 <links/>
1984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1985             <actions>
1986                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1987                 <retrieve/>
1988                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1989                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1990             </actions>
1991         </permacrud>
1992         </class>
1993
1994         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1995                 <fields oils_persist:primary="code">
1996                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1997                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1998                 </fields>
1999                 <links/>
2000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2001             <actions>
2002                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
2003                 <retrieve/>
2004                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
2005                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
2006             </actions>
2007         </permacrud>
2008         </class>
2009
2010         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
2011                 <fields oils_persist:primary="code">
2012                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
2013                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2014                 </fields>
2015                 <links/>
2016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2017             <actions>
2018                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2019                 <retrieve/>
2020                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2021                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2022             </actions>
2023         </permacrud>
2024         </class>
2025
2026     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
2027         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
2028             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2029             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2030             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
2031             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
2032             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
2033             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2034             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2035             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2036             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2037             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2038             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2039             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2040             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2041             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2042             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2043             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2044             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2045         </fields>
2046         <links/>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2050                 <retrieve/>
2051                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2052                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
2058         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2059             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2060             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2061             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2062             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2063             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2064             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2065             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2066             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2067             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2068             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2069             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2070             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2071             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2072             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2073             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2074             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2075             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2076             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2077             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2078         </fields>
2079         <links/>
2080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2081             <actions>
2082                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2083                 <retrieve/>
2084                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2085                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2086             </actions>
2087         </permacrud>
2088     </class>
2089
2090     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
2091         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2092             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2093             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2094             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2095             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2096             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2097         </fields>
2098         <links>
2099             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2100             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2101             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2102         </links>
2103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2104             <actions>
2105                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2106                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2107                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2108                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2109             </actions>
2110         </permacrud>
2111     </class>
2112
2113         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
2114                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2115                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2116                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2117                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2118                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2120                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2121                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2122                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2123                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2124                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2125                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2127                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2128                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2129                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2130                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2131             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2132                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2133                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2134                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2135                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2136                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2137                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2138                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2139                 </fields>
2140                 <links>
2141                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2142                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2147                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2149                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2150                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2151                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2152                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2153                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2154             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2155                 </links>
2156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2157             <actions>
2158                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2159                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162             </actions>
2163         </permacrud>
2164         </class>
2165
2166         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
2167                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2168                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2169                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2170                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2172                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2173                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2175                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2176                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2177                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2178                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2183             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2184                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2185                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2186             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2187                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2188                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2189                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2191             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2192             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2193             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2194                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2195                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2196                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2197                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2198                         <field name="renew_extends_due_date" reporter:datatype="bool" reporter:label="Early Renewal Extends Due Date"/>
2199                         <field name="renew_extend_min_interval" reporter:datatype="interval" reporter:label="Early Renewal Minimum Duration Interval"/>
2200                 </fields>
2201                 <links>
2202                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2205                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2206                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2207                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2208                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2209                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2210                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2211                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2212                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2213                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2214                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2215                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2216             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2217                 </links>
2218         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2219             <actions>
2220                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2223                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2224             </actions>
2225         </permacrud>
2226         </class>
2227
2228     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
2229         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2230             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2231             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2232             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2233         </fields>
2234         <links/>
2235         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2236             <actions>
2237                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <retrieve/>
2239                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2240                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2241             </actions>
2242         </permacrud>
2243     </class>
2244
2245     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
2246         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2247             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2248             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2249             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2250             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2251             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2252             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2253             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2254         </fields>
2255         <links>
2256             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2257         </links>
2258         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2259             <actions>
2260                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <retrieve/>
2262                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2263                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2264             </actions>
2265         </permacrud>
2266     </class>
2267
2268     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2269         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2270             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2271             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2272             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2273             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2274             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2275         </fields>
2276         <links>
2277             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2278             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2279         </links>
2280         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2281             <actions>
2282                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2283                     <context link="matchpoint" field="org_unit"/>
2284                 </create>
2285                 <retrieve/>
2286                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2287                     <context link="matchpoint" field="org_unit"/>
2288                 </update>
2289                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2290                     <context link="matchpoint" field="org_unit"/>
2291                 </delete>
2292             </actions>
2293         </permacrud>
2294     </class>
2295
2296     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2297         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2298             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2299             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2300             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2301         </fields>
2302         <links>
2303             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2304             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2305         </links>
2306         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2307             <actions>
2308                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2309                     <context link="limit_set" field="owning_lib"/>
2310                 </create>
2311                 <retrieve/>
2312                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2313                     <context link="limit_set" field="owning_lib"/>
2314                 </update>
2315                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2316                     <context link="limit_set" field="owning_lib"/>
2317                 </delete>
2318             </actions>
2319         </permacrud>
2320     </class>
2321     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2322         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2323             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2324             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2325             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2326         </fields>
2327         <links>
2328             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2329             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2330         </links>
2331         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2332             <actions>
2333                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2334                     <context link="limit_set" field="owning_lib"/>
2335                 </create>
2336                 <retrieve/>
2337                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2338                     <context link="limit_set" field="owning_lib"/>
2339                 </update>
2340                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2341                     <context link="limit_set" field="owning_lib"/>
2342                 </delete>
2343             </actions>
2344         </permacrud>
2345     </class>
2346
2347     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2348         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2349             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2350             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2351             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2352             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2353         </fields>
2354         <links>
2355             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2356             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2357         </links>
2358         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2359             <actions>
2360                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2361                     <context link="limit_set" field="owning_lib"/>
2362                 </create>
2363                 <retrieve/>
2364                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2365                     <context link="limit_set" field="owning_lib"/>
2366                 </update>
2367                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2368                     <context link="limit_set" field="owning_lib"/>
2369                 </delete>
2370             </actions>
2371         </permacrud>
2372     </class>
2373
2374         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2375                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2376                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2377                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2378                 </fields>
2379                 <links/>
2380         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2381             <actions>
2382                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <retrieve/>
2384                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2385                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2386             </actions>
2387         </permacrud>
2388         </class>
2389
2390         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2391                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2392                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2393                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2394                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2395                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2396                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2397                 </fields>
2398                 <links>
2399                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2400                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2401                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2402                 </links>
2403         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2404             <actions>
2405                 <create permission="ADMIN_SURVEY">
2406                     <context link="survey" field="owner"/>
2407                 </create>
2408                 <retrieve/>
2409                 <update permission="ADMIN_SURVEY">
2410                     <context link="survey" field="owner"/>
2411                 </update>
2412                 <delete permission="ADMIN_SURVEY">
2413                     <context link="survey" field="owner"/>
2414                 </delete>
2415             </actions>
2416         </permacrud>
2417         </class>
2418         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2419                 <fields oils_persist:primary="id" oils_persist:sequence="">
2420                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2421                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2422                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2423                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2424                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2425                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2426                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2427                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2428                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2429                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2430                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2431                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2432                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2433                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2434                 </fields>
2435                 <links>
2436                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2437                 </links>
2438                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2439                         <actions>
2440                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2441                                         <context link="usr" field="home_ou" />
2442                                 </retrieve>
2443                         </actions>
2444                 </permacrud>
2445         </class>
2446         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2447                 <fields oils_persist:primary="id" oils_persist:sequence="">
2448                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2449                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2450                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2451                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2452                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2453                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2454                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2455                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2456                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2457                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2458                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2459                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2460                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2461                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2462                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2463                 </fields>
2464                 <links>
2465                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2466                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2467                 </links>
2468         </class>
2469         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2470                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2471                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2472                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2474                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2475                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2476                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2477                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2478                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2479                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2480                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2481                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2482                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2483                 </fields>
2484                 <links>
2485                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2486                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2487                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2488                 </links>
2489                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2490                         <actions> <!-- created magically, so no create action -->
2491                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2492                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2493                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2494                         </actions>
2495                 </permacrud>
2496         </class>
2497         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2498                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2499                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2500                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2501                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2502                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2503                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2504                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2505                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2506                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2507                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2508                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2509                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2510                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2511                 </fields>
2512                 <links>
2513                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2514                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2515                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2516                 </links>
2517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2518                         <actions> <!-- created magically, so no create action -->
2519                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2520                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2521                         </actions>
2522                 </permacrud>
2523         </class>
2524         <class id="aump" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_penalty" oils_persist:tablename="actor.usr_message_penalty" reporter:label="User Message Penalty">
2525         <fields oils_persist:primary="id">
2526                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2527                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2530                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2531                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2533                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2534                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2535                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2536                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2537                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2538                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2539                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2540                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2541                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2542                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2543                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2545                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2546                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2547                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2548                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2549                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2550                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2551                 </fields>
2552                 <links>
2553                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2554                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2555                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2559                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2560                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2562                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2563                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2564                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2565                 </links>
2566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2567                         <actions> <!-- created magically, so no create action -->
2568                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2569                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2570                         </actions>
2571                 </permacrud>
2572         </class>
2573
2574         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2575                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2576                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2577                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2578                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2579                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2580                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2581                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2582                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2583                 </fields>
2584                 <links>
2585                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2586                 </links>
2587                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2588                         <actions>
2589                                 <create permission="UPDATE_USER">
2590                                         <context link="usr" field="home_ou"/>
2591                                 </create>
2592                                 <retrieve permission="VIEW_USER">
2593                                         <context link="usr" field="home_ou"/>
2594                                 </retrieve>
2595                                 <update permission="UPDATE_USER">
2596                                         <context link="usr" field="home_ou"/>
2597                                 </update>
2598                                 <delete permission="UPDATE_USER">
2599                                         <context link="usr" field="home_ou"/>
2600                                 </delete>
2601                         </actions>
2602                 </permacrud>
2603         </class>
2604         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2605                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2606                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2607                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2608                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2609                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2610                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2611                 </fields>
2612                 <links>
2613                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2614                 </links>
2615         </class>
2616         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2617                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2618                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2619                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2620                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2621                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2622                 </fields>
2623                 <links>
2624                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2625                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2626                 </links>
2627                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2628                         <actions>
2629                                 <retrieve permission="VIEW_USER">
2630                                         <context link="usr" field="home_ou" />
2631                                 </retrieve>
2632                         </actions>
2633                 </permacrud>
2634         </class>
2635         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2636                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2637                         <field name="field" reporter:datatype="link"/>
2638                         <field name="id" reporter:datatype="id" />
2639                         <field name="source" reporter:datatype="link"/>
2640                         <field name="value" reporter:datatype="text"/>
2641                 </fields>
2642                 <links>
2643                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2644                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2645                 </links>
2646         </class>
2647         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2648                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2649                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2650                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2651                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2652                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2653                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2654                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2655                 </fields>
2656                 <links>
2657                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2658                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2659                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2660                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2661                 </links>
2662                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2663                         <actions>
2664                                 <retrieve/>
2665                         </actions>
2666                 </permacrud>
2667         </class>
2668         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2669                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2670                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2671                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2672                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2673                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2674                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2675                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2676                 </fields>
2677                 <links>
2678                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2679                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2680                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2681                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2682                 </links>
2683                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2684                         <actions>
2685                                 <retrieve/>
2686                         </actions>
2687                 </permacrud>
2688         </class>
2689         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2690                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2691                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2692                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2693                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2694                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2695                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2696                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2697                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2698                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2699                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2701                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2702                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2703                 </fields>
2704                 <links>
2705                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2706                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2707                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2709                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2710                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2711                 </links>
2712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2713             <actions>
2714                 <create permission="TRANSIT_COPY" context_field="owner">
2715                     <context link="target_copy" field="circ_lib"/>
2716                 </create>
2717                 <retrieve/>
2718                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2719                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2720             </actions>
2721         </permacrud>
2722         </class>
2723         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2724                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2725                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2726                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2727                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2728                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2729                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2730                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2731                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2732                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2733                 </fields>
2734                 <links>
2735                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2736                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2737                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2738                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2739                 </links>
2740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2741             <actions>
2742                 <create permission="ADMIN_SURVEY">
2743                     <context link="survey" field="owner"/>
2744                 </create>
2745                 <retrieve permission="VIEW_USER">
2746                     <context link="usr" field="home_ou"/>
2747                 </retrieve>
2748                 <update permission="ADMIN_SURVEY">
2749                     <context link="survey" field="owner"/>
2750                 </update>
2751                 <delete permission="ADMIN_SURVEY">
2752                     <context link="survey" field="owner"/>
2753                 </delete>
2754             </actions>
2755         </permacrud>
2756         </class>
2757         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2758                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2759                         <field name="bucket" reporter:datatype="link"/>
2760                         <field name="id" reporter:datatype="id" />
2761                         <field name="target_copy" reporter:datatype="link"/>
2762                         <field name="create_time" reporter:datatype="timestamp" />
2763                         <field name="pos" reporter:datatype="int" />
2764                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2765                 </fields>
2766                 <links>
2767                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2768                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2769             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2770                 </links>
2771                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2772                         <actions>
2773                                 <retrieve permission="ADMIN_COPY_BUCKET">
2774                     <context link="bucket" field="owning_lib"/>
2775                 </retrieve>
2776             </actions>
2777         </permacrud>
2778         </class>
2779         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2780                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2781                         <field name="id" reporter:datatype="id" />
2782                         <field name="item" reporter:datatype="link"/>
2783                         <field name="note" reporter:datatype="text" />
2784                 </fields>
2785                 <links>
2786                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2787                 </links>
2788         </class>
2789
2790         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2791                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2792                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2793                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2794                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2795                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2796                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2797                 </fields>
2798                 <links>
2799                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2800                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2801                 </links>
2802                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2803                         <actions>
2804                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <retrieve/>
2806                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2807                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2808                         </actions>
2809                 </permacrud>
2810         </class>
2811
2812         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2813                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2814                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2815                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2816                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2817                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2818                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2819                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2820                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2821                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2822                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2823                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2824                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2827                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2828                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2829                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2830                 </fields>
2831                 <links>
2832                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2833                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2834                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2835                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2836                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2837                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2838                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2839                 </links>
2840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2841                         <actions>
2842                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <retrieve/>
2844                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2845                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2846                         </actions>
2847                 </permacrud>
2848         </class>
2849
2850         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2851                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2852                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2853                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2854                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2855                 </fields>
2856                 <links>
2857                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2858                 </links>
2859                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2860                         <actions>
2861                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <retrieve/>
2863                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2864                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2865                         </actions>
2866                 </permacrud>
2867         </class>
2868
2869         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2870                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2871                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2872                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2873                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2874                 </fields>
2875                 <links>
2876                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2877                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2878                 </links>
2879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2880                         <actions>
2881                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <retrieve/>
2883                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2884                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2885                         </actions>
2886                 </permacrud>
2887         </class>
2888
2889         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2890                 <fields oils_persist:primary="code">
2891                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2892                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2893                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2894                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2895                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2896                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2897                 </fields>
2898                 <links>
2899                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2900                 </links>
2901                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2902                         <actions>
2903                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <retrieve/>
2905                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2906                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2907                         </actions>
2908                 </permacrud>
2909         </class>
2910
2911         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2912                 <fields oils_persist:primary="code">
2913                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2914                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2915                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2916                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2917                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2918                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2919                 </fields>
2920                 <links>
2921                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2922                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2923                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2924                 </links>
2925                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2926                         <actions>
2927                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <retrieve/>
2929                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2930                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2931                         </actions>
2932                 </permacrud>
2933         </class>
2934
2935     <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2936         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2937             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2938             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2939             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2940         </fields>
2941         <links>
2942             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2943             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2944         </links>
2945         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2946             <actions>
2947                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <retrieve/>
2949                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2950                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2951             </actions>
2952         </permacrud>
2953     </class>
2954
2955         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2956                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2957                         <field name="active" reporter:datatype="bool"/>
2958                         <field name="create_date" reporter:datatype="timestamp"/>
2959                         <field name="creator" />
2960                         <field name="deleted" reporter:datatype="bool"/>
2961                         <field name="edit_date" reporter:datatype="timestamp"/>
2962                         <field name="editor" />
2963                         <field name="id" reporter:datatype="id" />
2964                         <field name="last_xact_id" />
2965                         <field name="marc" />
2966                         <field name="source" />
2967                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2968                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2969                         <field name="heading" />
2970                         <field name="simple_heading" />
2971                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2972                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2973                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2974                 </fields>
2975                 <links>
2976                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2977                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2978                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2979                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2980                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2981                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2982                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2983                 </links>
2984                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2985                         <actions>
2986                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2987                                 <retrieve/>
2988                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2989                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2990                         </actions>
2991                 </permacrud>
2992         </class>
2993         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2994                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2995                         <field name="char_encoding" />
2996                         <field name="id" />
2997                         <field name="record" />
2998                         <field name="record_status" />
2999                         <field name="thesaurus" />
3000                 </fields>
3001                 <links>
3002                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3003                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3004                 </links>
3005         </class>
3006         <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
3007                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3008                         <field name="id" reporter:datatype="id" />
3009                         <field name="bib" reporter:datatype="link" />
3010                         <field name="authority" reporter:datatype="link" />
3011                 </fields>
3012                 <links>
3013                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3014                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3015                 </links>
3016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3017                         <actions>
3018                                 <retrieve/>
3019                         </actions>
3020                 </permacrud>
3021         </class>
3022         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3023                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3024                         <field name="id" reporter:datatype="id" />
3025                         <field name="record" reporter:datatype="link" />
3026                         <field name="atag" reporter:datatype="link" />
3027                         <field name="value" reporter:datatype="text" />
3028                         <field name="thesaurus" reporter:datatype="text" />
3029                 </fields>
3030                 <links>
3031                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3032                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3033                 </links>
3034         </class>
3035
3036         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
3037                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3038                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3039                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3040                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3041                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3042                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3043                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3044                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3045                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3046                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3047                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3048                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3049                 </fields>
3050                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3051                         <actions>
3052                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <retrieve/>
3054                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3055                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3056                         </actions>
3057                 </permacrud>
3058         </class>
3059
3060         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
3061                 <fields oils_persist:primary="code" oils_persist:sequence="">
3062                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3063                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3064                 </fields>
3065                 <links/>
3066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3067             <actions>
3068                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3069                 <retrieve/>
3070                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3071                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3072             </actions>
3073         </permacrud>
3074         </class>
3075         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
3076                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3077                         <field name="accepting_usr" />
3078                         <field name="amount" reporter:datatype="money" />
3079                         <field name="amount_collected" reporter:datatype="money" />
3080                         <field name="approval_code" reporter:datatype="text"/>
3081                         <field name="cash_drawer" reporter:datatype="link"/>
3082                         <field name="cc_number" reporter:datatype="text"/>
3083                         <field name="cc_order_number" reporter:datatype="text"/>
3084                         <field name="cc_processor" reporter:datatype="text"/>
3085                         <field name="id" reporter:datatype="id" />
3086                         <field name="note" reporter:datatype="text"/>
3087                         <field name="payment_ts" reporter:datatype="timestamp"/>
3088                         <field name="xact" reporter:datatype="link"/>
3089                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3090                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3091                 </fields>
3092                 <links>
3093                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3094                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3095                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3096                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3097                 </links>
3098         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3099             <actions>
3100                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3101                     <context link="xact" jump="usr" field="home_ou"/>
3102                 </retrieve>
3103                         </actions>
3104                 </permacrud>
3105         </class>
3106         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition" oils_persist:field_safe="true">
3107                 <fields oils_persist:primary="name">
3108                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3109                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3110                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3111                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3112                 </fields>
3113                 <links/>
3114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3115             <actions>
3116                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3117                 <retrieve/>
3118                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3119                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3120             </actions>
3121         </permacrud>
3122         </class>
3123
3124         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
3125                 <fields oils_persist:primary="alias">
3126                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3127                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3128                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3129                 </fields>
3130                 <links>
3131                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3132                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3133                 </links>
3134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3135             <actions>
3136                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <retrieve/>
3138                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3139                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3140             </actions>
3141         </permacrud>
3142         </class>
3143
3144         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
3145                 <fields oils_persist:primary="name">
3146                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3147                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3148                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3149                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3150                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3151                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3152                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3153                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3154                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3155                         <field reporter:label="Low Result Threshold for Suggestions" name="low_result_threshold" reporter:datatype="int" />
3156                         <field reporter:label="Max Suggestions" name="max_suggestions" reporter:datatype="int" />
3157                         <field reporter:label="Perform Variant Heading Authority Suggestion Cross-reference" name="variant_authority_suggestion" reporter:datatype="bool" />
3158                         <field reporter:label="Minimum Bib Record Suggestion Threshold" name="min_suggestion_use_threshold" reporter:datatype="int" />
3159                         <field reporter:label="Suggestion SOUNDEX Weight" name="soundex_weight" reporter:datatype="int" />
3160                         <field reporter:label="Suggestion PG Trigram Weight" name="pg_trgm_weight" reporter:datatype="int" />
3161                         <field reporter:label="Suggestion Keyboard Distance Weight" name="keyboard_distance_weight" reporter:datatype="int" />
3162                         <field reporter:label="Retain Case in Suggestions" name="symspell_transfer_case" reporter:datatype="bool" />
3163                         <field reporter:label="Avoid alternate suggestions on correctly spelled words" name="symspell_skip_correct" reporter:datatype="bool" />
3164                         <field reporter:label="Symspell suggestion calculation verbosity" name="symspell_suggestion_verbosity" reporter:datatype="int" />
3165                         <field reporter:label="Maximum average word Edit Distance" name="max_phrase_edit_distance" reporter:datatype="int" />
3166                         <field reporter:label="Maximum suggestions per word" name="suggestion_word_option_count" reporter:datatype="int" />
3167                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3168                 </fields>
3169                 <links>
3170                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3171                 </links>
3172         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3173             <actions>
3174                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3175                 <retrieve/>
3176                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3177                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3178             </actions>
3179         </permacrud>
3180         </class>
3181
3182         <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">
3183                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3184                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3185                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3186                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3187                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3188                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3189                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3190                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3191                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3192                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3193                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3194                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3195                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3196                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3197                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3198                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3199                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3200                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3201                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3202                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3203                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3204                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3205                 </fields>
3206                 <links>
3207                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3208                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3209                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3210                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3211                 </links>
3212         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3213             <actions>
3214                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3215                 <retrieve/>
3216                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3217                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3218             </actions>
3219         </permacrud>
3220         </class>
3221
3222         <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">
3223                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3224                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3225                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3226                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3227                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3228                 </fields>
3229                 <links>
3230                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3231                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3232                 </links>
3233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3234             <actions>
3235                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3236                 <retrieve/>
3237                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3238                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3239             </actions>
3240         </permacrud>
3241         </class>
3242
3243         <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">
3244                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3245                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3246                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3247                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3248                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3249                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3250                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3251                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3252                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3253                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3254                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3255                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3256                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3257                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3258                 </fields>
3259                 <links>
3260                 </links>
3261                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3262                         <actions>
3263                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3264                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3265                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3266                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3267                         </actions>
3268                 </permacrud>
3269         </class>
3270         <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">
3271                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3272                         <field name="id" reporter:datatype="id" />
3273                         <field name="name" reporter:datatype="text"/>
3274                         <field name="xpath" reporter:datatype="text"/>
3275                         <field name="format" reporter:datatype="link"/>
3276                         <field name="first_word" reporter:datatype="bool" />
3277                 </fields>
3278                 <links/>
3279         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3280             <actions>
3281                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3282                 <retrieve/>
3283                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3284                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3285             </actions>
3286         </permacrud>
3287         </class>
3288         <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">
3289                 <fields oils_persist:primary="code" oils_persist:sequence="">
3290                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3291                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3292                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3293                 </fields>
3294                 <links/>
3295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3296             <actions>
3297                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3298                 <retrieve/>
3299                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3300                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3301             </actions>
3302         </permacrud>
3303         </class>
3304         <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">
3305                 <fields oils_persist:primary="code" oils_persist:sequence="">
3306                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3307                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3308                 </fields>
3309                 <links/>
3310         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3311             <actions>
3312                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3313                 <retrieve/>
3314                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3315                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3316             </actions>
3317         </permacrud>
3318         </class>
3319     <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">
3320         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3321             <field reporter:label="ID" name="id" reporter:datatype="id" />
3322             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3323             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3324             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3325             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3326             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3327             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3328             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3329                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3330         </fields>
3331         <links>
3332             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3333             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3334             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3335                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3336         </links>
3337         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3338             <actions>
3339                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3340                 <retrieve/>
3341                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3342                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3343             </actions>
3344         </permacrud>
3345     </class>
3346     <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">
3347         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3348             <field reporter:label="ID" name="id" reporter:datatype="id" />
3349             <field reporter:label="Course" name="course" reporter:datatype="link" />
3350             <field reporter:label="User" name="usr" reporter:datatype="link" />
3351             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3352         </fields>
3353         <links>
3354             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3355             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3356             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3357         </links>
3358         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3359             <actions>
3360                 <create permission="MANAGE_RESERVES">
3361                                         <context link="course" field="owning_lib" />
3362                 </create>
3363                 <retrieve/>
3364                 <update permission="MANAGE_RESERVES">
3365                                         <context link="course" field="owning_lib" />
3366                 </update>
3367                 <delete permission="MANAGE_RESERVES">
3368                                         <context link="course" field="owning_lib" />
3369                 </delete>
3370             </actions>
3371         </permacrud>
3372     </class>
3373     <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">
3374         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3375             <field reporter:label="ID" name="id" reporter:datatype="id" />
3376             <field reporter:label="Course" name="course" reporter:datatype="link" />
3377             <field reporter:label="Item" name="item" reporter:datatype="link" />
3378             <field reporter:label="Record" name="record" reporter:datatype="link" />
3379             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3380             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3381             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3382             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3383             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3384             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3385             <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link" />
3386         </fields>
3387         <links>
3388             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3389             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3390             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3391             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3392             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3393             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3394             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3395             <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou" />
3396         </links>
3397         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3398             <actions>
3399                 <create permission="MANAGE_RESERVES">
3400                                         <context link="course" field="owning_lib" />
3401                 </create>
3402                 <retrieve/>
3403                 <update permission="MANAGE_RESERVES">
3404                                         <context link="course" field="owning_lib" />
3405                 </update>
3406                 <delete permission="MANAGE_RESERVES">
3407                                         <context link="course" field="owning_lib" />
3408                 </delete>
3409             </actions>
3410         </permacrud>
3411     </class>
3412         <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">
3413                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3414                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3415                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3416             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3417                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3418                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3419                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3420                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3421                 </fields>
3422                 <links>
3423             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3424                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3425                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3426                 </links>
3427                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3428                         <actions>
3429                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3430                                 <retrieve/>
3431                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3432                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3433                         </actions>
3434                 </permacrud>
3435         </class>
3436     <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">
3437         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3438             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3439             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3440             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3441         </fields>
3442         <links>
3443             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3444             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3445         </links>
3446         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3447             <actions>
3448                 <create permission="MANAGE_RESERVES">
3449                                         <context link="course" field="owning_lib" />
3450                 </create>
3451                 <retrieve/>
3452                 <update permission="MANAGE_RESERVES">
3453                                         <context link="course" field="owning_lib" />
3454                 </update>
3455                 <delete permission="MANAGE_RESERVES">
3456                                         <context link="course" field="owning_lib" />
3457                 </delete>
3458             </actions>
3459         </permacrud>
3460     </class>
3461         <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">
3462                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3463                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3464                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3465             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3466                 </fields>
3467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3468                         <actions>
3469                                 <create permission="MANAGE_RESERVES" global_required="true" />
3470                                 <retrieve/>
3471                                 <update permission="MANAGE_RESERVES" global_required="true" />
3472                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3473                         </actions>
3474                 </permacrud>
3475         </class>
3476         
3477     <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">
3478         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3479             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3480             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3481             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3482             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3483         </fields>
3484         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3485             <actions>
3486                 <retrieve/>
3487             </actions>
3488         </permacrud>
3489     </class>
3490         <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">
3491                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3492                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3493                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3494                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3495                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3496                 </fields>
3497                 <links>
3498                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3499                 </links>
3500         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3501             <actions>
3502                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3503                 <retrieve/>
3504                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3505                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3506             </actions>
3507         </permacrud>
3508         </class>
3509         <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">
3510                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3511                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3512                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3513                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3514                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3515                 </fields>
3516                 <links>
3517                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3518                 </links>
3519         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3520             <actions>
3521                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3522                 <retrieve/>
3523                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3524                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3525             </actions>
3526         </permacrud>
3527         </class>
3528         <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">
3529                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3530                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3531                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3532                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3533                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3534                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3535                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3536                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3537                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3538                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3539                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3540                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3541                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3542                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3543                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3544                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3545                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3546                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3547                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3548                 </fields>
3549                 <links>
3550                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3551                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3552                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3553                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3554                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3555                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3556                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3557                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3558                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3559                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3560                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3561                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3562                 </links>
3563         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3564             <actions>
3565                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3566                 <retrieve/>
3567                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3568                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3569             </actions>
3570         </permacrud>
3571         </class>
3572         <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">
3573                 <fields oils_persist:primary="call_number">
3574                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3575                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3576                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3577                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3578                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3579                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3580                 </fields>
3581                 <links>
3582                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3583                 </links>
3584         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3585             <actions>
3586                 <retrieve/>
3587             </actions>
3588         </permacrud>
3589         </class>
3590         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3591                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3592                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3593                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3594                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3595                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3596                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3597                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3598                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3599                 </fields>
3600                 <links>
3601                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3602                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3603         </links>
3604         </class>
3605         <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">
3606                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3607                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3608                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3609                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3610                 </fields>
3611                 <links>
3612                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3613                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3614                 </links>
3615         </class>
3616         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3617                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3618                         <field name="id" reporter:datatype="id" />
3619                         <field name="value" oils_persist:i18n="true" />
3620                 </fields>
3621                 <links/>
3622         </class>
3623         <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">
3624                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3625                         <field name="balance_owed" reporter:datatype="money" />
3626                         <field name="total_owed" reporter:datatype="money" />
3627                         <field name="total_paid" reporter:datatype="money" />
3628                         <field name="usr" reporter:datatype="link"/>
3629                 </fields>
3630                 <links>
3631                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3632         </links>
3633         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3634             <actions>
3635                 <retrieve permission="VIEW_USER">
3636                     <context link="usr" field="home_ou"/>
3637                 </retrieve>
3638             </actions>
3639         </permacrud>
3640         </class>
3641         <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">
3642                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3643                         <field name="balance_owed" reporter:datatype="money" />
3644                         <field name="total_owed" reporter:datatype="money" />
3645                         <field name="total_paid" reporter:datatype="money" />
3646                         <field name="usr" reporter:datatype="link"/>
3647                 </fields>
3648                 <links>
3649                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3650         </links>
3651         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3652             <actions>
3653                 <retrieve permission="VIEW_USER">
3654                     <context link="usr" field="home_ou"/>
3655                 </retrieve>
3656             </actions>
3657         </permacrud>
3658         </class>
3659         <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">
3660                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3661                         <field name="collector" />
3662                         <field name="enter_time" reporter:datatype="timestamp"/>
3663                         <field name="id" reporter:datatype="id" />
3664                         <field name="location" reporter:datatype="link"/>
3665                         <field name="usr" reporter:datatype="link"/>
3666                 </fields>
3667                 <links>
3668                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3669                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3670                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3671                 </links>
3672         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3673             <actions>
3674                 <create permission="money.collections_tracker.create" context_field="location"/>
3675                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3676                 <delete permission="money.collections_tracker.create" context_field="location"/>
3677             </actions>
3678         </permacrud>
3679         </class>
3680         <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">
3681                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3682                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3683                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3684                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3685                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3686                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3687                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3688                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3689                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3690                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3691                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3692                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3693                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3694                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3695                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3696                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3697                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3698                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3699                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3700                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3704                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3705                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3706                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3707                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3708                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3709                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3710                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3711                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3712                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3713                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3714                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3715                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3716                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3717                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3718                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3719                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3720                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3721                 </fields>
3722                 <links>
3723                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3724                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3725                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3726                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3727                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3728                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3729                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3730                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3731                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3732                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3733                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3734                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3735                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3736                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3737                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3738                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3739                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3740                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3741                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3742                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3743                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3744                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3745                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3746                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3747                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3748                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3749                 </links>
3750         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3751             <actions>
3752                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3753                 <retrieve/>
3754                 <update permission="UPDATE_MARC" global_required="true"/>
3755                 <!-- 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. -->
3756                 <delete permission="DELETE_RECORD" global_required="true"/>
3757             </actions>
3758         </permacrud>
3759         </class>
3760         <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">
3761                 <fields oils_persist:primary="id">
3762                         <field name="dow_0_close" />
3763                         <field name="dow_0_open" />
3764                         <field name="dow_0_note"  reporter:datatype="text" />
3765                         <field name="dow_1_close" />
3766                         <field name="dow_1_open" />
3767                         <field name="dow_1_note"  reporter:datatype="text" />
3768                         <field name="dow_2_close" />
3769                         <field name="dow_2_open" />
3770                         <field name="dow_2_note"  reporter:datatype="text" />
3771                         <field name="dow_3_close" />
3772                         <field name="dow_3_open" />
3773                         <field name="dow_3_note"  reporter:datatype="text" />
3774                         <field name="dow_4_close" />
3775                         <field name="dow_4_open" />
3776                         <field name="dow_4_note"  reporter:datatype="text" />
3777                         <field name="dow_5_close" />
3778                         <field name="dow_5_open" />
3779                         <field name="dow_5_note"  reporter:datatype="text" />
3780                         <field name="dow_6_close" />
3781                         <field name="dow_6_open" />
3782                         <field name="dow_6_note"  reporter:datatype="text" />
3783                         <field name="id" reporter:datatype="id" />
3784                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3785                 </fields>
3786                 <links>
3787                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3788                 </links>
3789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3790             <actions>
3791                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3792                 <retrieve/>
3793                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3794                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3795             </actions>
3796         </permacrud>
3797         </class>
3798         <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">
3799                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3800                         <field name="id" reporter:datatype="id" />
3801                         <field name="record" reporter:datatype="link"/>
3802                         <field name="label" reporter:datatype="text"/>
3803                         <field name="label_sortkey" reporter:datatype="text"/>
3804                         <field name="deleted" reporter:datatype="bool"/>
3805                 </fields>
3806                 <links>
3807                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3808                 </links>
3809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3810             <actions>
3811                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3812                 <retrieve/>
3813                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3814                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3815             </actions>
3816         </permacrud>
3817         </class>
3818         <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">
3819                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3820                         <field name="id" reporter:datatype="id" />
3821                         <field name="target_copy" reporter:datatype="link" />
3822                         <field name="part" reporter:datatype="link"/>
3823                 </fields>
3824                 <links>
3825                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3826                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3827                 </links>
3828         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3829             <actions>
3830                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3831                 <retrieve/>
3832                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3833                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3834             </actions>
3835         </permacrud>
3836         </class>
3837     <class  id="aecc"
3838             controller="open-ils.cstore open-ils.pcrud"
3839             oils_obj:fieldmapper="action::emergency_closing_circulation"
3840             oils_persist:tablename="action.emergency_closing_circulation"
3841             reporter:label="Emergency Closing Circulation Entry"
3842             oils_persist:readonly="true"
3843     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3844         <fields oils_persist:primary="id">
3845             <field name="id" reporter:datatype="id" />
3846             <field name="circulation" reporter:datatype="link" />
3847                         <field name="emergency_closing" reporter:datatype="link"/>
3848             <field name="original_due_date" reporter:datatype="timestamp" />
3849             <field name="process_time" reporter:datatype="timestamp" />
3850         </fields>
3851         <links>
3852             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3853             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3854         </links>
3855         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3856             <actions>
3857                 <retrieve/>
3858             </actions>
3859         </permacrud>
3860     </class>
3861     <class  id="aecr"
3862             controller="open-ils.cstore open-ils.pcrud"
3863             oils_obj:fieldmapper="action::emergency_closing_reservation"
3864             oils_persist:tablename="action.emergency_closing_reservation"
3865             reporter:label="Emergency Closing Reservation Entry"
3866             oils_persist:readonly="true"
3867     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3868         <fields oils_persist:primary="id">
3869             <field name="id" reporter:datatype="id" />
3870             <field name="reservation" reporter:datatype="link" />
3871                         <field name="emergency_closing" reporter:datatype="link"/>
3872             <field name="original_end_time" reporter:datatype="timestamp" />
3873             <field name="process_time" reporter:datatype="timestamp" />
3874         </fields>
3875         <links>
3876             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3877             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3878         </links>
3879         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3880             <actions>
3881                 <retrieve/>
3882             </actions>
3883         </permacrud>
3884     </class>
3885     <class  id="aech"
3886             controller="open-ils.cstore open-ils.pcrud"
3887             oils_obj:fieldmapper="action::emergency_closing_hold"
3888             oils_persist:tablename="action.emergency_closing_hold"
3889             reporter:label="Emergency Closing Hold Entry"
3890             oils_persist:readonly="true"
3891     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3892         <fields oils_persist:primary="id">
3893             <field name="id" reporter:datatype="id" />
3894             <field name="hold" reporter:datatype="link" />
3895                         <field name="emergency_closing" reporter:datatype="link"/>
3896             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3897             <field name="process_time" reporter:datatype="timestamp" />
3898         </fields>
3899         <links>
3900             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3901             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3902         </links>
3903         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3904             <actions>
3905                 <retrieve/>
3906             </actions>
3907         </permacrud>
3908     </class>
3909     <class  id="aecs"
3910             controller="open-ils.cstore open-ils.pcrud"
3911             oils_obj:fieldmapper="action::emergency_closing_status"
3912             oils_persist:tablename="action.emergency_closing_status"
3913             reporter:label="Emergency Closing Status"
3914             oils_persist:readonly="true"
3915     >
3916         <fields oils_persist:primary="id">
3917             <field name="id" reporter:datatype="id" />
3918             <field name="creator" reporter:datatype="link" />
3919             <field name="create_time" reporter:datatype="timestamp" />
3920             <field name="process_start_time" reporter:datatype="timestamp" />
3921             <field name="process_end_time" reporter:datatype="timestamp" />
3922             <field name="last_update_time" reporter:datatype="timestamp" />
3923             <field name="circulations" reporter:datatype="int" />
3924             <field name="circulations_complete" reporter:datatype="int" />
3925             <field name="reservations" reporter:datatype="int" />
3926             <field name="reservations_complete" reporter:datatype="int" />
3927             <field name="holds" reporter:datatype="int" />
3928             <field name="holds_complete" reporter:datatype="int" />
3929         </fields>
3930         <links>
3931             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3932         </links>
3933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3934             <actions>
3935                 <retrieve/>
3936             </actions>
3937         </permacrud>
3938     </class>
3939     <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">
3940         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3941             <field name="id" reporter:datatype="id" />
3942             <field name="creator" reporter:datatype="link" />
3943             <field name="create_time" reporter:datatype="timestamp" />
3944             <field name="process_start_time" reporter:datatype="timestamp" />
3945             <field name="process_end_time" reporter:datatype="timestamp" />
3946             <field name="last_update_time" reporter:datatype="timestamp" />
3947             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3948             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3949             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3950             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3951             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3952         </fields>
3953         <links>
3954             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3955             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3956             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3957             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3958             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3959             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3960         </links>
3961         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3962             <actions>
3963                 <create permission="EMERGENCY_CLOSING">
3964                     <context link="closing" field="org_unit" />
3965                 </create>
3966                 <retrieve/>
3967                 <update permission="EMERGENCY_CLOSING">
3968                     <context link="closing" field="org_unit" />
3969                 </update>
3970                 <delete permission="EMERGENCY_CLOSING">
3971                     <context link="closing" field="org_unit" />
3972                 </delete>
3973             </actions>
3974         </permacrud>
3975     </class>
3976         <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">
3977                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3978                         <field name="close_end" reporter:datatype="timestamp" />
3979                         <field name="close_start" reporter:datatype="timestamp" />
3980                         <field name="id" reporter:datatype="id" />
3981                         <field name="org_unit" reporter:datatype="org_unit"/>
3982                         <field name="reason" reporter:datatype="text"/>
3983                         <field name="full_day" reporter:datatype="bool"/>
3984                         <field name="multi_day" reporter:datatype="bool"/>
3985                         <field name="emergency_closing" reporter:datatype="link"/>
3986                 </fields>
3987                 <links>
3988                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3989                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3990                 </links>
3991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3992             <actions>
3993                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3994                 <retrieve/>
3995                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3996                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3997             </actions>
3998         </permacrud>
3999         </class>
4000         <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">
4001                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
4002                         <field name="extended" reporter:datatype="interval"/>
4003                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
4004                         <field name="max_renewals" reporter:datatype="int" />
4005                         <field name="name" reporter:datatype="text"/>
4006                         <field name="normal" reporter:datatype="interval"/>
4007                         <field name="shrt" reporter:datatype="interval"/>
4008                         <field name="max_auto_renewals" reporter:datatype="int" />
4009                 </fields>
4010                 <links>
4011                 </links>
4012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4013             <actions>
4014                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4015                 <retrieve/>
4016                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4017                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4018             </actions>
4019         </permacrud>
4020         </class>
4021
4022         <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">
4023                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4024                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4025                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4026             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4027                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4028             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4029                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4030                                 reporter:datatype="link" config_field="true"/>
4031                 </fields>
4032                 <links>
4033             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4034                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4035                 </links>
4036                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4037             <actions>
4038                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4039                 <retrieve/>
4040                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4041                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4042             </actions>
4043                 </permacrud>
4044         </class>
4045
4046         <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">
4047                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4048                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4049                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4050                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4051             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4052                 </fields>
4053                 <links>
4054                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4055                 </links>
4056                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4057             <actions>
4058                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4059                 <retrieve/>
4060                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4061                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4062             </actions>
4063                 </permacrud>
4064         </class>
4065
4066         <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">
4067                 <fields oils_persist:primary="id" oils_persist:sequence="">
4068                         <field name="balance_owed" reporter:datatype="money"/>
4069                         <field name="id" reporter:datatype="id" />
4070                         <field name="last_billing_note" reporter:datatype="text"/>
4071                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4072                         <field name="last_billing_type" reporter:datatype="text"/>
4073                         <field name="last_payment_note" reporter:datatype="text"/>
4074                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4075                         <field name="last_payment_type" reporter:datatype="text"/>
4076                         <field name="total_owed" reporter:datatype="money"/>
4077                         <field name="total_paid" reporter:datatype="money"/>
4078                         <field name="usr" reporter:datatype="link"/>
4079                         <field name="xact_finish" reporter:datatype="timestamp" />
4080                         <field name="xact_start" reporter:datatype="timestamp" />
4081                         <field name="xact_type" reporter:datatype="text"/>
4082                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4083                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4084                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4085                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4086                         <field name="billing_location" reporter:datatype="link"/>
4087                 </fields>
4088                 <links>
4089                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4090                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4091                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4092                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4093                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4094                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4095                 </links>
4096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4097                         <actions>
4098                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4099                                         <context link="usr" field="home_ou" />
4100                                 </retrieve>
4101                         </actions>
4102                 </permacrud>
4103         </class>
4104         <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">
4105                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4106                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4107                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4108                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4109                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4110                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4111                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4112                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4113                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4114                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4115                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4116                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4117                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4118                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4119                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4120                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4121                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4122                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4123                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4124                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4125                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4126                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4127                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4128                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4129                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4130                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4131                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4132                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4133                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4134                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4135                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4136                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4137                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4138                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4139                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4140                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4141                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4142                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4143                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4144                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4145                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4146                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4147                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4148                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4149                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4150                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4151                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4152                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4153                         <field reporter:label="OPAC/Staff Client Username" name="usrname"  reporter:datatype="text"/>
4154                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4155                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4156                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4157                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4158                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4159                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4160                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4161                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4162                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4163                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4164                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4165                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4166                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4167                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4168                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4169                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4170                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4171                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4172                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4173                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4174                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4175                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4176                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4177                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4178             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4179                 </fields>
4180                 <links>
4181                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4182                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4183                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4184                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4185                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4186                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4187                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4188                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4189                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4190                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4191                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4192                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4193                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4194                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4195                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4196                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4197                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4198                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4199                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4200                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4201                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4202                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4203                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4204                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4205                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4206                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4207                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4208                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4209                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4210                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4211                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4212                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4213             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4214                 </links>
4215                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4216                         <actions>
4217                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4218                         </actions>
4219                 </permacrud>
4220         </class>
4221         <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">
4222                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4223                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4224                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4225                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4226                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4227                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4228                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4229                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4230                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4231         </fields>
4232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4233                         <actions>
4234                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4235                                 <retrieve/>
4236                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4237                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4238                         </actions>
4239                 </permacrud>
4240         </class>
4241         <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">
4242                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4243                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4244                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4245                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4246                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4247         </fields>
4248         <links>
4249                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4250                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4251                 </links>
4252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4253                         <actions>
4254                                 <retrieve permission="RUN_REPORTS">
4255                                         <context link="usr" field="home_ou" />
4256                                 </retrieve>
4257                         </actions>
4258                 </permacrud>
4259         </class>
4260         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4261                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4262                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4263                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4264                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4265                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4266                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4267                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4268         </fields>
4269         <links>
4270                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4271                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4272                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4273                 </links>
4274                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4275                         <actions>
4276                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4277                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4278                                         <context link="usr" field="home_ou" />
4279                                         <context link="ws" field="owning_lib" />
4280                                 </retrieve>
4281                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4282                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4283                         </actions>
4284                 </permacrud>
4285         </class>
4286         <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">
4287                 <fields oils_persist:primary="name">
4288                         <field name="name" reporter:datatype="text"/>
4289                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4290                 </fields>
4291                 <links/>
4292                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4293                         <actions>
4294                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4295                                 <retrieve/>
4296                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4297                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4298                         </actions>
4299                 </permacrud>
4300         </class>
4301         <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">
4302                 <fields oils_persist:primary="name">
4303                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4304                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4305                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4306                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4307                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4308                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4309                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4310                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4311                 </fields>
4312                 <links>
4313                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4314                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4315                 </links>
4316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4317                         <actions>
4318                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4319                                 <retrieve/>
4320                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4321                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4322                         </actions>
4323                 </permacrud>
4324         </class>
4325         <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">
4326                 <fields oils_persist:primary="name">
4327                         <field name="name" reporter:datatype="text"/>
4328                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4329                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4330                         <field name="datatype" reporter:datatype="text"/>
4331                         <field name="view_perm" reporter:datatype="link"/>
4332                         <field name="update_perm" reporter:datatype="link"/>
4333                         <field name="fm_class" reporter:datatype="text"/>
4334                         <field name="grp" reporter:datatype="link"/>
4335                 </fields>
4336                 <links>
4337                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4338                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4339                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4340                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4341                 </links>
4342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4343                         <actions>
4344                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4345                                 <retrieve/>
4346                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4347                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4348                         </actions>
4349                 </permacrud>
4350         </class>
4351         <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">
4352                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4353                         <field name="id" />
4354                         <field name="name"  reporter:datatype="text"/>
4355                         <field name="org_unit" reporter:datatype="org_unit"/>
4356                         <field name="value"  reporter:datatype="text"/>
4357                 </fields>
4358                 <links>
4359                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4360                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4361                 </links>
4362         </class>
4363         <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">
4364                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4365                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4366                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4367                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4368                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4369                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4370                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4371                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4372                 </fields>
4373                 <links>
4374                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4375                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4376                 </links>
4377         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4378             <actions>
4379                 <create permission="CREATE_COPY_NOTE">
4380                     <context link="owning_copy" field="circ_lib"/>
4381                 </create>
4382                 <retrieve permission="VIEW_COPY_NOTES">
4383                     <context link="owning_copy" field="circ_lib"/>
4384                 </retrieve>
4385                 <update permission="UPDATE_COPY_NOTE">
4386                     <context link="owning_copy" field="circ_lib"/>
4387                 </update>
4388                 <delete permission="DELETE_COPY_NOTE">
4389                     <context link="owning_copy" field="circ_lib"/>
4390                 </delete>
4391             </actions>
4392         </permacrud>
4393         </class>
4394         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4395                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4396                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4397                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4398                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4399                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4400                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4401                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4402                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4403                 </fields>
4404                 <links>
4405                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4406                 </links>
4407         </class>
4408         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4409                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4410                         <field name="fingerprint"  reporter:datatype="text"/>
4411                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4412                         <field name="master_record" reporter:datatype="link"/>
4413                         <field name="mods"  reporter:datatype="text"/>
4414                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4415                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4416                 </fields>
4417                 <links>
4418                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4419                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4420                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4421                 </links>
4422                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4423                         <actions>
4424                                 <retrieve/>
4425                         </actions>
4426                 </permacrud>
4427         </class>
4428         <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">
4429                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4430                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4431                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4432                 </fields>
4433                 <links/>
4434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4435             <actions>
4436                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4437                 <retrieve/>
4438                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4439                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4440             </actions>
4441         </permacrud>
4442         </class>
4443         <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">
4444                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4445                         <field name="code"  reporter:datatype="text"/>
4446                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4447                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4448                 </fields>
4449                 <links/>
4450         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4451             <actions>
4452                 <create permission="CREATE_PERM" global_required="true"/>
4453                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4454                 <update permission="UPDATE_PERM" global_required="true"/>
4455                 <delete permission="DELETE_PERM" global_required="true"/>
4456             </actions>
4457         </permacrud>
4458         </class>
4459         <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">
4460                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4461                         <field name="id" reporter:datatype="id" />
4462                         <field name="metarecord" reporter:datatype="link"/>
4463                         <field name="source" reporter:datatype="link"/>
4464                 </fields>
4465                 <links>
4466                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4467                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4468                 </links>
4469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4470                         <actions>
4471                                 <retrieve/>
4472                         </actions>
4473                 </permacrud>
4474         </class>
4475         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4476                         oils_obj:fieldmapper="metabib::display_entry" 
4477                         oils_persist:tablename="metabib.display_entry" 
4478                         oils_persist:field_safe="true"
4479                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4480                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4481                         <field name="id" reporter:datatype="id" />
4482                         <field name="field" reporter:datatype="link"/>
4483                         <field name="source" reporter:datatype="link"/>
4484                         <field name="value"  reporter:datatype="text"/>
4485                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4486                 </fields>
4487                 <links>
4488                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4489                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4490                 </links>
4491                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4492                         <actions>
4493                                 <retrieve/>
4494                         </actions>
4495                 </permacrud>
4496         </class>
4497         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4498                 oils_persist:tablename="metabib.flat_display_entry"
4499                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4500                 oils_persist:field_safe="true"
4501                 reporter:label="Flat Display Entry" 
4502                 oils_persist:readonly="true">
4503                 <fields>
4504                         <field name="source" reporter:datatype="id" />
4505                         <field name="name" reporter:datatype="text"/>
4506                         <field name="multi" reporter:datatype="bool"/>
4507                         <field name="label" reporter:datatype="text"/>
4508                         <field name="field" reporter:datatype="link"/>
4509                         <field name="value" reporter:datatype="text"/>
4510                 </fields>
4511                 <links>
4512                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4513                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4514                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4515                 </links>
4516                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4517                         <actions>
4518                                 <retrieve/>
4519                         </actions>
4520                 </permacrud>
4521         </class>
4522         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4523                 oils_persist:tablename="metabib.compressed_display_entry"
4524                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4525                 oils_persist:field_safe="true"
4526                 reporter:label="Compressed Display Entry" 
4527                 oils_persist:readonly="true">
4528                 <fields>
4529                         <field name="source" reporter:datatype="id" />
4530                         <field name="name" reporter:datatype="text"/>
4531                         <field name="multi" reporter:datatype="bool"/>
4532                         <field name="label" reporter:datatype="text"/>
4533                         <field name="field" reporter:datatype="link"/>
4534                         <field name="value" reporter:datatype="text"/>
4535                 </fields>
4536                 <links>
4537                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4538                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4539                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4540                 </links>
4541                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4542                         <actions>
4543                                 <retrieve/>
4544                         </actions>
4545                 </permacrud>
4546         </class>
4547         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4548                 oils_persist:tablename="metabib.wide_display_entry"
4549                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4550                 oils_persist:field_safe="true"
4551                 reporter:label="Wide Display Entry" 
4552                 oils_persist:readonly="true">
4553                 <fields oils_persist:primary="source">
4554                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4555                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4556                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4557                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4558                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4559                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4560                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4561                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4562                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4563                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4564                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4565                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4566                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4567                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4568                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4569                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4570                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4571                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4572                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4573                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4574                 </fields>
4575                 <links>
4576                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4577                 </links>
4578                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4579                         <actions>
4580                                 <retrieve/>
4581                         </actions>
4582                 </permacrud>
4583         </class>
4584
4585         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4586                 oils_persist:tablename="config.display_field_map"
4587                 oils_obj:fieldmapper="config::display_field_map"
4588                 oils_persist:field_safe="true"
4589                 reporter:label="Display Field Map">
4590                 <fields oils_persist:primary="name">
4591                         <field name="name" reporter:datatype="text"/>
4592                         <field name="field" reporter:datatype="link"/>
4593                         <field name="multi" reporter:datatype="bool"/>
4594                 </fields>
4595                 <links>
4596                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4597                 </links>
4598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4599                         <actions>
4600                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4601                                 <retrieve/>
4602                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4603                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4604                         </actions>
4605                 </permacrud>
4606         </class>
4607
4608         <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">
4609                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4610                         <field name="id" reporter:datatype="id" />
4611                         <field name="field" reporter:datatype="link"/>
4612                         <field name="source" reporter:datatype="link"/>
4613                         <field name="value"  reporter:datatype="text"/>
4614                 </fields>
4615                 <links>
4616                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4617                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4618                 </links>
4619         </class>
4620         <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">
4621                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4622                         <field name="id" reporter:datatype="id" />
4623                         <field name="value" reporter:datatype="text"/>
4624                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4625                 </fields>
4626                 <links>
4627                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4628                 </links>
4629                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4630                         <actions>
4631                                 <retrieve/>
4632                         </actions>
4633                 </permacrud>
4634         </class>
4635         <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">
4636                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4637                         <field name="id" reporter:datatype="id" />
4638                         <field name="entry" reporter:datatype="link"/>
4639                         <field name="def" reporter:datatype="link"/>
4640                         <field name="source" reporter:datatype="link"/>
4641                 </fields>
4642                 <links>
4643                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4644                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4645                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4646                 </links>
4647         </class>
4648         <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">
4649                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4650                         <field name="id" reporter:datatype="id" />
4651                         <field name="entry" reporter:datatype="link"/>
4652                         <field name="simple_heading" reporter:datatype="link"/>
4653                 </fields>
4654                 <links>
4655                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4656                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4657                 </links>
4658         </class>
4659         <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">
4660                 <oils_persist:source_definition><![CDATA[
4661                         SELECT * FROM metabib.author_field_entry
4662                                                 UNION ALL
4663                         SELECT * FROM metabib.keyword_field_entry
4664                                                 UNION ALL
4665                         SELECT * FROM metabib.identifier_field_entry
4666                                                 UNION ALL
4667                         SELECT * FROM metabib.title_field_entry
4668                                                 UNION ALL
4669                         SELECT * FROM metabib.subject_field_entry
4670                                                 UNION ALL
4671                         SELECT * FROM metabib.series_field_entry
4672                 ]]></oils_persist:source_definition>
4673                 <fields>
4674                         <field name="field" reporter:datatype="link"/>
4675                         <field name="id" reporter:datatype="id" />
4676                         <field name="source" reporter:datatype="link"/>
4677                         <field name="value"  reporter:datatype="text"/>
4678                 </fields>
4679                 <links>
4680                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4681                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4682                 </links>
4683         </class>
4684         <class id="mkfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::keyword_field_entry" oils_persist:tablename="metabib.keyword_field_entry" reporter:label="Keyword Field Entry">
4685                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4686                         <field name="field" reporter:datatype="link"/>
4687                         <field name="id" reporter:datatype="id" />
4688                         <field name="source" reporter:datatype="link"/>
4689                         <field name="value"  reporter:datatype="text"/>
4690                 </fields>
4691                 <links>
4692                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4693                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4694                 </links>
4695         </class>
4696         <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">
4697                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4698                         <field name="accepting_usr" reporter:datatype="link"/>
4699                         <field name="amount" reporter:datatype="money" />
4700                         <field name="amount_collected" reporter:datatype="money" />
4701                         <field name="cash_drawer" reporter:datatype="link"/>
4702                         <field name="id" reporter:datatype="id" />
4703                         <field name="note"  reporter:datatype="text"/>
4704                         <field name="payment_ts" reporter:datatype="timestamp"/>
4705                         <field name="xact" reporter:datatype="link"/>
4706                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4707                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4708                 </fields>
4709                 <links>
4710                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4711                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4712                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4713                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4714                 </links>
4715         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4716             <actions>
4717                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4718                     <context link="xact" jump="usr" field="home_ou"/>
4719                 </retrieve>
4720                         </actions>
4721                 </permacrud>
4722         </class>
4723         <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">
4724                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4725                         <field name="accepting_usr" reporter:datatype="link"/>
4726                         <field name="amount" reporter:datatype="money" />
4727                         <field name="amount_collected" reporter:datatype="money" />
4728                         <field name="id" reporter:datatype="id" />
4729                         <field name="note"  reporter:datatype="text"/>
4730                         <field name="payment_ts" reporter:datatype="timestamp"/>
4731                         <field name="xact" reporter:datatype="link"/>
4732                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4733                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4734                 </fields>
4735                 <links>
4736                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4737                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4738                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4739                 </links>
4740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4741             <actions>
4742                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4743                     <context link="xact" jump="usr" field="home_ou"/>
4744                 </retrieve>
4745                         </actions>
4746                 </permacrud>
4747         </class>
4748         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4749                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4750                         <field name="accepting_usr" reporter:datatype="link"/>
4751                         <field name="amount" reporter:datatype="money" />
4752                         <field name="amount_collected" reporter:datatype="money" />
4753                         <field name="id" reporter:datatype="id" />
4754                         <field name="note"  reporter:datatype="text"/>
4755                         <field name="payment_ts" reporter:datatype="timestamp"/>
4756                         <field name="xact" reporter:datatype="link"/>
4757                         <field name="billing" reporter:datatype="link"/>
4758                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4759                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4760                 </fields>
4761                 <links>
4762                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4763                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4764                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4765                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4766                 </links>
4767         </class>
4768         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4769                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4770                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4771                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4772                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4773                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4774                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4775                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4776                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4777                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4778                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4779                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4780                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4781                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4782                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4783                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4784                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4785                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4786                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4787                 </fields>
4788                 <links>
4789                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4790                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4791                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4792                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4793                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4794                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4795                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4796                 </links>
4797         </class>
4798
4799         <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">
4800                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4801                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4802                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4803                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4804                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4805                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4806                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4807                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4808                 </fields>
4809                 <links/>
4810         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4811             <actions>
4812                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4813                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4814                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4815                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4816             </actions>
4817         </permacrud>
4818         </class>
4819         <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">
4820                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4821                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4822                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4823                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4824                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4825                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4826                 </fields>
4827                 <links>
4828                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4829                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4830                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4831         </links>
4832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4833             <actions>
4834                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4835                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4836                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4837                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4838             </actions>
4839         </permacrud>
4840         </class>
4841         <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">
4842                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4843                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4844                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4845                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4846                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4847             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4848             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4849             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4850             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4851                 </fields>
4852                 <links/>
4853         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4854             <actions>
4855                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4856                 <retrieve/>
4857                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4858                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4859             </actions>
4860         </permacrud>
4861         </class>
4862         <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">
4863                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4864                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4865                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4866                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4867                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4868                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4869                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4870                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4871                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4872                 </fields>
4873                 <links>
4874                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4875                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4876                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4877                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4878                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4879                 </links>
4880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4881                         <actions>
4882                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4883                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4884                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4885                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4886                         </actions>
4887                 </permacrud>
4888         </class>
4889         <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">
4890                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4891                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4892                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4893                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4894                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4895                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4896                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4897                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4898                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4899                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4900                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4901                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4902                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4903                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4904                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4905                 </fields>
4906                 <links>
4907                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4908                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4909                 </links>
4910                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4911                         <actions>
4912                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4913                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4914                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4915                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4916                         </actions>
4917                 </permacrud>
4918         </class>
4919         <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">
4920                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4921                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4922                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4923                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4924                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4925                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4926                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4927                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4928                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4929                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4930                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4931                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4932                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4933                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4934                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4935                 </fields>
4936                 <links>
4937                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4938                 </links>
4939                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4940                         <actions>
4941                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4942                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4943                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4944                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4945                         </actions>
4946                 </permacrud>
4947         </class>
4948
4949
4950         <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">
4951                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4952                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4953                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4954                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4955                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4956                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4957                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4958                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4959                 </fields>
4960                 <links>
4961                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4962                 </links>
4963         </class>
4964
4965         <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">
4966                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4967                         <field name="call_number" />
4968                         <field name="create_date" reporter:datatype="timestamp"/>
4969                         <field name="creator" reporter:datatype="link"/>
4970                         <field name="id" reporter:datatype="id" />
4971                         <field name="pub" reporter:datatype="bool"/>
4972                         <field name="title"  reporter:datatype="text"/>
4973                         <field name="value"  reporter:datatype="text"/>
4974                 </fields>
4975                 <links>
4976                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4977                 </links>
4978         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4979             <actions>
4980                 <create permission="CREATE_VOLUME_NOTE">
4981                     <context link="call_number" field="owning_lib"/>
4982                 </create>
4983                 <retrieve permission="VIEW_VOLUME_NOTES">
4984                     <context link="call_number" field="owning_lib"/>
4985                 </retrieve>
4986                 <update permission="UPDATE_VOLUME_NOTE">
4987                     <context link="call_number" field="owning_lib"/>
4988                 </update>
4989                 <delete permission="DELETE_VOLUME_NOTE">
4990                     <context link="call_number" field="owning_lib"/>
4991                 </delete>
4992             </actions>
4993         </permacrud>
4994         </class>
4995         <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">
4996                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4997                         <field name="create_date" reporter:datatype="timestamp"/>
4998                         <field name="creator" reporter:datatype="link"/>
4999                         <field name="edit_date" reporter:datatype="timestamp"/>
5000                         <field name="editor" reporter:datatype="link"/>
5001                         <field name="id" reporter:datatype="id" />
5002                         <field name="record" reporter:datatype="link"/>
5003                         <field name="value" reporter:datatype="text"/>
5004                 </fields>
5005                 <links>
5006                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
5007                 </links>
5008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5009             <actions>
5010                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5011                 <retrieve/>
5012                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5013                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
5014             </actions>
5015         </permacrud>
5016         </class>
5017         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
5018         <oils_persist:source_definition><![CDATA[
5019 SELECT  usr,
5020         SUM(
5021             CASE
5022                 WHEN (
5023                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5024                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5025                 ) THEN 1
5026                 ELSE 0
5027             END
5028         ) AS out,
5029
5030         SUM(
5031             CASE
5032                 WHEN (
5033                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5034                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5035                 ) THEN 1
5036                 ELSE 0
5037             END
5038         ) AS overdue,
5039
5040         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5041         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5042         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5043   FROM  action.circulation
5044   WHERE checkin_time IS NULL
5045   GROUP BY 1
5046         ]]></oils_persist:source_definition>
5047         <fields oils_persist:primary="usr">
5048             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5049             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5050             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5051             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5052             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5053             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5054         </fields>
5055         <links>
5056             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5057         </links>
5058         </class>
5059         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5060         <oils_persist:source_definition><![CDATA[
5061 SELECT  usr,
5062         STRING_AGG(
5063             CASE
5064                 WHEN (
5065                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5066                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5067                 ) THEN id::TEXT
5068                 ELSE '0'
5069             END
5070         ,',') AS out,
5071
5072         STRING_AGG(
5073             CASE
5074                 WHEN (
5075                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5076                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5077                 ) THEN id::TEXT
5078                 ELSE '0'
5079             END
5080         ,',') AS overdue,
5081
5082         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5083         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5084         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5085   FROM  action.circulation
5086   WHERE checkin_time IS NULL
5087   GROUP BY 1
5088         ]]></oils_persist:source_definition>
5089         <fields oils_persist:primary="usr">
5090             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5091             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5092             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5093             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5094             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5095             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5096         </fields>
5097         <links>
5098             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5099         </links>
5100         </class>
5101         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5102                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5103                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5104                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5105                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5106                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5107                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5108                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5109                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5110                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5111                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5112                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5113                 </fields>
5114                 <links>
5115                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5116                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5117                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5118                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5119                 </links>
5120         </class>
5121         <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">
5122                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5123                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5124                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5125                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5126                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5127                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5128                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5129                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5130                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5131                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5132                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5133                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5134                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5135                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5136                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5137                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5138                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5139                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5140                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5141                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5142                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5143                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5144                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5145                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5146                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5147                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5148                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5149                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5150                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5151                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5152                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5153                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5154                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5155                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5156                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5157                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5158                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5159                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5160                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5161                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5162                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5163                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5164                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5165                 </fields>
5166                 <links>
5167                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5168                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5169                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5170                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5171                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5172                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5173                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5174                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5175                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5176                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5177                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5178                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5179                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5180                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5181                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5182                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5183                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5184                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5185                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5186                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5187                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5188                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5189                 </links>
5190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5191                         <actions>
5192                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5193                         </actions>
5194                 </permacrud>
5195         </class>
5196         <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">
5197                 <fields>
5198                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5199                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5200                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5201                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5202                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5203                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5204                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5205                 </fields>
5206                 <links>
5207                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5208                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5209                 </links>
5210                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5211                         <actions>
5212                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5213                         </actions>
5214                 </permacrud>
5215         </class>
5216         <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">
5217                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5218                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5219                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5220                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5221                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5222                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5223                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5224                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5225                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5226                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5227                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5228                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5229                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5230                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5231                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5232                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5233                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5234                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5235                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5236                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5237                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5238                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5239                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5240                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5241                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5242                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5243                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5244                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5245                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5246                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5247                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5248                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5249                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5250                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5251                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5252                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5253                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5254                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5255                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5256                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5257                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5258                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5259                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5260                 </fields>
5261                 <links>
5262                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5263                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5264                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5265                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5266                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5267                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5268                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5269                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5270                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5271                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5272                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5273                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5274                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5275                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5276                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5277                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5278                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5279                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5280                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5281                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5282                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5283                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5284                 </links>
5285                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5286                         <actions>
5287                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5288                         </actions>
5289                 </permacrud>
5290         </class>
5291
5292         <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">
5293                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5294                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5295                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5296                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5297                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5298                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5299                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5300                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5301                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5302                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5303                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5304                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5305                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5306                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5307                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5308                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5309                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5310                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5311                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5312                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5313                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5314                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5315                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5316                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5317                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5318                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5319                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5320                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5321                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5322                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5323                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5324                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5325                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5326                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5327                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5328                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5329                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5330                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5331                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5332                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5333                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5334                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5335                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5336                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5337                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5338                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5339                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5340                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5341                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5342                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5343                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5344                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5345                 </fields>
5346                 <links>
5347                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5348                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5349                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5350                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5351                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5352                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5353                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5354                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5355                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5356                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5357                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5358                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5359                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5360                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5361                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5362                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5363                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5364                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5365                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5366                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5367                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5368                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5369                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5370                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5371                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5372                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5373                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5374                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5375                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5376                 </links>
5377                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5378                         <actions>
5379                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5380                         </actions>
5381                 </permacrud>
5382         </class>
5383         <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">
5384                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5385                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5386                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5387                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5388                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5389                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5390                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5391                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5392                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5393                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5394                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5395                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5396                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5397                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5398                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5399                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5400                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5401                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5402                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5403                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5404                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5405                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5406                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5407                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5408                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5409                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5410                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5411                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5412                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5413                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5414                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5415                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5416                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5417                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5418                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5419                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5420                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5421                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5422                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5423                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5424                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5425                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5426                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5427                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5428                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5429                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5430                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5431                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5432                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5433                 </fields>
5434                 <links>
5435                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5436                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5437                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5438                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5439                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5440                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5441                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5442                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5443                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5444                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5445                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5446                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5447                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5448                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5449                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5450                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5451                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5452                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5453                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5454                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5455                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5456                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5457                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5458                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5459                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5460                 </links>
5461         </class>
5462         <class id="auch" 
5463                 controller="open-ils.cstore" 
5464                 oils_obj:fieldmapper="action::user_circ_history" 
5465                 oils_persist:tablename="action.usr_circ_history" 
5466                 reporter:label="User Checkout History">
5467                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5468                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5469                         <!-- prevent reporting on the user that owns the checkout history -->
5470                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5471                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5472                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5473                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5474                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5475                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5476                 </fields>
5477                 <links>
5478                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5479                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5480                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5481                 </links>
5482         </class>
5483         <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">
5484                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5485                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5486                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5487                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5488                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5489                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5490                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5491                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5492                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5493                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5494                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5495                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5496                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5497                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5498                 </fields>
5499                 <links>
5500                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5501                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5502                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5503                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5504                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5505                 </links>
5506                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5507                         <actions>
5508                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5509                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5510                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5511                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5512                         </actions>
5513                 </permacrud>
5514         </class>
5515
5516         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5517                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5518                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5519                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5520                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5521                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5522                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5523                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5524                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5525                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5526                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5527                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5528                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5529                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5530                 </fields>
5531                 <links>
5532                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5533                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5534                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5535                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5536                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5537                 </links>
5538                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5539                         <actions>
5540                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5541                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5542                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5543                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5544                         </actions>
5545                 </permacrud>
5546         </class>
5547         
5548         <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">
5549                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5550                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5551                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5552                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5553                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5554                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5555                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5556                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5557                 </fields>
5558                 <links>
5559                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5560                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5561                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5562                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5563                 </links>
5564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5565                         <actions>
5566                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5567                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5568                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5569                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5570                         </actions>
5571                 </permacrud>
5572         </class>
5573         
5574         <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">
5575                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5576                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5577                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5578                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5579                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5580                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5581                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5582                 </fields>
5583                 <links>
5584                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5585                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5586                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5587                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5588                 </links>
5589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5590                         <actions>
5591                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5592                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5593                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5594                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5595                         </actions>
5596                 </permacrud>
5597         </class>
5598         
5599         <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">
5600                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5601                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5602                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5603                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5604                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5605                 </fields>
5606                 <links>
5607                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5608                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5609                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5610                 </links>
5611                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5612                         <actions>
5613                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5614                     <context link="resource" field="owner" />
5615                 </create>
5616                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5617                     <context link="resource" field="owner" />
5618                 </retrieve>
5619                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5620                     <context link="resource" field="owner" />
5621                 </update>
5622                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5623                     <context link="resource" field="owner" />
5624                 </delete>
5625                         </actions>
5626                 </permacrud>
5627         </class>
5628         
5629         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5630                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5631                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5632                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5633                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5634                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5635                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5636                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5637                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5638                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5639                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5640                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5641                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5642                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5643                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5644                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5645                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5646                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5647                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5648                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5649                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5650                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5651                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5652                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5653                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5654                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5655                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5656                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5657                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5658                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5659                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5660                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5661                 </fields>
5662                 <links>
5663                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5664                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5665                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5666                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5667                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5668                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5669                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5670                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5671                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5672                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5673                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5674                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5675                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5676                 </links>
5677                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5678                         <actions>
5679                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5680                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5681                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5682                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5683                         </actions>
5684                 </permacrud>
5685         </class>
5686         
5687         <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">
5688                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5689                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5690                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5691                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5692                 </fields>
5693                 <links>
5694                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5695                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5696                 </links>
5697                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5698                         <actions>
5699                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5700                                         <context link="reservation" field="pickup_lib"/>
5701                                 </create>
5702                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5703                                         <context link="reservation" field="pickup_lib"/>
5704                                 </retrieve>
5705                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5706                                         <context link="reservation" field="pickup_lib"/>
5707                                 </update>
5708                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5709                                         <context link="reservation" field="pickup_lib"/>
5710                                 </delete>
5711                         </actions>
5712                 </permacrud>
5713         </class>
5714
5715         <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">
5716                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5717                         <field name="bucket" reporter:datatype="link"/>
5718                         <field name="id" reporter:datatype="id" />
5719                         <field name="target_call_number" reporter:datatype="link" />
5720                         <field name="create_time" reporter:datatype="timestamp" />
5721                         <field name="pos" reporter:datatype="int" />
5722                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5723                 </fields>
5724                 <links>
5725                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5726                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5727             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5728                 </links>
5729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5730                         <actions>
5731                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5732                     <context link="bucket" field="owning_lib"/>
5733                 </retrieve>
5734             </actions>
5735         </permacrud>
5736         </class>
5737         <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">
5738                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5739                         <field name="id" reporter:datatype="id" />
5740                         <field name="item" reporter:datatype="link"/>
5741                         <field name="note" reporter:datatype="text" />
5742                 </fields>
5743                 <links>
5744                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5745                 </links>
5746         </class>
5747         <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">
5748                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5749                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5750                         <field name="btype" reporter:datatype="text"/>
5751                         <field name="id" reporter:datatype="id" />
5752                         <field name="name" reporter:datatype="text"/>
5753                         <field name="description" reporter:datatype="text"/>
5754                         <field name="owner" reporter:datatype="link"/>
5755                         <field name="pub" reporter:datatype="bool"/>
5756                         <field name="create_time" reporter:datatype="timestamp" />
5757                         <field name="owning_lib" reporter:datatype="org_unit" />
5758                 </fields>
5759                 <links>
5760                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5761                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5762                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5763                 </links>
5764                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5765                         <actions>
5766                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5767                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5768                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5769                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5770                         </actions>
5771                 </permacrud>
5772         </class>
5773         <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">
5774                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5775                         <field name="id" reporter:datatype="id" />
5776                         <field name="bucket" reporter:datatype="link"/>
5777                         <field name="note" reporter:datatype="text" />
5778                 </fields>
5779                 <links>
5780                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5781                 </links>
5782         </class>
5783         <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">
5784                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5785                         <field name="hold" reporter:datatype="link"/>
5786                         <field name="id" reporter:datatype="id" />
5787                         <field name="target_copy" reporter:datatype="link"/>
5788                         <field name="proximity" reporter:datatype="number"/>
5789                 </fields>
5790                 <links>
5791                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5792                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5793                 </links>
5794         </class>
5795         <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">
5796                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5797                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5798                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5799                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5800                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5801                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5802                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5803                 </fields>
5804                 <links>
5805                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5806                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5807                 </links>
5808         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5809             <actions>
5810                 <create permission="CREATE_HOLD_NOTIFICATION">
5811                                         <context link="hold" jump="usr" field="home_ou" />
5812                                 </create>
5813                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5814                                         <context link="hold" jump="usr" field="home_ou" />
5815                                 </retrieve>
5816                 <update permission="CREATE_HOLD_NOTIFICATION">
5817                                         <context link="hold" jump="usr" field="home_ou" />
5818                                 </update>
5819                 <delete permission="CREATE_HOLD_NOTIFICATION">
5820                                         <context link="hold" jump="usr" field="home_ou" />
5821                                 </delete>
5822             </actions>
5823         </permacrud>
5824         </class>
5825         <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">
5826                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5827                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5828                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5829                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5830                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5831                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5832                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5833                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5834                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5835                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5836                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5837                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5838                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5839                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5840                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5841                 </fields>
5842                 <links>
5843                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5844                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5845                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5846                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5847                 </links>
5848         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5849             <actions>
5850                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5851                 <retrieve/>
5852                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5853                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5854             </actions>
5855         </permacrud>
5856         </class>
5857         <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">
5858                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5859                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5860                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5861                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5862                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5863             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5864             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5865             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5866                 </fields>
5867                 <links>
5868                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5869                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5870                 </links>
5871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5872             <actions>
5873                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5874                 <retrieve/>
5875                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5876                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5877             </actions>
5878         </permacrud>
5879         </class>
5880         <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">
5881                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5882                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5883             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5884             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5885                 </fields>
5886                 <links>
5887                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5888                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5889                 </links>
5890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5891             <actions>
5892                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5893                                         <context link="lgroup" field="owner" />
5894                 </create>
5895                 <retrieve/>
5896                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5897                                         <context link="lgroup" field="owner" />
5898                 </update>
5899                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5900                                         <context link="lgroup" field="owner" />
5901                 </delete>
5902             </actions>
5903         </permacrud>
5904         </class>
5905
5906     <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">
5907         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5908             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5909             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5910             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5911             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5912         </fields>
5913         <links>
5914             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5915             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5916         </links>
5917         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5918             <actions>
5919                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5920                 <retrieve/>
5921                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5922                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5923             </actions>
5924         </permacrud>
5925     </class>
5926
5927         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5928                 <fields>
5929                         <field name="sre_id" oils_persist:virtual="true" />
5930                         <field name="location" oils_persist:virtual="true" />
5931                         <field name="owning_lib" oils_persist:virtual="true" />
5932                         <field name="basic_holdings" oils_persist:virtual="true" />
5933                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5934                         <field name="supplement_holdings" oils_persist:virtual="true" />
5935                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5936                         <field name="index_holdings" oils_persist:virtual="true" />
5937                         <field name="index_holdings_add" oils_persist:virtual="true" />
5938                         <field name="online" oils_persist:virtual="true" />
5939                         <field name="missing" oils_persist:virtual="true" />
5940                         <field name="incomplete" oils_persist:virtual="true" />
5941                 </fields>
5942         </class>
5943
5944         <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">
5945                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5946                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5947                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5948                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5949                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5950                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5951                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5952                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5953                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5954                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5955                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5956                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5957                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5958                 </fields>
5959                 <links>
5960                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5961                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5962                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5963                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5964                 </links>
5965                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5966                         <actions>
5967                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5968                                 <retrieve/>
5969                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5970                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5971                         </actions>
5972                 </permacrud>
5973         </class>
5974
5975         <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">
5976                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5977                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5978                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5979                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5980                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5981                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5982                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5983                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5984                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5985                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5986                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5987                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5988                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5989                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5990                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5991                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5992                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5993                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5994                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5995                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5996                 </fields>
5997                 <links>
5998                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5999                 </links>
6000                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6001                         <actions>
6002                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
6003                                         <context link="subscription" field="owning_lib" />
6004                                 </create>
6005                                 <retrieve />
6006                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
6007                                         <context link="subscription" field="owning_lib" />
6008                                 </update>
6009                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
6010                                         <context link="subscription" field="owning_lib" />
6011                                 </delete>
6012                         </actions>
6013                 </permacrud>
6014         </class>
6015
6016         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
6017                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
6018                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6019                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
6020                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
6021                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
6022                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6023                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6024                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6025                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6026                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6027                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6028                 </fields>
6029                 <links>
6030                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6031                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6032                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6033                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6034                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6035                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6036                 </links>
6037                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6038                         <actions>
6039                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6040                                 <retrieve />
6041                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6042                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6043                         </actions>
6044                 </permacrud>
6045         </class>
6046
6047         <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">
6048                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6049                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6050                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6051                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6052                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6053                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6054                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6055                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6056                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6057                 </fields>
6058                 <links>
6059                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6060                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6061                 </links>
6062                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6063                         <actions>
6064                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6065                     <context link="subscription" field="owning_lib"/>
6066                 </create>
6067                                 <retrieve />
6068                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6069                     <context link="subscription" field="owning_lib"/>
6070                 </update>
6071                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6072                     <context link="subscription" field="owning_lib"/>
6073                 </delete>
6074                         </actions>
6075                 </permacrud>
6076         </class>
6077
6078         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6079                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6080                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6081                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6082                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6083                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6084                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6085                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6086                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6087                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6088                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6089                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6090                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6091                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6092                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6093                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6094                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6095                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6096                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6097                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6098                 </fields>
6099                 <links>
6100                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6101                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6102                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6103                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6104                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6105                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6106                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6107                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6108                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6109                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6110                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6111                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6112                 </links>
6113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6114                         <actions>
6115                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6116                                 <retrieve />
6117                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6118                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6119                         </actions>
6120                 </permacrud>
6121         </class>
6122
6123         <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">
6124                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6125                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6126                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6127                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6128                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6129                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6130                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6131                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6132                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6133                 </fields>
6134                 <links>
6135                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6136                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6137                 </links>
6138                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6139                         <actions>
6140                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6141                                         <context link="distribution" field="holding_lib" />
6142                                 </create>
6143                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6144                                         <context link="distribution" field="holding_lib" />
6145                                 </retrieve>
6146                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6147                                         <context link="distribution" field="holding_lib" />
6148                                 </update>
6149                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6150                                         <context link="distribution" field="holding_lib" />
6151                                 </delete>
6152                         </actions>
6153                 </permacrud>
6154         </class>
6155
6156         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6157                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6158                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6159                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6160                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6161                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6162                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6163                 </fields>
6164                 <links>
6165                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6166                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6167                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6168                 </links>
6169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6170                         <actions>
6171                                 <create permission="ADMIN_SERIAL_STREAM">
6172                                         <context link="distribution" field="holding_lib" />
6173                                 </create>
6174                                 <retrieve />
6175                                 <update permission="ADMIN_SERIAL_STREAM">
6176                                         <context link="distribution" field="holding_lib" />
6177                                 </update>
6178                                 <delete permission="ADMIN_SERIAL_STREAM">
6179                                         <context link="distribution" field="holding_lib" />
6180                                 </delete>
6181                         </actions>
6182                 </permacrud>
6183         </class>
6184
6185         <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">
6186                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6187                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6188                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6189                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6190                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6191                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6192                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6193                 </fields>
6194                 <links>
6195                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6196                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6197                 </links>
6198                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6199                         <actions>
6200                                 <create permission="ADMIN_SERIAL_STREAM">
6201                                         <context link="stream" jump="distribution" field="holding_lib" />
6202                                 </create>
6203                                 <retrieve permission="RECEIVE_SERIAL">
6204                                         <context link="stream" jump="distribution" field="holding_lib" />
6205                                 </retrieve>
6206                                 <update permission="ADMIN_SERIAL_STREAM">
6207                                         <context link="stream" jump="distribution" field="holding_lib" />
6208                                 </update>
6209                                 <delete permission="ADMIN_SERIAL_STREAM">
6210                                         <context link="stream" jump="distribution" field="holding_lib" />
6211                                 </delete>
6212                         </actions>
6213                 </permacrud>
6214         </class>
6215
6216         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6217                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6218                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6219                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6220                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6221                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6222                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6223                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6224                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6225                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6226                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6227                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6228                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6229                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6230                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6231                 </fields>
6232                 <links>
6233                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6234                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6235                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6236                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6237                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6238                 </links>
6239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6240                         <actions>
6241                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6242                                         <context link="subscription" field="owning_lib" />
6243                                 </create>
6244                                 <retrieve/>
6245                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6246                                         <context link="subscription" field="owning_lib" />
6247                                 </update>
6248                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6249                                         <context link="subscription" field="owning_lib" />
6250                                 </delete>
6251                         </actions>
6252                 </permacrud>
6253         </class>
6254
6255         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6256                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6257                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6258                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6259                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6260                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6261                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6262                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6263                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6264                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6265                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6266                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6267                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6268                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6269                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6270                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6271                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6272                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6273                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6274                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6275                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6276                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6277                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6278                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6279                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6280                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6281                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6282                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6283                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6284                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6285                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6286                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6287                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6288                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6289                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6290                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6291                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6292                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6293                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6294                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6295                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6296                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6297                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6298                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6299                 </fields>
6300                 <links>
6301                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6302                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6303                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6304                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6305                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6306                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6307                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6308                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6309                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6310                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6311                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6312                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6313                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6314                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6315                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6316                 </links>
6317                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6318                         <actions>
6319                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6320                                 <retrieve/>
6321                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6322                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6323                         </actions>
6324                 </permacrud>
6325         </class>
6326
6327         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6328                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6329                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6330                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6331                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6332                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6333                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6334                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6335                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6336                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6337                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6338                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6339                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6340                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6341                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6342                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6343                 </fields>
6344                 <links>
6345                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6346                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6347                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6348                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6349                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6350                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6351                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6352                 </links>
6353                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6354                         <actions>
6355                                 <create permission="ADMIN_SERIAL_ITEM">
6356                                         <context link="stream" jump="distribution" field="holding_lib" />
6357                                 </create>
6358                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6359                                         <context link="stream" jump="distribution" field="holding_lib" />
6360                                 </retrieve>
6361                                 <update permission="ADMIN_SERIAL_ITEM">
6362                                         <context link="stream" jump="distribution" field="holding_lib" />
6363                                 </update>
6364                                 <delete permission="ADMIN_SERIAL_ITEM">
6365                                         <context link="stream" jump="distribution" field="holding_lib" />
6366                                 </delete>
6367                         </actions>
6368                 </permacrud>
6369         </class>
6370
6371         <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">
6372                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6373                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6374                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6375                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6376                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6377                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6378                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6379                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6380                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6381                 </fields>
6382                 <links>
6383                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6384                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6385                 </links>
6386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6387                         <actions>
6388                                 <create permission="ADMIN_SERIAL_ITEM">
6389                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6390                                 </create>
6391                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6392                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6393                                 </retrieve>
6394                                 <update permission="ADMIN_SERIAL_ITEM">
6395                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6396                                 </update>
6397                                 <delete permission="ADMIN_SERIAL_ITEM">
6398                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6399                                 </delete>
6400                         </actions>
6401                 </permacrud>
6402         </class>
6403         <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">
6404                 <fields>
6405                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6406                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6407                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6408                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6409                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6410                 </fields>
6411                 <links>
6412                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6413                 </links>
6414         </class>
6415         <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">
6416                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6417                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6418                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6419                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6420                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6421                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6422                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6423                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6424                 </fields>
6425                 <links>
6426                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6427                 </links>
6428         </class>
6429         <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">
6430                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6431                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6432                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6433                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6434                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6435                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6436                 </fields>
6437                 <links>
6438                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6439                 </links>
6440                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6441                         <actions>
6442                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6443                                         <context link="distribution" field="holding_lib" />
6444                                 </create>
6445                                 <retrieve/>
6446                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6447                                         <context link="distribution" field="holding_lib" />
6448                                 </update>
6449                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6450                                         <context link="distribution" field="holding_lib" />
6451                                 </delete>
6452                         </actions>
6453                 </permacrud>
6454         </class>
6455
6456         <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">
6457                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6458                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6459                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6460                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6461                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6462                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6463                 </fields>
6464                 <links>
6465                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6466                 </links>
6467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6468                         <actions>
6469                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6470                                         <context link="distribution" field="holding_lib" />
6471                                 </create>
6472                                 <retrieve/>
6473                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6474                                         <context link="distribution" field="holding_lib" />
6475                                 </update>
6476                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6477                                         <context link="distribution" field="holding_lib" />
6478                                 </delete>
6479                         </actions>
6480                 </permacrud>
6481         </class>
6482
6483         <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">
6484                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6485                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6486                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6487                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6488                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6489                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6490                 </fields>
6491                 <links>
6492                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6493                 </links>
6494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6495                         <actions>
6496                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6497                                         <context link="distribution" field="holding_lib" />
6498                                 </create>
6499                                 <retrieve/>
6500                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6501                                         <context link="distribution" field="holding_lib" />
6502                                 </update>
6503                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6504                                         <context link="distribution" field="holding_lib" />
6505                                 </delete>
6506                         </actions>
6507                 </permacrud>
6508         </class>
6509
6510         <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">
6511                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6512                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6513                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6514                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6515                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6516                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6517                 </fields>
6518                 <links>
6519                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6520                 </links>
6521                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6522                         <actions>
6523                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6524                                 <retrieve/>
6525                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6526                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6527                         </actions>
6528                 </permacrud>
6529         </class>
6530
6531         <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">
6532                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6533                         <field name="id" reporter:datatype="id" />
6534                         <field name="owning_copy" reporter:datatype="link"/>
6535                         <field name="stat_cat" reporter:datatype="link"/>
6536                         <field name="stat_cat_entry" reporter:datatype="link"/>
6537                 </fields>
6538                 <links>
6539                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6540                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6541                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6542                 </links>
6543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6544                         <actions>
6545                                 <retrieve/>
6546                         </actions>
6547                 </permacrud>
6548         </class>
6549         <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">
6550                 <fields oils_persist:primary="code">
6551                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6552                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6553                 </fields>
6554                 <links/>
6555         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6556             <actions>
6557                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6558                 <retrieve/>
6559                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6560                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6561             </actions>
6562         </permacrud>
6563         </class>
6564         <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">
6565                 <fields oils_persist:primary="code">
6566                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6567                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6568                 </fields>
6569                 <links/>
6570         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6571             <actions>
6572                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6573                 <retrieve/>
6574                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6575                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6576             </actions>
6577         </permacrud>
6578         </class>
6579         <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">
6580                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6581                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6582                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6583                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6584                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6585                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6586                 </fields>
6587                 <links>
6588             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6589         </links>
6590         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6591             <actions>
6592                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6593                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6594                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6595                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6596             </actions>
6597         </permacrud>
6598         </class>
6599         <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">
6600                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6601                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6602                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6603                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6604                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6605                 </fields>
6606                 <links>
6607                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6608         </links>
6609         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6610             <actions>
6611                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6612                 <retrieve/>
6613                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6614                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6615             </actions>
6616         </permacrud>
6617         </class>
6618         <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">
6619                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6620                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6621                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6622                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6623                 </fields>
6624                 <links>
6625                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6626                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6627                 </links>
6628         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6629             <actions>
6630                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6631                 <retrieve/>
6632                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6633                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6634             </actions>
6635         </permacrud>
6636         </class>
6637         <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">
6638                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6639                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6640                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6641                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6642                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6643                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6644                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6645                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6646                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6647                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6648                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6649                 </fields>
6650                 <links>
6651                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6652                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6653                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6654                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6655                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6656                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6657                 </links>
6658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6659             <actions>
6660                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6661                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6662                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6663                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6664             </actions>
6665         </permacrud>
6666         </class>
6667         <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">
6668                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6669                         <field name="id" reporter:datatype="id" />
6670                         <field name="from_org" reporter:datatype="org_unit"/>
6671                         <field name="to_org" reporter:datatype="org_unit"/>
6672                         <field name="prox" reporter:datatype="int" />
6673                 </fields>
6674                 <links>
6675                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6676                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6677                 </links>
6678         </class>
6679         <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">
6680                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6681                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6682                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6683                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6684                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6685                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6686                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6687                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6688                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6689                 </fields>
6690                 <links/>
6691         </class>
6692         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6693                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6694                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6695                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6696                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6697                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6698                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6699                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6700                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6701                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6702                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6703                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6704                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6705                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6706                 </fields>
6707                 <links>
6708                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6709                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6710                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6711                 </links>
6712         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6713             <actions>
6714                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6715                 <retrieve/>
6716                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6717                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6718             </actions>
6719         </permacrud>
6720         </class>
6721         <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">
6722                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6723                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6724                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6725                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6726                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6727                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6728                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6729                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6730                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6731                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6732                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6733                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6734                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6735                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6736                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6737                 </fields>
6738                 <links>
6739                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6740                 </links>
6741         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6742             <actions>
6743                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6744                 <retrieve/>
6745                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6746                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6747             </actions>
6748         </permacrud>
6749         </class>
6750         <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">
6751                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6752                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6753                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6754                         <field name="query_text" reporter:datatype="text"/>
6755                 </fields>
6756         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6757             <actions>
6758                 <retrieve/>
6759             </actions>
6760         </permacrud>
6761         </class>
6762
6763         <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">
6764                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6765                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6766                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6767                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6768                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6769                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6770                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6771                 </fields>
6772                 <links>
6773                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6774                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6775                 </links>
6776         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6777             <actions>
6778                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6779                 <retrieve/>
6780                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6781                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6782             </actions>
6783         </permacrud>
6784         </class>
6785         <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">
6786                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6787                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6788                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6789                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6790                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6791                 </fields>
6792                 <links>
6793                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6794                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6795                 </links>
6796         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6797             <actions>
6798                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6799                     <context link="grp" field="owner"/>
6800                 </create>
6801                 <retrieve/>
6802                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6803                     <context link="grp" field="owner"/>
6804                 </update>
6805                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6806                     <context link="grp" field="owner"/>
6807                 </delete>
6808             </actions>
6809         </permacrud>
6810         </class>
6811
6812         <!-- A note: Please update alhr and ahopl when updating ahr -->
6813         <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">
6814                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6815                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6816                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6817                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6818                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6819                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6820                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6821                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6822                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6823                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6824                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6825                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6826                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6827                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6828                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6829                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6830                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6831                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6832                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6833                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6834                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6835                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6836                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6837                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6838                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6839                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6840                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6841                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6842                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6843                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6844                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6845                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6846                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6847                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6848                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6849                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6850                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6851                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6852                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6853                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6854                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6855                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6856                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6857                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6858                 </fields>
6859                 <links>
6860                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6861                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6862                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6863                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6864                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6865                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6866                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6867                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6868                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6869                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6870                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6871                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6872                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6873                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6874                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6875                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6876                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6877                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6878                 </links>
6879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6880                         <actions>
6881                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6882                         </actions>
6883                 </permacrud>
6884         </class>
6885         <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">
6886                 <oils_persist:source_definition><![CDATA[
6887                 SELECT DISTINCT
6888                         ahr.*,
6889                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6890                                 copy_location_order_position,
6891                         CASE WHEN au.alias IS NOT NULL THEN
6892                                 au.alias
6893                         ELSE
6894                                 au.first_given_name
6895                         END AS usr_alias_or_first_given_name,
6896                         au.first_given_name AS usr_first_given_name,
6897                         au.second_given_name AS usr_second_given_name,
6898                         au.family_name AS usr_family_name,
6899                         au.prefix AS usr_prefix,
6900                         au.suffix AS usr_suffix,
6901                         au.alias AS usr_alias,
6902                         CASE WHEN au.alias IS NOT NULL THEN
6903                                 au.alias
6904                         ELSE
6905                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6906                                         COALESCE(au.family_name, ''),
6907                                         COALESCE(au.suffix, ''),
6908                                         ', ',
6909                                         COALESCE(au.prefix, ''),
6910                                         COALESCE(au.first_given_name, ''),
6911                                         COALESCE(au.second_given_name, '')
6912                                 ], ' '), E'\\s+,', ',')
6913                         END AS usr_alias_or_display_name,
6914                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6915                                 COALESCE(au.family_name, ''),
6916                                 COALESCE(au.suffix, ''),
6917                                 ', ',
6918                                 COALESCE(au.prefix, ''),
6919                                 COALESCE(au.first_given_name, ''),
6920                                 COALESCE(au.second_given_name, '')
6921                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6922                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6923                                 AS call_number_label,
6924                         siss.label AS issuance_label,
6925                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6926                         ahcm_1.copy_count AS potential_copies
6927                 FROM action.hold_request ahr
6928                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6929                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6930                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6931                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6932                 JOIN actor.usr au ON (au.id = ahr.usr)
6933                 JOIN (
6934                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6935                         FROM asset.copy_location
6936                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6937                 LEFT JOIN actor.usr_standing_penalty ausp 
6938                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6939                 LEFT JOIN config.standing_penalty csp
6940                         ON (
6941                                 csp.id = ausp.standing_penalty AND 
6942                                 csp.block_list LIKE '%CAPTURE%' AND (
6943                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6944                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6945                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6946                                         )
6947                                 )
6948                         )
6949                 JOIN (
6950                         SELECT COUNT(target_copy) AS copy_count, hold
6951                         FROM action.hold_copy_map
6952                         GROUP BY 2
6953                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6954                 LEFT JOIN serial.issuance siss
6955                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6956                 LEFT JOIN asset.copy_location_order acplo
6957                         ON (acp.location = acplo.location AND
6958                                 acp.circ_lib = acplo.org)
6959                 WHERE
6960                         ahr.capture_time IS NULL AND
6961                         ahr.cancel_time IS NULL AND
6962                         csp.id IS NULL AND
6963                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6964                         acp.status IN (0,7)
6965                 ]]></oils_persist:source_definition>
6966                 <fields oils_persist:primary="id">
6967                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6968                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6969                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6970                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6971                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6972                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6973                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6974                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6975                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6976                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6977                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6978                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6979                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6980                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6981                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6982                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6983                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6984                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6985                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6986                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6987                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6988                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6989                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6990                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6991                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6992                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6993                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6994                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6995                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6996                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6997                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6998                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6999                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7000                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7001                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7002                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7003                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7004                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7005                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7006                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7007                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7008                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
7009                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
7010                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
7011                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
7012                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
7013                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
7014                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
7015                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
7016                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
7017                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
7018                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
7019                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
7020                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7021                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7022                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7023                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7024                 </fields>
7025                 <links>
7026                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7027                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7028                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7029                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7030                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7031                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7032                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7033                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7034                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7035                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7036                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7037                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7038                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7039                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7040                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7041                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7042                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7043                 </links>
7044                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7045                         <actions>
7046                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7047                         </actions>
7048                 </permacrud>
7049         </class>
7050         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7051                 <oils_persist:source_definition><![CDATA[
7052                         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)
7053                 ]]></oils_persist:source_definition>
7054                 <fields oils_persist:primary="id">
7055                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7056                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7057                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7058                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7059                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7060                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7061                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7062                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7063                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7064                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7065                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7066                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7067                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7068                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7069                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7070                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7071                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7072                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7073                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7074                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7075                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7076                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7077                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7078                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7079                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7080                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7081                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7082                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7083                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7084                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7085                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7086                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7087                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7088                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7089                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7090                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7091                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7092                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7093                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7094                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7095                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7096                 </fields>
7097                 <links>
7098                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7099                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7100                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7101                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7102                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7103                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7104                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7105                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7106                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7107                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7108                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7109                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7110                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7111                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7112                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7113                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7114                 </links>
7115         </class>
7116
7117         <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">
7118                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7119                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7120                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7121                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7122                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7123                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7124                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7125                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7126                 </fields>
7127                 <links>
7128                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7129                 </links>
7130                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7131                         <actions>
7132                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7133                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7134                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7135                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7136                         </actions>
7137                 </permacrud>
7138         </class>
7139         <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">
7140                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7141                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7142                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7143                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7144                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7145                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7147                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7148                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7149                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7150                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7151                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7152                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7153                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7154                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7155                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7156                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7157                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7158                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7159                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7160                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7161                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7162                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7163                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7164                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7165                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7166                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7167                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7168                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7169                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7170                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7171                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7172                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7173                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7174                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7175                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7176                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7177                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7178                 </fields>
7179                 <links>
7180                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7181                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7182                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7183                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7184                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7185                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7186                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7187                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7188                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7189                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7190                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7191                 </links>
7192                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7193                         <actions>
7194                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7195                         </actions>
7196                 </permacrud>
7197         </class>
7198         <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">
7199                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7200                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7201                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7202                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7203                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7204                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7205                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7206                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7207                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7208                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7209                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7210                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7211                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7212                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7213                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7214                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7215                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7216                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7217                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7218                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7219                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7220                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7221                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7222                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7223                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7224                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7225                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7226                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7227                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7228                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7229                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7230                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7231                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7232                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7233                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7234                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7235                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7236                 </fields>
7237                 <links>
7238                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7239                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7240                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7241                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7242                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7243                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7244                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7245                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7246                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7247                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7248                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7249                 </links>
7250                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7251                         <actions>
7252                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7253                         </actions>
7254                 </permacrud>
7255         </class>
7256
7257         <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">
7258                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7259                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7260                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7261                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7262                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7263                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7264                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7265                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7266                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7267                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7268                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7269                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7270                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7271                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7272                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7273                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7274                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7275                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7276                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7277                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7278                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7279                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7280                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7281                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7282                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7283                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7284                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7285                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7286                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7287                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7288                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7289                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7290                 </fields>
7291                 <links>
7292                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7293                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7294                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7295                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7296                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7297                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7298                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7299                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7300                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7301                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7302                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7303                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7304                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7305                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7306                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7307                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7308                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7309                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7310                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7311                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7312                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7313                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7314                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7315                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7316                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7317                 </links>
7318         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7319             <actions>
7320                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7321                 <retrieve />
7322                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7323                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7324             </actions>
7325         </permacrud>
7326         </class>
7327         <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">
7328                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7329                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7330                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7331                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7332                 </fields>
7333                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7334                         <actions>
7335                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7336                                 <retrieve/>
7337                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7338                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7339                         </actions>
7340                 </permacrud>
7341         </class>
7342         <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">
7343                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7344                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7345                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7346                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7347                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7348                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7349                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7350                 </fields>
7351                 <links>
7352                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7353                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7354                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7355                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7356                 </links>
7357                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7358                         <actions>
7359                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7360                                 <retrieve/>
7361                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7362                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7363                         </actions>
7364                 </permacrud>
7365         </class>
7366         <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">
7367                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7368                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7369                         <field name="btype" reporter:datatype="text"/>
7370                         <field name="id" reporter:datatype="id" />
7371                         <field name="name"  reporter:datatype="text"/>
7372                         <field name="description" reporter:datatype="text"/>
7373                         <field name="owner" reporter:datatype="link"/>
7374                         <field name="pub" reporter:datatype="bool"/>
7375                         <field name="create_time" reporter:datatype="timestamp" />
7376                         <field name="owning_lib" reporter:datatype="org_unit" />
7377                 </fields>
7378                 <links>
7379                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7380                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7381                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7382                 </links>
7383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7384                         <actions>
7385                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7386                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7387                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7388                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7389                         </actions>
7390                 </permacrud>
7391         </class>
7392         <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">
7393                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7394                         <field name="id" reporter:datatype="id" />
7395                         <field name="bucket" reporter:datatype="link"/>
7396                         <field name="note" reporter:datatype="text" />
7397                 </fields>
7398                 <links>
7399                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7400                 </links>
7401         </class>
7402         <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">
7403                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7404                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7405                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7406                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7407                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7408                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7409                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7410                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7411                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7412                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7413                 </fields>
7414                 <links>
7415                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7416                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7417                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7418                 </links>
7419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7420                         <actions>
7421                 <create permission="CREATE_COPY_STAT_CAT" context_field="owner"/>
7422                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7423                 <retrieve />
7424                 <update permission="UPDATE_COPY_STAT_CAT" context_field="owner"/>
7425                 <delete permission="DELETE_COPY_STAT_CAT" context_field="owner"/>
7426             </actions>
7427                 </permacrud>
7428         </class>
7429         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7430                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7431                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7432                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7433                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7434                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7435                 </fields>
7436                 <links>
7437                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7438                 </links>
7439                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7440                         <actions>
7441                                 <retrieve permission="VIEW_USER user_request.view">
7442                                         <context link="usr" field="home_ou" />
7443                                 </retrieve>
7444                         </actions>
7445                 </permacrud>
7446         </class>
7447     <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">
7448         <fields oils_persist:primary="field">
7449             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7450             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7451             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7452         </fields>
7453         <links/>
7454         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7455             <actions>
7456                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7457                 <retrieve />
7458                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7459                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7460             </actions>
7461         </permacrud>
7462     </class>
7463         <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">
7464                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7465                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
7466                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7467                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7468                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7469                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7470                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7471                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7472                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7473                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7474                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7475                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7476                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7477                 </fields>
7478                 <links>
7479                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7480                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7481                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7482                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7483                 </links>
7484         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7485             <actions>
7486                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7487                 <retrieve />
7488                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7489                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7490             </actions>
7491         </permacrud>
7492         </class>
7493         <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">
7494                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7495                         <field name="field" reporter:datatype="link"/>
7496                         <field name="id" reporter:datatype="id" />
7497                         <field name="source" reporter:datatype="link"/>
7498                         <field name="value"  reporter:datatype="text"/>
7499                 </fields>
7500                 <links>
7501                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7502                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7503                 </links>
7504         </class>
7505         <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">
7506                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7507                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7508                         <field name="btype" reporter:datatype="text"/>
7509                         <field name="id" reporter:datatype="id" />
7510                         <field name="name"  reporter:datatype="text"/>
7511                         <field name="description" reporter:datatype="text"/>
7512                         <field name="owner" reporter:datatype="link"/>
7513                         <field name="pub" reporter:datatype="bool"/>
7514                         <field name="create_time" reporter:datatype="timestamp" />
7515                         <field name="owning_lib" reporter:datatype="org_unit" />
7516                 </fields>
7517                 <links>
7518                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7519                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7520                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7521                 </links>
7522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7523                         <actions>
7524                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7525                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7526                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7527                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7528                         </actions>
7529                 </permacrud>
7530         </class>
7531         <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">
7532                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7533                         <field name="id" reporter:datatype="id" />
7534                         <field name="bucket" reporter:datatype="link"/>
7535                         <field name="note" reporter:datatype="text" />
7536                 </fields>
7537                 <links>
7538                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7539                 </links>
7540         </class>
7541         <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">
7542                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7543                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7544                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7545                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7546                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7547                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7548                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7549                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7550                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7551                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7552                 </fields>
7553                 <links>
7554                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7555                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7556                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7557                 </links>
7558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7559             <actions>
7560                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7561                     <context link="xact" jump="usr" field="home_ou"/>
7562                 </retrieve>
7563                         </actions>
7564                 </permacrud>
7565         </class>
7566         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7567                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7568                         <field name="id" reporter:datatype="id" />
7569                         <field name="ind1" />
7570                         <field name="ind2" />
7571                         <field name="record" />
7572                         <field name="subfield" />
7573                         <field name="tag" />
7574                         <field name="value" />
7575                 </fields>
7576                 <links>
7577                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7578                 </links>
7579         </class>
7580         <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">
7581                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7582                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7583                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7584                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7585                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7586                 </fields>
7587                 <links>
7588                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7589                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7590                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7591                 </links>
7592         </class>
7593         <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">
7594                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7595                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7596                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7597                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7598                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7599                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7600                 </fields>
7601                 <links>
7602                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7603                 </links>
7604         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7605             <actions>
7606                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7607                 <retrieve/>
7608                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7609                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7610             </actions>
7611         </permacrud>
7612
7613         </class>
7614         <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">
7615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7616                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7617                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7618                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7619                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7620                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7621                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7622                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7623                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7624                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7625                 </fields>
7626                 <links>
7627                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7628                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7629                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7630                 </links>
7631         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7632             <actions>
7633                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7634                 <retrieve/>
7635                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7636                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7637             </actions>
7638         </permacrud>
7639         </class>
7640         <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">
7641                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7642                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7643                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7644                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7645                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7646                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7647                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7648                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7649                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7650                 </fields>
7651                 <links>
7652                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7653                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7654                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7655                 </links>
7656                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7657                 <actions>
7658                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7659                     <retrieve/>
7660                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7661                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7662                 </actions>
7663              </permacrud>
7664         </class>
7665         <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">
7666                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7667                         <field name="balance_owed" reporter:datatype="money" />
7668                         <field name="total_owed" reporter:datatype="money" />
7669                         <field name="total_paid" reporter:datatype="money" />
7670                         <field name="usr" reporter:datatype="link"/>
7671                 </fields>
7672                 <links>
7673                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7674                 </links>
7675         </class>
7676     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7677                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7678                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7679                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7680                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7681                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7682                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7683                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7684                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7685                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7686                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7687                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7688                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7689                 </fields>
7690                 <links>
7691                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7692                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7693                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7694                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7695                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7696                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7697                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7698                 </links>
7699         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7700             <actions>
7701                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7702             </actions>
7703         </permacrud>
7704         </class>
7705         <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">
7706                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7707                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7708                         <field name="quality" reporter:datatype="int" />
7709                         <field name="source" reporter:datatype="text"/>
7710                         <field name="transcendant" reporter:datatype="bool"/>
7711                         <field name="can_have_copies" reporter:datatype="bool"/>
7712                 </fields>
7713                 <links/>
7714         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7715             <actions>
7716                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7717                 <retrieve/>
7718                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7719                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7720             </actions>
7721         </permacrud>
7722         </class>
7723         <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">
7724                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7725                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7726                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7727                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7728                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7729                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7730                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7731                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7732                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7733                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7734                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7735                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7736                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7737                 </fields>
7738                 <links>
7739                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7740                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7741                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7742                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7743                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7744                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7745                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7746                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7747                 </links>
7748                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7749                         <actions>
7750                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7751                                         <context link="usr" field="home_ou" />
7752                                 </retrieve>
7753                         </actions>
7754                 </permacrud>
7755         </class>
7756         <class id="actsce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7757                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7758                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7759                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7760                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7761                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7762                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7763                 </fields>
7764                 <links>
7765                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7766                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7767                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7768                 </links>
7769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7770                         <actions>
7771                 <create permission="CREATE_PATRON_STAT_CAT_ENTRY">
7772                     <context link="stat_cat" field="owner"/>
7773                 </create>
7774                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7775                 <update permission="UPDATE_PATRON_STAT_CAT_ENTRY">
7776                     <context link="stat_cat" field="owner"/>
7777                 </update>
7778                 <delete permission="DELETE_PATRON_STAT_CAT_ENTRY">
7779                     <context link="stat_cat" field="owner"/>
7780                 </delete>
7781                         </actions>
7782                 </permacrud>
7783         </class>
7784         <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">
7785                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7786                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7787                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7788                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7789                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7790                 </fields>
7791                 <links>
7792                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7793                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7794                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7795                 </links>
7796         </class>
7797         <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">
7798                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7799                         <field name="bucket" reporter:datatype="link"/>
7800                         <field name="id" reporter:datatype="id" />
7801                         <field name="target_user" reporter:datatype="link"/>
7802                         <field name="create_time" reporter:datatype="timestamp" />
7803                         <field name="pos" reporter:datatype="int" />
7804                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7805                 </fields>
7806                 <links>
7807                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7808                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7809             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7810                 </links>
7811                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7812                         <actions>
7813                                 <retrieve permission="ADMIN_USER_BUCKET">
7814                     <context link="bucket" field="owning_lib"/>
7815                 </retrieve>
7816             </actions>
7817         </permacrud>
7818         </class>
7819         <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">
7820                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7821                         <field name="id" reporter:datatype="id" />
7822                         <field name="staff" reporter:datatype="link"/>
7823                         <field name="bucket" reporter:datatype="link"/>
7824                         <field name="target" reporter:datatype="int" />
7825                         <field name="hold_type" reporter:datatype="text" />
7826                         <field name="run_date" reporter:datatype="timestamp" />
7827                         <field name="cancelled" reporter:datatype="timestamp" />
7828                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7829                 </fields>
7830                 <links>
7831                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7832                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7833                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7834                 </links>
7835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7836                         <actions>
7837                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7838                 <retrieve/>
7839                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7840                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7841             </actions>
7842         </permacrud>
7843         </class>
7844         <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">
7845                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7846                         <field name="id" reporter:datatype="id" />
7847                         <field name="batch_hold_event" reporter:datatype="link"/>
7848                         <field name="hold" reporter:datatype="link"/>
7849                 </fields>
7850                 <links>
7851                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7852                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7853                 </links>
7854                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7855                         <actions>
7856                 <retrieve/>
7857             </actions>
7858         </permacrud>
7859         </class>
7860         <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">
7861                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7862                         <field name="id" reporter:datatype="id" />
7863                         <field name="item" reporter:datatype="link"/>
7864                         <field name="note" reporter:datatype="text" />
7865                 </fields>
7866                 <links>
7867                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7868                 </links>
7869         </class>
7870         <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">
7871                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7872                         <field name="balance_owed" reporter:datatype="money" />
7873                         <field name="total_owed" reporter:datatype="money" />
7874                         <field name="total_paid" reporter:datatype="money" />
7875                         <field name="usr" reporter:datatype="link"/>
7876                 </fields>
7877                 <links>
7878                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7879                 </links>
7880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7881                         <actions>
7882                                 <retrieve permission="VIEW_USER">
7883                                         <context link="usr" field="home_ou"/>
7884                                 </retrieve>
7885                         </actions>
7886                 </permacrud>
7887         </class>
7888         <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">
7889                 <fields oils_persist:primary="code" oils_persist:sequence="">
7890                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7891                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7892                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7893                 </fields>
7894                 <links/>
7895         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7896             <actions>
7897                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7898                 <retrieve/>
7899                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7900                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7901             </actions>
7902         </permacrud>
7903         </class>
7904         <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">
7905                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7906                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7907                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7908                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7909                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7910                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7911                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7912                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7913                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7914                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7915                 </fields>
7916                 <links>
7917                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7918                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7919                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7920                 </links>
7921         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7922             <actions>
7923                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7924                     <context link="xact" jump="usr" field="home_ou"/>
7925                 </retrieve>
7926                         </actions>
7927                 </permacrud>
7928         </class>
7929         <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">
7930                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7931                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7932                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7933                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7934                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7935                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7936                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7937                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7938                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7939                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7940                 </fields>
7941                 <links>
7942                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7943                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7944                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7945                 </links>
7946         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7947             <actions>
7948                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7949                     <context link="xact" jump="usr" field="home_ou"/>
7950                 </retrieve>
7951                         </actions>
7952                 </permacrud>
7953         </class>
7954         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7955                 <fields oils_persist:primary="id" oils_persist:sequence="">
7956                         <field name="checkin_lib" reporter:datatype="link"/>
7957                         <field name="checkin_staff" reporter:datatype="link"/>
7958                         <field name="checkin_time" reporter:datatype="timestamp"/>
7959                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7960                         <field name="circ_staff" reporter:datatype="link"/>
7961                         <field name="desk_renewal" reporter:datatype="bool"/>
7962                         <field name="due_date" reporter:datatype="timestamp"/>
7963                         <field name="duration" reporter:datatype="interval"/>
7964                         <field name="duration_rule" reporter:datatype="link"/>
7965                         <field name="fine_interval" reporter:datatype="interval"/>
7966                         <field name="id" reporter:datatype="id" />
7967                         <field name="max_fine" reporter:datatype="money" />
7968                         <field name="max_fine_rule" reporter:datatype="link"/>
7969                         <field name="opac_renewal" reporter:datatype="bool"/>
7970                         <field name="phone_renewal" reporter:datatype="bool"/>
7971                         <field name="recurring_fine" reporter:datatype="money" />
7972                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7973                         <field name="renewal_remaining" reporter:datatype="int" />
7974             <field name="grace_period" reporter:datatype="interval" />
7975                         <field name="stop_fines" reporter:datatype="text"/>
7976                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7977                         <field name="target_copy" reporter:datatype="link"/>
7978                         <field name="usr" reporter:datatype="link"/>
7979                         <field name="xact_finish" reporter:datatype="timestamp" />
7980                         <field name="xact_start" reporter:datatype="timestamp" />
7981                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7982                         <field name="auto_renewal" reporter:datatype="bool"/>
7983                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7984                 </fields>
7985                 <links>
7986                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7987                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7988                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7989                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7990                 </links>
7991         </class>
7992         <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">
7993                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7994                         <field name="field" reporter:datatype="link"/>
7995                         <field name="id" reporter:datatype="id" />
7996                         <field name="source" reporter:datatype="link"/>
7997                         <field name="value" reporter:datatype="text"/>
7998                 </fields>
7999                 <links>
8000                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8001                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8002                 </links>
8003         </class>
8004         <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">
8005                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
8006                         <field name="high" reporter:datatype="money" />
8007                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
8008                         <field name="low" reporter:datatype="money" />
8009                         <field name="name" reporter:datatype="text"/>
8010                         <field name="normal" reporter:datatype="money" />
8011                         <field name="recurrence_interval" reporter:datatype="interval"/>
8012             <field name="grace_period" reporter:datatype="interval" />
8013                 </fields>
8014                 <links/>
8015         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8016             <actions>
8017                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8018                 <retrieve/>
8019                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8020                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
8021             </actions>
8022         </permacrud>
8023         </class>
8024         <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">
8025                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8026                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8027                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8028                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8029                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8030                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
8031                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8032                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8033                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8034                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8035                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8036                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8037                 </fields>
8038                 <links>
8039                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8040                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8041                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8042                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8043                 </links>
8044         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8045             <actions>
8046                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8047                     <context link="xact" jump="usr" field="home_ou"/>
8048                 </retrieve>
8049                         </actions>
8050                 </permacrud>
8051         </class>
8052         <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">
8053                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8054                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8055                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8056                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8057                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8058                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8059                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8060                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8061                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8062                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8063                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8064                 </fields>
8065                 <links>
8066                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8067                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8068                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8069                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8070                 </links>
8071         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8072             <actions>
8073                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8074                     <context link="xact" jump="usr" field="home_ou"/>
8075                 </retrieve>
8076                         </actions>
8077                 </permacrud>
8078         </class>
8079         <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">
8080                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8081                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8082                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8083                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8084                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8085                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8086                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8087                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8088                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8089                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8090                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8091                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8092                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8093                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8094                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8095                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8096                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8097                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8098                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8099                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8100                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8101                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8102                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8103                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8104                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8105                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8106                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8107                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8108                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8109                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8110                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8111                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8112                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8113                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8114                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8115                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8116                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8117                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8118                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8119                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8120                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8121                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8122                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8123                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8124                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8125                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8126                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8127                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8128                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8129                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8130                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8131                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8132                 </fields>
8133                 <links>
8134                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8135                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8136                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8137                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8138                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8139                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8140                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8141                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8142                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8143                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8144                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8145                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8146                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8147                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8148                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8149                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8150                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8151                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8152                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8153                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8154                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8155                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8156                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8157                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8158                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8159                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8160                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8161                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8162                 </links>
8163         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8164             <actions>
8165                 <create permission="CREATE_COPY">
8166                     <context link="call_number" field="owning_lib"/>
8167                 </create>
8168                 <retrieve/>
8169                 <update permission="UPDATE_COPY">
8170                     <context link="call_number" field="owning_lib"/>
8171                 </update>
8172                 <delete permission="DELETE_COPY">
8173                     <context link="call_number" field="owning_lib"/>
8174                 </delete>
8175             </actions>
8176         </permacrud>
8177         </class>
8178
8179         <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">
8180                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8181                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8182                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8183                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8184                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8185                 </fields>
8186                 <links>
8187                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8188                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8189                 </links>
8190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8191                         <actions>
8192                 <create permission="STAFF_LOGIN"/>
8193                 <retrieve/>
8194                 <update permission="STAFF_LOGIN"/>
8195                 <delete permission="STAFF_LOGIN"/>
8196                         </actions>
8197                 </permacrud>
8198         </class>
8199
8200         <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">
8201                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8202             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8203                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8204                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8205                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8206                 </fields>
8207                 <links>
8208                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8209                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8210                 </links>
8211         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8212             <actions>
8213                                 <retrieve/>
8214             </actions>
8215         </permacrud>
8216         </class>
8217
8218         <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">
8219                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8220                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8221                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8222                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8223                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8224                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8225                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8226                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8227                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8228                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8229                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8230                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8231                 </fields>
8232                 <links>
8233                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8234                 </links>
8235         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8236             <actions>
8237                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8238                 <retrieve/>
8239                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8240                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8241             </actions>
8242         </permacrud>
8243         </class>
8244
8245         <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">
8246                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8247                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8248                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8249                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8250                 </fields>
8251                 <links>
8252                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8253                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8254                 </links>
8255         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8256             <actions>
8257                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8258                 <retrieve/>
8259                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8260                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8261             </actions>
8262         </permacrud>
8263         </class>
8264
8265         <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">
8266                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8267                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8268                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8269                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8270                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8271                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8272                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8273                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8274                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8275                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8276                 </fields>
8277                 <links>
8278                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8279                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8280                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8281                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8282                 </links>
8283         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8284             <actions>
8285                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8286                     <context link="copy" field="circ_lib"/>
8287                 </create>
8288                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8289                     <context link="copy" field="circ_lib"/>
8290                                 </retrieve>
8291                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8292                     <context link="copy" field="circ_lib"/>
8293                                 </update>
8294                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8295                     <context link="copy" field="circ_lib"/>
8296                                 </delete>
8297             </actions>
8298         </permacrud>
8299         </class>
8300
8301         <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">
8302                 <fields oils_persist:primary="id">
8303                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8304                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8305                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8306                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8307                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8308                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8309                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8310                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8311                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8312                 </fields>
8313                 <links>
8314                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8315                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8316                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8317                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8318                 </links>
8319         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8320             <actions>
8321                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8322                     <context link="copy" field="circ_lib"/>
8323                 </create>
8324                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8325                     <context link="copy" field="circ_lib"/>
8326                                 </retrieve>
8327                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8328                     <context link="copy" field="circ_lib"/>
8329                                 </update>
8330                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8331                     <context link="copy" field="circ_lib"/>
8332                                 </delete>
8333             </actions>
8334         </permacrud>
8335         </class>
8336
8337         <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">
8338                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8339                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8340                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8341                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8342                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8343                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8344                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8345                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8346                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8347                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8348                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8349                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8350                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8351                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8352                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8353                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8354                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8355                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8356                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8357                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8358                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8359                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8360                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8361                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8362                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8363                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8364                 </fields>
8365                 <links>
8366                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8367                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8368                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8369                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8370                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8371                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8372                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8373                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8374                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8375                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8376                 </links>
8377                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8378                         <actions>
8379                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8380                                 <retrieve />
8381                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8382                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8383                         </actions>
8384                 </permacrud>
8385         </class>
8386
8387         <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">
8388                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8389                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8390                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8391                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8392                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8393                 </fields>
8394                 <links/>
8395         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8396             <actions>
8397                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8398                 <retrieve/>
8399                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8400                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8401             </actions>
8402         </permacrud>
8403         </class>
8404         <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">
8405                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8406                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8407                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8408                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8409                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8410                 </fields>
8411                 <links/>
8412         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8413             <actions>
8414                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8415                 <retrieve/>
8416                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8417                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8418             </actions>
8419         </permacrud>
8420         </class>
8421         <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">
8422                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8423                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8424                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8425                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8426                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8427                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8428                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8429                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8430                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8431                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8432                 </fields>
8433                 <links>
8434                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8435                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8436                 </links>
8437         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8438             <actions>
8439                 <create permission="CREATE_PERM" global_required="true"/>
8440                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8441                 <update permission="UPDATE_PERM" global_required="true"/>
8442                 <delete permission="DELETE_PERM" global_required="true"/>
8443             </actions>
8444         </permacrud>
8445         </class>
8446         <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">
8447                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8448                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8449                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8450                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8451                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8452                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8453                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8454                 </fields>
8455                 <links>
8456                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8457                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8458                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8459                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8460                 </links>
8461                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8462                         <actions>
8463                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8464                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8465                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8466                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8467                         </actions>
8468                 </permacrud>
8469         </class>
8470         <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">
8471                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8472                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8473                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8474                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8475                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8476                 </fields>
8477                 <links>
8478                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8479                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8480                 </links>
8481         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8482             <actions>
8483                 <create permission="ADMIN_SURVEY">
8484                     <context link="question" jump="survey" field="owner"/>
8485                 </create>
8486                 <retrieve/>
8487                 <update permission="ADMIN_SURVEY">
8488                     <context link="question" jump="survey" field="owner"/>
8489                 </update>
8490                 <delete permission="ADMIN_SURVEY">
8491                     <context link="question" jump="survey" field="owner"/>
8492                 </delete>
8493             </actions>
8494         </permacrud>
8495         </class>
8496         <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">
8497                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8498                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8499                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8500                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8501                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8502                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8503                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8504                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8505                 </fields>
8506                 <links>
8507                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8508                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8509                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8510                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8511                 </links>
8512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8513                         <actions>
8514                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8515                         </actions>
8516                 </permacrud>
8517         </class>
8518         <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">
8519                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8520                         <field name="balance_owed" reporter:datatype="money" />
8521                         <field name="total_owed" reporter:datatype="money" />
8522                         <field name="total_paid" reporter:datatype="money" />
8523                         <field name="usr" reporter:datatype="link"/>
8524                 </fields>
8525                 <links>
8526                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8527                 </links>
8528         </class>
8529         <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">
8530                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8531                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8532                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8533                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8534                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8535                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8536                 </fields>
8537                 <links>
8538                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8539                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8540                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8541                 </links>
8542         </class>
8543         <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">
8544                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8545                         <field name="field" reporter:datatype="link"/>
8546                         <field name="id" reporter:datatype="id" />
8547                         <field name="source" reporter:datatype="link"/>
8548                         <field name="value" reporter:datatype="text"/>
8549                 </fields>
8550                 <links>
8551                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8552                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8553                 </links>
8554         </class>
8555         <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">
8556                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8557                         <field name="field" reporter:datatype="link"/>
8558                         <field name="id" reporter:datatype="id" />
8559                         <field name="source" reporter:datatype="link"/>
8560                         <field name="value" reporter:datatype="text"/>
8561                 </fields>
8562                 <links>
8563                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8564                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8565                 </links>
8566         </class>
8567         <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">
8568                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8569                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8570                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8571                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8572                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8573                 </fields>
8574                 <links>
8575                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8576                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8577                 </links>
8578         </class>
8579         <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">
8580                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8581                         <field name="depth" reporter:datatype="int" />
8582                         <field name="grantable" reporter:datatype="bool"/>
8583                         <field name="grp" reporter:datatype="link"/>
8584                         <field name="id" reporter:datatype="id" />
8585                         <field name="perm" reporter:datatype="link"/>
8586                 </fields>
8587                 <links>
8588                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8589                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8590                 </links>
8591         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8592             <actions>
8593                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8594                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8595                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8596                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8597             </actions>
8598         </permacrud>
8599         </class>
8600         <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">
8601                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8602                         <field name="items" oils_persist:virtual="true" />
8603                         <field name="btype" reporter:datatype="text"/>
8604                         <field name="id" reporter:datatype="id" />
8605                         <field name="name" reporter:datatype="text"/>
8606                         <field name="description" reporter:datatype="text"/>
8607                         <field name="owner" reporter:datatype="link"/>
8608                         <field name="pub" reporter:datatype="bool"/>
8609                         <field name="create_time" reporter:datatype="timestamp" />
8610                         <field name="owning_lib" reporter:datatype="org_unit" />
8611                 </fields>
8612                 <links>
8613                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8614                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8615                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8616                 </links>
8617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8618                         <actions>
8619                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8620                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8621                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8622                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8623                         </actions>
8624                 </permacrud>
8625         </class>
8626         <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">
8627                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8628                         <field name="id" reporter:datatype="id" />
8629                         <field name="bucket" reporter:datatype="link"/>
8630                         <field name="note" reporter:datatype="text" />
8631                 </fields>
8632                 <links>
8633                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8634                 </links>
8635         </class>
8636         <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">
8637                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8638                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8639                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8640                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8641                 </fields>
8642                 <links>
8643                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8644                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8645                 </links>
8646         </class>
8647         <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">
8648                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8649                         <field name="depth" reporter:datatype="int"/>
8650                         <field name="grantable" reporter:datatype="bool"/>
8651                         <field name="id" reporter:datatype="id" />
8652                         <field name="perm" reporter:datatype="link"/>
8653                         <field name="usr" reporter:datatype="link"/>
8654                 </fields>
8655                 <links>
8656                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8657                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8658                 </links>
8659         </class>
8660         <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">
8661                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8662                         <field name="object_id" reporter:datatype="text"/>
8663                         <field name="grantable" reporter:datatype="bool"/>
8664                         <field name="id" reporter:datatype="id" />
8665                         <field name="perm" reporter:datatype="link"/>
8666                         <field name="usr" reporter:datatype="link"/>
8667                         <field name="object_type" reporter:datatype="text"/>
8668                 </fields>
8669                 <links>
8670                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8671                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8672                 </links>
8673         </class>
8674         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8675                 <fields oils_persist:primary="id" oils_persist:sequence="">
8676                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8677                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8678                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8679                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8680                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8681                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8682                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8683                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8684                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8685                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8686                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8687                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8688                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8689                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8690                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8691                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8692                 </fields>
8693                 <links>
8694                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8695                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8696                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8697                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8698                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8699                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8700                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8701                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8702                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8703                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8704                 </links>
8705         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8706             <actions>
8707                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8708                     <context link="xact" jump="usr" field="home_ou"/>
8709                 </retrieve>
8710                         </actions>
8711                 </permacrud>
8712         </class>
8713         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8714                 oils_obj:fieldmapper="money::aged_payment" 
8715                 oils_persist:tablename="money.aged_payment" 
8716                 reporter:label="Payments: Aged">
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="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="mab"/>
8734                 </links>
8735                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8736                         <actions>
8737                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8738                                         <context link="xact" field="usr_home_ou"/>
8739                                 </retrieve>
8740                         </actions>
8741                 </permacrud>
8742         </class>
8743         <class id="mallp" controller="open-ils.cstore" 
8744                 oils_obj:fieldmapper="money::all_payments" 
8745                 oils_persist:tablename="money.all_payments" 
8746                 oils_persist:readonly="true" reporter:core="true"
8747                 reporter:label="Payments: All">
8748                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8749                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8750                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8751                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8752                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8753                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8754                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8755                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8756                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8757                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8758                         <field name="billing" reporter:datatype="link"/>
8759                 </fields>
8760                 <links>
8761                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8762                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8763                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8764                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8765                 </links>
8766         </class>
8767
8768         <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">
8769                 <fields oils_persist:primary="id" oils_persist:sequence="">
8770                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8771                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8772                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8773                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8774                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8775                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8776                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8777                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8778                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8779                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8780                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8781                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8782                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8783                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8784                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8785                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8786                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8787                 </fields>
8788                 <links>
8789                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8790                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8791                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8792                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8793                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8794                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8795                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8796                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8797                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8798                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8799                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8800                 </links>
8801                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8802                         <actions>
8803                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8804                                         <context link="xact" jump="usr" field="home_ou"/>
8805                                 </retrieve>
8806                         </actions>
8807                 </permacrud>
8808         </class>
8809         <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">
8810                 <fields oils_persist:primary="id" oils_persist:sequence="">
8811                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8812                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8813                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8814                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8815                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8816                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8817                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8818                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8819                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8820                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8821                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8822                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8823                 </fields>
8824                 <links>
8825                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8826                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8827                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8828                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8829                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8830                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8831                 </links>
8832         </class>
8833         <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">
8834                 <fields oils_persist:primary="id" oils_persist:sequence="">
8835                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8836                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8837                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8838                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8839                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8840                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8841                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8842                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8843                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8844                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8845                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8846                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8847                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8848                 </fields>
8849                 <links>
8850                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8851                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8852                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8853                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8854                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8855                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8856                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8857                 </links>
8858         </class>
8859         <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">
8860                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8861                         <field name="bucket" reporter:datatype="link"/>
8862                         <field name="id" reporter:datatype="id" />
8863                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8864                         <field name="create_time" reporter:datatype="timestamp" />
8865                         <field name="pos" reporter:datatype="int" />
8866                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8867                 </fields>
8868                 <links>
8869                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8870                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8871             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8872                 </links>
8873                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8874                         <actions>
8875                                 <retrieve permission="ADMIN_COPY_BUCKET">
8876                     <context link="bucket" field="owning_lib"/>
8877                 </retrieve>
8878             </actions>
8879         </permacrud>
8880         </class>
8881         <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">
8882                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8883                         <field name="id" reporter:datatype="id" />
8884                         <field name="item" reporter:datatype="link"/>
8885                         <field name="note" reporter:datatype="text" />
8886                 </fields>
8887                 <links>
8888                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8889                 </links>
8890         </class>
8891         <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">
8892                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8893                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8894                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8895                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8896                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8897                 </fields>
8898                 <links>
8899                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8900                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8901                 </links>
8902                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8903                         <actions>
8904                 <create permission="CREATE_COPY_STAT_CAT_ENTRY">
8905                     <context link="stat_cat" field="owner"/>
8906                 </create>
8907                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8908                 <update permission="UPDATE_COPY_STAT_CAT_ENTRY">
8909                     <context link="stat_cat" field="owner"/>
8910                 </update>
8911                 <delete permission="DELETE_COPY_STAT_CAT_ENTRY">
8912                     <context link="stat_cat" field="owner"/>
8913                 </delete>
8914                         </actions>
8915                 </permacrud>
8916         </class>
8917     <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">
8918         <fields oils_persist:primary="field">
8919             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8920             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8921             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8922         </fields>
8923         <links/>
8924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8925             <actions>
8926                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8927                 <retrieve />
8928                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8929                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8930             </actions>
8931         </permacrud>
8932     </class>
8933         <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">
8934                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8935                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8936                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8937                         <field reporter:label="Manual Use?" name="manual" reporter:datatype="bool" />
8938                 </fields>
8939                 <links/>
8940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8941             <actions>
8942                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8943                 <retrieve/>
8944                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8945                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8946             </actions>
8947         </permacrud>
8948         </class>
8949
8950
8951         <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">
8952                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8953                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8954                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8955                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8956                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8957                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8958                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8959                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8960                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8961                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8962                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8963                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8964                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8965                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8966                 </fields>
8967                 <links>
8968                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8969                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8970                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8971                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8972                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8973                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8974                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8975                 </links>
8976         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8977             <actions>
8978                 <create permission="TRANSIT_COPY">
8979                     <context link="target_copy" field="owner"/>
8980                 </create>
8981                 <retrieve/>
8982                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8983                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8984             </actions>
8985         </permacrud>
8986         </class>
8987         <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">
8988                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8989                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8990                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8991                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8992                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8993                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8994                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8995                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8996                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8997                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8998                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8999                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
9000                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
9001                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
9002                 </fields>
9003                 <links>
9004                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
9005                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
9006                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
9007                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
9008                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
9009                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
9010                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9011                 </links>
9012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9013             <actions>
9014                 <create permission="TRANSIT_COPY" context_field="owner">
9015                     <context link="target_copy" field="circ_lib"/>
9016                 </create>
9017                 <retrieve/>
9018                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
9019                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
9020             </actions>
9021         </permacrud>
9022         </class>
9023         <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">
9024                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9025                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9026                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9027                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9028                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9029                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9030                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9031                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9032                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9033                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9034                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9035                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9036                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9037                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9038                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
9039                 </fields>
9040                 <links>
9041                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9042                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9043                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9044                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
9045                 </links>
9046         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9047             <actions>
9048                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9049                     <context link="xact" jump="usr" field="home_ou"/>
9050                 </retrieve>
9051                         </actions>
9052                 </permacrud>
9053         </class>
9054         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9055                 oils_obj:fieldmapper="money::aged_billing" 
9056                 oils_persist:tablename="money.aged_billing" 
9057                 reporter:label="Aged Billing Line Item">
9058                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9059                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9060                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9061                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9062                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9063                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9064                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9065                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9066                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9067                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9068                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9069                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9070                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9071                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9072                 </fields>
9073                 <links>
9074                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9075                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9076                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9077                 </links>
9078                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9079                         <actions>
9080                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9081                                         <context link="xact" field="usr_home_ou"/>
9082                                 </retrieve>
9083                         </actions>
9084                 </permacrud>
9085         </class>
9086         <class id="mallb" controller="open-ils.cstore" 
9087                 oils_obj:fieldmapper="money::all_billings" 
9088                 oils_persist:tablename="money.all_billings" 
9089                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9090                 <fields oils_persist:primary="id" oils_persist:sequence="">
9091                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9092                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9093                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9094                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9095                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9096                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9097                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9098                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9099                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9100                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9101                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9102                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9103                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9104                 </fields>
9105                 <links>
9106                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9107                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9108                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9109                 </links>
9110         </class>
9111         <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">
9112                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9113                         <field name="grp" />
9114                         <field name="id" reporter:datatype="id" />
9115                         <field name="usr" />
9116                 </fields>
9117                 <links>
9118                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9119                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9120                 </links>
9121         </class>
9122         <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">
9123                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9124                         <field name="id" reporter:datatype="id" />
9125                         <field name="fq_field" reporter:datatype="text"/>
9126                         <field name="identity_value" reporter:datatype="text"/>
9127                         <field name="translation" reporter:datatype="text"/>
9128                         <field name="string" reporter:datatype="text"/>
9129                 </fields>
9130                 <links>
9131                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9132                 </links>
9133         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9134             <actions>
9135                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9136                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9137                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9138                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9139             </actions>
9140         </permacrud>
9141         </class>
9142         <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">
9143                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9144                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9145                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9146                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9147                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9148                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9149                 </fields>
9150                 <links>
9151                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9152                 </links>
9153         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9154             <actions>
9155                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9156                 <retrieve/>
9157                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9158                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9159             </actions>
9160         </permacrud>
9161         </class>
9162         <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">
9163                 <fields oils_persist:primary="code">
9164                         <field name="code" reporter:datatype="id" />
9165                         <field name="marc_code" reporter:datatype="text"/>
9166                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9167                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9168                         <field name="rtl" reporter:datatype="bool"/>
9169                 </fields>
9170                 <links/>
9171         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9172             <actions>
9173                 <create permission="CREATE_LOCALE" global_required="true"/>
9174                 <retrieve/>
9175                 <update permission="UPDATE_LOCALE" global_required="true"/>
9176                 <delete permission="DELETE_LOCALE" global_required="true"/>
9177             </actions>
9178         </permacrud>
9179         </class>
9180         <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">
9181                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9182                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9183                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9184                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9185                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9186                 </fields>
9187                 <links>
9188                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9189                 </links>
9190         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9191             <actions>
9192                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9193                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9194                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9195                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9196             </actions>
9197         </permacrud>
9198         </class>
9199
9200         <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">
9201                 <fields oils_persist:primary="id">
9202                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9203                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9204                 </fields>
9205                 <links/>
9206         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9207             <actions>
9208                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9209                 <retrieve/>
9210                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9211                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9212             </actions>
9213         </permacrud>
9214         </class>
9215
9216         <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">
9217                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9218                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9219                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9220                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9221                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9222                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9223                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9224                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9225                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9226                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9227                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9228                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9229                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9230                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9231                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9232                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9233                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9234                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9235                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9236                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9237                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9238                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9239                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9240                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9241                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9242                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9243                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9244                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9245                 </fields>
9246                 <links>
9247                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9248                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9249                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9250                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9251                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9252                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9253                 </links>
9254         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9255             <actions>
9256                 <create permission="user_request.create">
9257                     <context link="usr" field="home_ou"/>
9258                                 </create>
9259                 <retrieve permission="user_request.view">
9260                     <context link="usr" field="home_ou"/>
9261                                 </retrieve>
9262                 <update permission="user_request.update">
9263                     <context link="usr" field="home_ou"/>
9264                                 </update>
9265                 <delete permission="user_request.delete">
9266                     <context link="usr" field="home_ou"/>
9267                                 </delete>
9268             </actions>
9269         </permacrud>
9270         </class>
9271
9272         <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">
9273         <oils_persist:source_definition><![CDATA[
9274             SELECT r.*, CASE
9275                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9276                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9277                         WHEN l.state = 'received' THEN 5 -- Received
9278                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9279                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9280                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9281                         WHEN l.id IS NULL THEN 1 -- New
9282                         ELSE 0 -- Error
9283                     END AS request_status
9284                     ,u.home_ou
9285             FROM      acq.user_request r
9286             JOIN actor.usr u ON (r.usr = u.id)
9287             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9288             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9289             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9290         ]]></oils_persist:source_definition>
9291                 <fields oils_persist:primary="id">
9292                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9293                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9294                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9295                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9296                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9297                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9298                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9299                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9300                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9301                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9302                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9303                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9304                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9305                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9306                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9307                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9308                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9309                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9310                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9311                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9312                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9313                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9314                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9315                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9316                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9317                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9318                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9319                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9320                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9321                 </fields>
9322                 <links>
9323                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9324                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9325                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9326                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9327                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9328                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9329                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9330                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9331                 </links>
9332         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9333             <actions>
9334                 <retrieve permission="user_request.view">
9335                     <context link="usr" field="home_ou"/>
9336                                 </retrieve>
9337             </actions>
9338         </permacrud>
9339         </class>
9340
9341         <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">
9342                 <fields oils_persist:primary="id">
9343                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9344                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9345                 </fields>
9346                 <links/>
9347         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9348             <actions>
9349                 <retrieve/>
9350             </actions>
9351         </permacrud>
9352         </class>
9353
9354         <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">
9355                 <fields oils_persist:primary="code">
9356                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9357                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9358                 </fields>
9359                 <links/>
9360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9361             <actions>
9362                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9363                 <retrieve/>
9364                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9365                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9366             </actions>
9367         </permacrud>
9368         </class>
9369
9370         <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">
9371                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9372                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9373                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9374                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9375                         <field reporter:label="Ratio" name="ratio" />
9376                 </fields>
9377                 <links>
9378                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9379                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9380                 </links>
9381                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9382                         <actions>
9383                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9384                                 <retrieve/>
9385                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9386                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9387                         </actions>
9388                 </permacrud>
9389         </class>
9390
9391         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9392                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9393                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9394                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9395                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9396                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9397                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9398                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9399                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9400                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9401                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9402                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9403                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9404                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9405                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9406                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9407                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9408                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9409                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9410                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9411                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9412                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9413                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9414                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9415                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9416                 </fields>
9417                 <links>
9418                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9419                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9420                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9421                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9422                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9423                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9424                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9425                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9426                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9427                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9428                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9429                 </links>
9430         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9431             <actions>
9432                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9433                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9434                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9435                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9436             </actions>
9437         </permacrud>
9438         </class>
9439
9440         <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">
9441                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9442                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9443                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9444                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9445                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9446                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9447                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9448                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9449                 </fields>
9450                 <links>
9451                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9452                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9453                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9454                 </links>
9455         </class>
9456
9457         <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">
9458                 <fields oils_persist:primary="code">
9459                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9460                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9461                 </fields>
9462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9463             <actions>
9464                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9465                 <retrieve/>
9466                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9467                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9468             </actions>
9469                 </permacrud>
9470         </class>
9471
9472         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9473                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9474                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9475                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9476                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9477                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9478                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9479                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9480                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9481                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9482                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9483                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9484                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9485                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9486                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9487                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9488                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9489                 </fields>
9490                 <links>
9491                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9492                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9493                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9494                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9495                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9496                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9497                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9498                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9499                 </links>
9500         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9501             <actions>
9502                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9503                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9504                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9505                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9506             </actions>
9507         </permacrud>
9508         </class>
9509
9510         <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">
9511                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9512                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9513                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9514                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9515                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9516                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9517                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9518                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9519                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9520                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9521                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9522                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9523                 </fields>
9524                 <links>
9525                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9526                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9527                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9528                 </links>
9529         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9530             <actions>
9531                 <create   permission="ADMIN_INVOICE">
9532                                         <context link="invoice" field="receiver"/>
9533                                 </create>
9534                 <retrieve permission="ADMIN_INVOICE">
9535                                         <context link="invoice" field="receiver"/>
9536                                 </retrieve>
9537                 <update   permission="ADMIN_INVOICE">
9538                                         <context link="invoice" field="receiver"/>
9539                                 </update>
9540                                 <delete   permission="ADMIN_INVOICE">
9541                                         <context link="invoice" field="receiver"/>
9542                                 </delete>
9543             </actions>
9544         </permacrud>
9545         </class>
9546
9547         <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">
9548                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9549                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9550                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9551                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9552                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9553                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9554                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9555                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9556                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9557                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9558                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9559                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9560                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9561                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9562                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9563                 </fields>
9564                 <links>
9565                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9566                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9567                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9568                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9569                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9570                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9571                 </links>
9572         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9573             <actions>
9574                 <create   permission="ADMIN_INVOICE">
9575                                         <context link="invoice" field="receiver"/>
9576                                 </create>
9577                 <retrieve permission="ADMIN_INVOICE">
9578                                         <context link="invoice" field="receiver"/>
9579                                 </retrieve>
9580                 <update   permission="ADMIN_INVOICE">
9581                                         <context link="invoice" field="receiver"/>
9582                                 </update>
9583                                 <delete   permission="ADMIN_INVOICE">
9584                                         <context link="invoice" field="receiver"/>
9585                                 </delete>
9586             </actions>
9587         </permacrud>
9588         </class>
9589
9590         <class id="acqsn" 
9591                 controller="open-ils.cstore open-ils.pcrud" 
9592                 oils_obj:fieldmapper="acq::shipment_notification" 
9593                 oils_persist:tablename="acq.shipment_notification" reporter:label="Shipment Notification">
9594                 <fields oils_persist:primary="id" oils_persist:sequence="acq.shipment_notification_id_seq">
9595                         <field reporter:label="Shipment Notification ID" name="id" reporter:datatype="id"/>
9596                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9597                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9598                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9599                         <field reporter:label="Receive Date" name="recv_date" reporter:datatype="timestamp" />
9600                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9601                         <field reporter:label="Process Date" name="process_date" reporter:datatype="timestamp" />
9602                         <field reporter:label="Processed By" name="processed_by" reporter:datatype="link" />
9603                         <field reporter:label="Container Barcode" name="container_code" reporter:datatype="text" />
9604                         <field reporter:label="Lading Number" name="lading_number" reporter:datatype="text" />
9605                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9606                         <field reporter:label="Shipment Notification Entries" name="entries" 
9607                                 reporter:datatype="link" oils_persist:virtual="true"/>
9608                 </fields>
9609                 <links>
9610                         <link field="processed_by" reltype="has_a" key="id" map="" class="au"/>
9611                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9612                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9613                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9614                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9615                         <link field="entries" reltype="has_many" key="shipment_notification" map="" class="acqsne"/>
9616                 </links>
9617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9618                         <actions>
9619                                 <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9620                                 <update   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9621                                 <delete   permission="MANAGE_SHIPMENT_NOTIFICATION" context_field="receiver"/>
9622                         </actions>
9623                 </permacrud>
9624         </class>
9625
9626         <class id="acqsne" 
9627                 controller="open-ils.cstore open-ils.pcrud" 
9628                 oils_obj:fieldmapper="acq::shipment_notification_entry" 
9629                 oils_persist:tablename="acq.shipment_notification_entry" 
9630                 reporter:label="Shipment Notification Entry">
9631                 <fields oils_persist:primary="id" 
9632                         oils_persist:sequence="acq.shipment_notification_entry_id_seq">
9633                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9634                         <field reporter:label="Shipment Notification" name="shipment_notification" reporter:datatype="link" />
9635                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link"/>
9636                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int" />
9637                 </fields>
9638                 <links>
9639                         <link field="shipment_notification" reltype="has_a" key="id" map="" class="acqsn"/>
9640                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9641                 </links>
9642                         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9643                                 <actions>
9644                                         <retrieve permission="MANAGE_SHIPMENT_NOTIFICATION VIEW_SHIPMENT_NOTIFICATION">
9645                                                 <context link="shipment_notification" field="receiver"/>
9646                                         </retrieve>
9647                                         <update permission="MANAGE_SHIPMENT_NOTIFICATION">
9648                                                 <context link="shipment_notification" field="receiver"/>
9649                                         </update>
9650                                         <delete permission="MANAGE_SHIPMENT_NOTIFICATION">
9651                                                 <context link="shipment_notification" field="receiver"/>
9652                                         </delete>
9653                                 </actions>
9654                         </permacrud>
9655         </class>
9656
9657         <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">
9658                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9659                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9660                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9661                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9662                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9663                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9664                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9665                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9666                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9667                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9668                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9669                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9670                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9671                 </fields>
9672                 <links>
9673                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9674                 </links>
9675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9676             <actions>
9677                 <create permission="ADMIN_PROVIDER">
9678                     <context link="provider" field="owner"/>
9679                 </create>
9680                 <retrieve permission="ADMIN_PROVIDER">
9681                     <context link="provider" field="owner"/>
9682                 </retrieve>
9683                 <update permission="ADMIN_PROVIDER">
9684                     <context link="provider" field="owner"/>
9685                 </update>
9686                 <delete permission="ADMIN_PROVIDER">
9687                     <context link="provider" field="owner"/>
9688                 </delete>
9689             </actions>
9690         </permacrud>
9691         </class>
9692
9693         <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">
9694                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9695                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9696                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9697                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9698                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9699                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9700                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9701                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9702         </fields>
9703                 <links>
9704                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9705                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9706                 </links>
9707         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9708             <actions>
9709                 <create permission="ADMIN_PROVIDER">
9710                     <context link="provider" field="owner"/>
9711                 </create>
9712                 <retrieve permission="ADMIN_PROVIDER">
9713                     <context link="provider" field="owner"/>
9714                 </retrieve>
9715                 <update permission="ADMIN_PROVIDER">
9716                     <context link="provider" field="owner"/>
9717                 </update>
9718                 <delete permission="ADMIN_PROVIDER">
9719                     <context link="provider" field="owner"/>
9720                 </delete>
9721             </actions>
9722         </permacrud>
9723     </class>
9724         <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">
9725                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9726                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9727                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9728                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9729                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9730                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9731                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9732                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9733                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9734                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9735                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9736                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9737                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9738                 </fields>
9739                 <links>
9740                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9741                 </links>
9742         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9743             <actions>
9744                 <create permission="ADMIN_PROVIDER">
9745                     <context link="contact" jump='provider' field="owner"/>
9746                 </create>
9747                 <retrieve permission="ADMIN_PROVIDER">
9748                     <context link="contact" jump='provider' field="owner"/>
9749                 </retrieve>
9750                 <update permission="ADMIN_PROVIDER">
9751                     <context link="contact" jump='provider' field="owner"/>
9752                 </update>
9753                 <delete permission="ADMIN_PROVIDER">
9754                     <context link="contact" jump='provider' field="owner"/>
9755                 </delete>
9756             </actions>
9757         </permacrud>
9758         </class>
9759
9760         <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">
9761                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9762                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9763                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9764                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9765                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9766                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9767                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9768                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9769                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9770                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9771                 </fields>
9772                 <links>
9773                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9774                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9775                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9776                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9777                 </links>
9778         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9779             <actions>
9780                 <create permission="ADMIN_ACQ_FUND">
9781                     <context link="src_fund" field="org"/>
9782                 </create>
9783                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9784                     <context link="src_fund" field="org"/>
9785                     <context link="dest_fund" field="org"/>
9786                 </retrieve>
9787                 <update permission="ADMIN_ACQ_FUND">
9788                     <context link="src_fund" field="org"/>
9789                 </update>
9790                 <delete permission="ADMIN_ACQ_FUND">
9791                     <context link="src_fund" field="org"/>
9792                 </delete>
9793             </actions>
9794         </permacrud>
9795         </class>
9796
9797         <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">
9798                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9799                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9800                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9801                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9802                 </fields>
9803                 <links>
9804             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9805                 </links>
9806                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9807                         <actions>
9808                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9809                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9810                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9811                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9812                         </actions>
9813                 </permacrud>
9814         </class>
9815
9816         <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">
9817                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9818                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9819                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9820                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9821                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9822                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9823                 </fields>
9824                 <links>
9825                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9826                 </links>
9827                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9828                         <actions>
9829                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9830                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9831                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9832                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9833                         </actions>
9834                 </permacrud>
9835         </class>
9836
9837         <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">
9838                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9839                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9840                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9841                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9842                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9843                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9844                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9845                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9846                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9847                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9848                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9849                 </fields>
9850                 <links>
9851                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9852                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9853             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9854             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9855                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9856                 </links>
9857         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9858             <actions>
9859                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9860                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9861                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9862                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9863             </actions>
9864         </permacrud>
9865         </class>
9866
9867         <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">
9868                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9869                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9870                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9871                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9872                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9873                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9874                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9875                 </fields>
9876                 <links>
9877                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9878                 </links>
9879                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9880                         <actions>
9881                                 <create permission="ADMIN_FUNDING_SOURCE">
9882                     <context link="funding_source" field="owner"/>
9883                 </create>
9884                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9885                     <context link="funding_source" field="owner"/>
9886                 </retrieve>
9887                                 <update permission="ADMIN_FUNDING_SOURCE">
9888                     <context link="funding_source" field="owner"/>
9889                 </update>
9890                                 <delete permission="ADMIN_FUNDING_SOURCE">
9891                     <context link="funding_source" field="owner"/>
9892                 </delete>
9893                         </actions>
9894                 </permacrud>
9895         </class>
9896
9897         <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">
9898                 <fields oils_persist:primary="id">
9899                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9900                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9901                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9902                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9903                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9904                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9905                 </fields>
9906                 <links>
9907                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9908                 </links>
9909         </class>
9910
9911         <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">
9912                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9913                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9914                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9915                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9916                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9917                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9918                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9919                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9920                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9921                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9922                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9923                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9924                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9925                 </fields>
9926                 <links>
9927                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9928                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9929                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9930                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9931                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9932                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9933                 </links>
9934                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9935                         <actions>
9936                                 <create permission="ADMIN_ACQ_FUND">
9937                     <context link="fund" field="org"/>
9938                 </create>
9939                                 <retrieve permission="ADMIN_ACQ_FUND">
9940                     <context link="fund" field="org"/>
9941                 </retrieve>
9942                                 <update permission="ADMIN_ACQ_FUND">
9943                     <context link="fund" field="org"/>
9944                 </update>
9945                                 <delete permission="ADMIN_ACQ_FUND">
9946                     <context link="fund" field="org"/>
9947                 </delete>
9948                         </actions>
9949                 </permacrud>
9950         </class>
9951
9952         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9953                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9954                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9955                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9956                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9957                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9958                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9959                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9960                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9961                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9962                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9963                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9964                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9965                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9966                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9967                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9968                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9969                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9970                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9971                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9972                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9973                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9974                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9975                 </fields>
9976                 <links>
9977                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9978                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9979             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9980             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9981             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9982             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9983             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9984             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9985             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9986             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9987             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9988                 </links>
9989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9990             <actions>
9991                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9992                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9993                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9994                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9995             </actions>
9996         </permacrud>
9997         </class>
9998
9999         <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">
10000                 <fields oils_persist:primary="fund">
10001                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10002                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10003                 </fields>
10004                 <links>
10005                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10006                 </links>
10007         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10008             <actions>
10009                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10010                                         <context link="fund" field="org" />
10011                 </retrieve>
10012             </actions>
10013         </permacrud>
10014         </class>
10015
10016         <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">
10017                 <fields oils_persist:primary="fund">
10018                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10019                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
10020                 </fields>
10021                 <links>
10022                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10023                 </links>
10024         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10025             <actions>
10026                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10027                                         <context link="fund" field="org" />
10028                 </retrieve>
10029             </actions>
10030         </permacrud>
10031         </class>
10032
10033         <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">
10034                 <fields oils_persist:primary="fund">
10035                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10036                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
10037                 </fields>
10038                 <links>
10039                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10040                 </links>
10041         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10042             <actions>
10043                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10044                                         <context link="fund" field="org" />
10045                 </retrieve>
10046             </actions>
10047         </permacrud>
10048         </class>
10049
10050         <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">
10051                 <fields oils_persist:primary="fund">
10052                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10053                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10054                 </fields>
10055                 <links>
10056                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10057                 </links>
10058         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10059             <actions>
10060                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10061                                         <context link="fund" field="org" />
10062                 </retrieve>
10063             </actions>
10064         </permacrud>
10065         </class>
10066
10067         <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">
10068                 <fields oils_persist:primary="fund">
10069                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10070                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
10071                 </fields>
10072                 <links>
10073                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10074                 </links>
10075         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10076             <actions>
10077                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10078                                         <context link="fund" field="org" />
10079                 </retrieve>
10080             </actions>
10081         </permacrud>
10082         </class>
10083
10084    <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">
10085         <fields oils_persist:primary="fund">
10086             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10087             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
10088         </fields>
10089         <links>
10090             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10091         </links>
10092     </class>
10093
10094    <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">
10095         <fields oils_persist:primary="fund">
10096             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10097             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
10098         </fields>
10099         <links>
10100             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10101         </links>
10102     </class>
10103
10104    <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">
10105         <fields oils_persist:primary="fund">
10106             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10107             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
10108         </fields>
10109         <links>
10110             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10111         </links>
10112     </class>
10113
10114    <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">
10115         <fields oils_persist:primary="fund">
10116             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10117             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10118         </fields>
10119         <links>
10120             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10121         </links>
10122     </class>
10123
10124    <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">
10125         <fields oils_persist:primary="fund">
10126             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10127             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10128         </fields>
10129         <links>
10130             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10131         </links>
10132     </class>
10133
10134         <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">
10135                 <fields oils_persist:primary="funding_source">
10136                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10137                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10138                 </fields>
10139                 <links>
10140                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10141                 </links>
10142         </class>
10143
10144         <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">
10145                 <fields oils_persist:primary="funding_source">
10146                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10147                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10148                 </fields>
10149                 <links>
10150                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10151                 </links>
10152         </class>
10153
10154         <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">
10155                 <fields oils_persist:primary="funding_source">
10156                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10157                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10158                 </fields>
10159                 <links>
10160                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10161                 </links>
10162         </class>
10163
10164         <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">
10165                 <fields oils_persist:primary="fund">
10166                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10167                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10168                 </fields>
10169                 <links>
10170                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10171                 </links>
10172         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10173             <actions>
10174                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10175                                         <context link="fund" field="org" />
10176                 </retrieve>
10177             </actions>
10178         </permacrud>
10179     </class>
10180     <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">
10181         <oils_persist:source_definition><![CDATA[
10182             SELECT
10183                 acqf.*,
10184                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10185                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10186                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10187                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10188             FROM
10189                 acq.fund acqf
10190                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10191                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10192                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10193                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10194         ]]></oils_persist:source_definition>
10195         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10196             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10197             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10198             <field reporter:label="Name" name="name" reporter:datatype="text" />
10199             <field reporter:label="Year" name="year" reporter:datatype="int" />
10200             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10201             <field reporter:label="Code" name="code" reporter:datatype="text" />
10202             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10203             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10204             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10205             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10206             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10207
10208             <!-- non fund-native fields -->
10209             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10210             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10211             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10212             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10213         </fields>
10214         <links>
10215             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10216             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10217             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10218         </links>
10219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10220             <actions>
10221                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10222             </actions>
10223         </permacrud>
10224         </class>
10225         <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">
10226                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10227                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10228                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10229                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10230                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10231                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10232                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10233                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10234                 </fields>
10235                 <links>
10236                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10237                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10238                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10239                 </links>
10240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10241                         <actions>
10242                                 <create permission="ADMIN_ACQ_FUND">
10243                     <context link="fund" field="org"/>
10244                 </create>
10245                                 <retrieve permission="ADMIN_ACQ_FUND">
10246                     <context link="fund" field="org"/>
10247                 </retrieve>
10248                                 <update permission="ADMIN_ACQ_FUND">
10249                     <context link="fund" field="org"/>
10250                 </update>
10251                                 <delete permission="ADMIN_ACQ_FUND">
10252                     <context link="fund" field="org"/>
10253                 </delete>
10254                         </actions>
10255                 </permacrud>
10256         </class>
10257
10258     <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">
10259         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10260             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10261             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10262             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10263             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10264             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10265             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10266             <field reporter:label="Note" name="note" reporter:datatype="text" />
10267             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10268         </fields>
10269         <links>
10270             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10271             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10272             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10273         </links>
10274                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10275                         <actions>
10276                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10277                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10278                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10279                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10280                         </actions>
10281                 </permacrud>
10282     </class>
10283
10284         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10285                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10286                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10287                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10288                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10289                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10290                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10291                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10292                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10293                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10294                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10295                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10296                 </fields>
10297                 <links>
10298                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10299                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10300                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10301                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10302                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10303                 </links>
10304                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10305                         <actions>
10306                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10307                         </actions>
10308                 </permacrud>
10309         </class>
10310
10311         <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">
10312                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10313                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10314                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10315                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10316                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10317                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10318                 </fields>
10319                 <links>
10320                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10321                 </links>
10322                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10323                         <actions>
10324                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10325                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10326                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10327                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10328                         </actions>
10329                 </permacrud>
10330         </class>
10331
10332         <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">
10333                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10334                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10335                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10336                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10337                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10338                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10339                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10340                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10341                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10342                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10343                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10344                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10345                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10346                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10347                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10348                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10349                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10350                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10351                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10352                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10353                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10354                 </fields>
10355                 <links>
10356                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10357                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10358                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10359                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10360                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10361                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10362                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10363                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10364                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10365                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10366                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10367                 </links>
10368                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10369                         <actions>
10370                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10371                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10372                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10373                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10374                         </actions>
10375                 </permacrud>
10376         </class>
10377
10378         <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">
10379                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10380                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10381                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10382                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10383                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10384                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10385                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10386                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10387                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10388                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10389                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10390                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10391                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10392                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10393                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10394                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10395                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10396                 </fields>
10397                 <links>
10398                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10399                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10400                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10401                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10402                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10403                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10404                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10405                 </links>
10406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10407             <actions>
10408                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10409             </actions>
10410                 </permacrud>
10411         </class>
10412
10413         <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">
10414                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10415                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10416                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10417                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10418                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10419                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10420                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10421                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10422                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10423                 </fields>
10424                 <links>
10425                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10426                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10427                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10428                 </links>
10429                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10430             <actions>
10431                 <create permission="CREATE_PURCHASE_ORDER">
10432                     <context link="purchase_order" field="ordering_agency"/>
10433                 </create>
10434                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10435                     <context link="purchase_order" field="ordering_agency"/>
10436                 </retrieve>
10437                 <update permission="CREATE_PURCHASE_ORDER">
10438                     <context link="purchase_order" field="ordering_agency"/>
10439                 </update>
10440                 <delete permission="CREATE_PURCHASE_ORDER">
10441                     <context link="purchase_order" field="ordering_agency"/>
10442                 </delete>
10443             </actions>
10444                 </permacrud>
10445         </class>
10446
10447         <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">
10448                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10449                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10450                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10451                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10452                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10453                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10454                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10455                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10456                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10457                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10458                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10459                 </fields>
10460                 <links>
10461                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10462                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10463                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10464                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10465                 </links>
10466                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10467             <actions>
10468                 <create permission="CREATE_PURCHASE_ORDER">
10469                     <context link="purchase_order" field="ordering_agency"/>
10470                 </create>
10471                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10472                     <context link="purchase_order" field="ordering_agency"/>
10473                 </retrieve>
10474                 <update permission="CREATE_PURCHASE_ORDER">
10475                     <context link="purchase_order" field="ordering_agency"/>
10476                 </update>
10477                 <delete permission="CREATE_PURCHASE_ORDER">
10478                     <context link="purchase_order" field="ordering_agency"/>
10479                 </delete>
10480             </actions>
10481                 </permacrud>
10482         </class>
10483
10484         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10486                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10487                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10488                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10489                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10490                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10491                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10492                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10493                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10494                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10495                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10496                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10497                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10498                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10499                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10500                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10501                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10502                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10503                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10504                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10505                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10506                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10507                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10508                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10509                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10510                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10511                 </fields>
10512                 <links>
10513                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10514                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10515                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10516                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10517                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10518                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10519                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10520                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10521                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10522                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10523                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10524                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10525                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10526                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10527                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10528                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10529                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10530                 </links>
10531                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10532                         <actions>
10533                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10534                                         <context link="purchase_order" field="ordering_agency"/>
10535                                         <context link="picklist" field="org_unit"/>
10536                                 </retrieve>
10537                         </actions>
10538                 </permacrud>
10539         </class>
10540
10541         <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">
10542                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10543                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10544                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10545                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10546                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10547                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10548                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10549                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10550                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10551                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10552                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10553                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10554                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10555                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10556                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10557                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10558                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10559                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10560                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10561                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10562                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10563                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10564                 </fields>
10565                 <links>
10566                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10567                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10568                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10569                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10570                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10571                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10572                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10573                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10574                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10575                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10576                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10577                 </links>
10578                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10579                         <actions>
10580                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10581                                         <context link="purchase_order" field="ordering_agency"/>
10582                                         <context link="picklist" field="org_unit"/>
10583                                 </retrieve>
10584                         </actions>
10585                 </permacrud>
10586         </class>
10587
10588         <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">
10589                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10590                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10591                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10592                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10593                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10594                 </fields>
10595                 <links>
10596                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10597                 </links>
10598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10599                         <actions>
10600                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10601                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10602                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10603                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10604                         </actions>
10605                 </permacrud>
10606         </class>
10607
10608         <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">
10609                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10610                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10611                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10612                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10613                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10614                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10615                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10616                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10617                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10618                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10619                 </fields>
10620                 <links>
10621                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10622                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10623                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10624                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10625                 </links>
10626         </class>
10627
10628         <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">
10629                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10630                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10631                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10632                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10633                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10634                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10635                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10636                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10637                 </fields>
10638                 <links>
10639                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10640                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10641                 </links>
10642         </class>
10643
10644         <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">
10645                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10646                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10647                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10648                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10649                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10650                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10651                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10652                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10653                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10654                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10655                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10656                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10657                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10658                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10659                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10660                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10661                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10662                 </fields>
10663                 <links>
10664                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10665                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10666                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10667                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10668                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10669                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10670                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10671                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10672                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10673                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10674                 </links>
10675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10676             <actions>
10677                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10678                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10679                     <context link="lineitem" jump="picklist" field="org_unit"/>
10680                 </retrieve>
10681             </actions>
10682         </permacrud>
10683         </class>
10684
10685         <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">
10686                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10687                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10688                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10689                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10690                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10691                 </fields>
10692                 <links/>
10693                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10694                         <actions>
10695                                 <retrieve />
10696                         </actions>
10697                 </permacrud>
10698         </class>
10699
10700         <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">
10701                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10702                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10703                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10704                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10705                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10706                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10707             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10708                 </fields>
10709                 <links/>
10710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10711             <actions>
10712                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10713                 <retrieve />
10714                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10715                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10716             </actions>
10717         </permacrud>
10718         </class>
10719
10720         <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">
10721                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10722                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10723                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10724                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10725                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10726                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10727                 </fields>
10728                 <links/>
10729         </class>
10730         <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">
10731                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10732                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10733                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10734                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10735                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10736                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10737                 </fields>
10738                 <links>
10739                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10740                 </links>
10741         </class>
10742
10743         <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">
10744             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10745                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10746                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10747                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10748                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10749                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10750                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10751         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10752
10753             </fields>
10754             <links>
10755                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10756             </links>
10757             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10758                 <actions>
10759                     <create permission="ADMIN_PROVIDER">
10760                         <context link="provider" field="owner"/>
10761                     </create>
10762                     <retrieve permission="ADMIN_PROVIDER">
10763                         <context link="provider" field="owner"/>
10764                     </retrieve>
10765                     <update permission="ADMIN_PROVIDER">
10766                         <context link="provider" field="owner"/>
10767                     </update>
10768                     <delete permission="ADMIN_PROVIDER">
10769                         <context link="provider" field="owner"/>
10770                     </delete>
10771                 </actions>
10772             </permacrud>
10773         </class>
10774         
10775         <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">
10776             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10777                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10778                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10779                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10780                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10781             </fields>
10782             <links>
10783                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10784             </links>
10785             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10786                 <actions>
10787                     <create permission="ADMIN_PROVIDER">
10788                         <context link="provider" field="owner"/>
10789                     </create>
10790                     <retrieve permission="ADMIN_PROVIDER">
10791                         <context link="provider" field="owner"/>
10792                     </retrieve>
10793                     <update permission="ADMIN_PROVIDER">
10794                         <context link="provider" field="owner"/>
10795                     </update>
10796                     <delete permission="ADMIN_PROVIDER">
10797                         <context link="provider" field="owner"/>
10798                     </delete>
10799                 </actions>
10800             </permacrud>
10801         </class>
10802         
10803         <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">
10804             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10805                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10806                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10807                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10808                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10809                 </fields>
10810                 <links/>
10811         </class>
10812
10813         <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">
10814                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10815                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10816                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10817                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10818                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10819                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10820                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10821                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10822                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10823                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10824                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10825                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10826                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10827                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10828                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10829                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10830                 </fields>
10831                 <links>
10832                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10833                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10834                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10835                 </links>
10836         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10837             <actions>
10838                 <create permission="ADMIN_PROVIDER">
10839                     <context link="provider" field="owner"/>
10840                 </create>
10841                 <retrieve permission="ADMIN_PROVIDER">
10842                     <context link="provider" field="owner"/>
10843                 </retrieve>
10844                 <update permission="ADMIN_PROVIDER">
10845                     <context link="provider" field="owner"/>
10846                 </update>
10847                 <delete permission="ADMIN_PROVIDER">
10848                     <context link="provider" field="owner"/>
10849                 </delete>
10850             </actions>
10851         </permacrud>
10852         </class>
10853
10854         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10855                 oils_obj:fieldmapper="acq::edi_attr" 
10856                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10857                 <fields oils_persist:primary="key">
10858                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10859                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10860                 </fields>
10861         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10862             <actions>
10863                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10864                 <retrieve/>
10865                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10866                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10867             </actions>
10868         </permacrud>
10869         </class>
10870         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10871                 oils_obj:fieldmapper="acq::edi_attr_set" 
10872                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10873                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10874                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10875                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10876                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10877                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10878                 </fields>
10879                 <links>
10880                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10881                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10882                 </links>
10883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10884             <actions>
10885                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10886                 <retrieve/>
10887                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10888                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10889             </actions>
10890         </permacrud>
10891         </class>
10892         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10893                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10894                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10895                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10896                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10897                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10898                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10899                 </fields>
10900                 <links>
10901                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10902                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10903                 </links>
10904         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10905             <actions>
10906                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10907                 <retrieve/>
10908                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10909                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10910             </actions>
10911         </permacrud>
10912         </class>
10913
10914
10915         <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">
10916                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10917                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10918                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10919                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10920                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10921                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10922                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10923                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10924                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10925                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10926                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10927                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10928                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10929                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10930                 </fields>
10931                 <links>
10932                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10933                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10934                 </links>
10935         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10936             <actions>
10937                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10938                     <context link="account" jump="provider" field="owner"/>
10939                 </retrieve>
10940                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10941                     <context link="account" jump="provider" field="owner"/>
10942                 </update>
10943                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10944                     <context link="account" jump="provider" field="owner"/>
10945                 </delete>
10946             </actions>
10947         </permacrud>
10948         </class>
10949
10950
10951         <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">
10952                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10953                         <field name="id" reporter:datatype="id" />
10954                         <field name="parent" reporter:datatype="link"/>
10955                         <field name="owner" reporter:datatype="link"/>
10956                         <field name="create_time" reporter:datatype="timestamp"/>
10957                         <field name="name" reporter:datatype="text"/>
10958                         <field name="shared" reporter:datatype="bool"/>
10959                         <field name="share_with" reporter:datatype="link"/>
10960                         <field name="simple_reporter" reporter:datatype="bool"/>
10961                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10962                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10963                 </fields>
10964                 <links>
10965                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10966                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10967                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10968                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10969                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10970                 </links>
10971         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10972             <actions>
10973                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10974                     <context link="owner" field="home_ou"/>
10975                 </create>
10976                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10977                     <context link="owner" field="home_ou"/>
10978                 </retrieve>
10979                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10980                     <context link="owner" field="home_ou"/>
10981                 </update>
10982                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10983                     <context link="owner" field="home_ou"/>
10984                 </delete>
10985             </actions>
10986         </permacrud>
10987         </class>
10988         <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">
10989                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10990                         <field name="id" reporter:datatype="id" />
10991                         <field name="parent" reporter:datatype="link"/>
10992                         <field name="owner" reporter:datatype="link"/>
10993                         <field name="create_time" reporter:datatype="timestamp"/>
10994                         <field name="name" reporter:datatype="text"/>
10995                         <field name="shared" reporter:datatype="bool"/>
10996                         <field name="share_with" reporter:datatype="link"/>
10997                         <field name="simple_reporter" reporter:datatype="bool"/>
10998                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10999                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
11000                 </fields>
11001                 <links>
11002                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11003                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
11004                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
11005                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11006                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
11007                 </links>
11008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11009             <actions>
11010                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11011                     <context link="owner" field="home_ou"/>
11012                 </create>
11013                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11014                     <context link="owner" field="home_ou"/>
11015                 </retrieve>
11016                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11017                     <context link="owner" field="home_ou"/>
11018                 </update>
11019                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11020                     <context link="owner" field="home_ou"/>
11021                 </delete>
11022             </actions>
11023         </permacrud>
11024         </class>
11025         <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">
11026                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
11027                         <field name="id" reporter:datatype="id" />
11028                         <field name="parent" reporter:datatype="link"/>
11029                         <field name="owner" reporter:datatype="link"/>
11030                         <field name="create_time" reporter:datatype="timestamp"/>
11031                         <field name="name" reporter:datatype="text"/>
11032                         <field name="shared" reporter:datatype="bool"/>
11033                         <field name="share_with" reporter:datatype="link"/>
11034                         <field name="simple_reporter" reporter:datatype="bool"/>
11035                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
11036                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11037                 </fields>
11038                 <links>
11039                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11040                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
11041                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
11042                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
11043                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
11044                 </links>
11045         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11046             <actions>
11047                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11048                     <context link="owner" field="home_ou"/>
11049                 </create>
11050                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11051                     <context link="owner" field="home_ou"/>
11052                 </retrieve>
11053                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11054                     <context link="owner" field="home_ou"/>
11055                 </update>
11056                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11057                     <context link="owner" field="home_ou"/>
11058                 </delete>
11059             </actions>
11060         </permacrud>
11061         </class>
11062         <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">
11063                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
11064                         <field name="id" reporter:datatype="id" />
11065                         <field name="owner" reporter:datatype="link"/>
11066                         <field name="create_time" reporter:datatype="timestamp"/>
11067                         <field name="name" reporter:datatype="text"/>
11068                         <field name="data" reporter:datatype="text"/>
11069                         <field name="folder" reporter:datatype="link"/>
11070                         <field name="description" reporter:datatype="text"/>
11071                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
11072                 </fields>
11073                 <links>
11074                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11075                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
11076                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
11077                 </links>
11078         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11079             <actions>
11080                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11081                     <context link="owner" field="home_ou"/>
11082                 </create>
11083                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11084                     <context link="owner" field="home_ou"/>
11085                 </retrieve>
11086                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11087                     <context link="owner" field="home_ou"/>
11088                 </update>
11089                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11090                     <context link="owner" field="home_ou"/>
11091                 </delete>
11092             </actions>
11093         </permacrud>
11094         </class>
11095         <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">
11096                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
11097                         <field name="id" reporter:datatype="id" />
11098                         <field name="owner" reporter:datatype="link"/>
11099                         <field name="create_time" reporter:datatype="timestamp"/>
11100                         <field name="template" reporter:datatype="link"/>
11101                         <field name="data" reporter:datatype="text"/>
11102                         <field name="folder" reporter:datatype="link"/>
11103                         <field name="recur" reporter:datatype="bool"/>
11104                         <field name="recurrence" reporter:datatype="interval"/>
11105                         <field name="name" reporter:datatype="text"/>
11106                         <field name="description" reporter:datatype="text"/>
11107                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
11108                 </fields>
11109                 <links>
11110                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11111                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11112                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
11113                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
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="owner" field="home_ou"/>
11119                 </create>
11120                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11121                     <context link="owner" field="home_ou"/>
11122                 </retrieve>
11123                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11124                     <context link="owner" field="home_ou"/>
11125                 </update>
11126                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11127                     <context link="owner" field="home_ou"/>
11128                 </delete>
11129             </actions>
11130         </permacrud>
11131         </class>
11132         <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">
11133                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11134                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11135                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11136                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11137                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11138                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11139                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11140                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11141                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11142                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11143                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11144                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11145                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11146                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11147                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11148                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11149                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11150                 </fields>
11151                 <links>
11152                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11153                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11154                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11155                 </links>
11156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11157             <actions>
11158                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11159                     <context link="runner" field="home_ou"/>
11160                 </create>
11161                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11162                     <context link="runner" field="home_ou"/>
11163                 </retrieve>
11164                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11165                     <context link="runner" field="home_ou"/>
11166                 </update>
11167                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11168                     <context link="runner" field="home_ou"/>
11169                 </delete>
11170             </actions>
11171         </permacrud>
11172         </class>
11173     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11174            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11175            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11176                 <fields oils_persist:primary="run">
11177             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11178             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11179             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11180             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11181             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11182             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11183             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11184             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11185             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11186             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11187             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11188             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11189             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11190             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11191             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11192             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11193                 </fields>
11194                 <links>
11195             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11196             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11197             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11198             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11199             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11200             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11201             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11202             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11203             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11204                 </links>
11205         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11206             <actions>
11207                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11208                     <context link="runner" field="home_ou"/>
11209                 </retrieve>
11210             </actions>
11211         </permacrud>
11212     </class>
11213         <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">
11214                 <fields oils_persist:primary="id">
11215                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11216                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11217                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11218                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11219                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11220                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11221                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11222                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11223                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11224                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11225                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11226                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11227                 </fields>
11228                 <links>
11229                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11230                 </links>
11231                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11232                         <actions>
11233                                 <retrieve />
11234                         </actions>
11235                 </permacrud>
11236         </class>
11237         <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">
11238                 <fields oils_persist:primary="id">
11239                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11240                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11241                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11242                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11243                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11244                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11245                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11246                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11247                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11248                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11249                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11250                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11251                 </fields>
11252                 <links>
11253                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11254                 </links>
11255         </class>
11256         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11257                 <fields oils_persist:primary="id">
11258                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11259                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11260                         <field reporter:label="Fingerprint" name="fingerprint" />
11261                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11262                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11263                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11264                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11265                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11266                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11267                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11268                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11269                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11270                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11271                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11272                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11273                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11274                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11275                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11276                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11277                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11278                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11279                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11280                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11281                 </fields>
11282                 <links>
11283                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11284                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11285                 </links>
11286         </class>
11287         <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">
11288                 <fields oils_persist:primary="id">
11289                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11290                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11291                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11292                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11293                 </fields>
11294                 <links>
11295                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11296                 </links>
11297         </class>
11298         <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">
11299                 <fields oils_persist:primary="id">
11300                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11301                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11302                 </fields>
11303                 <links>
11304                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11305                 </links>
11306         </class>
11307         <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">
11308                 <fields oils_persist:primary="id">
11309                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11310                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11311                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11312                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11313                 </fields>
11314                 <links>
11315                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11316                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11317                 </links>
11318                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11319                         <actions>
11320                                 <retrieve permission="VIEW_HOLD">
11321                                         <context link="id" field="pickup_lib"/>
11322                                 </retrieve>
11323                         </actions>
11324                 </permacrud>
11325         </class>
11326         <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">
11327                 <fields oils_persist:primary="xact">
11328                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11329                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11330                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11331                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11332                 </fields>
11333                 <links>
11334                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11335                 </links>
11336         </class>
11337         <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">
11338                 <fields oils_persist:primary="xact">
11339                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11340                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11341                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11342                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11343                 </fields>
11344                 <links>
11345                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11346                 </links>
11347         </class>
11348         <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)">
11349                 <fields oils_persist:primary="id">
11350                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11351                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11352                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11353                 </fields>
11354                 <links>
11355                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11356                 </links>
11357         </class>
11358         <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">
11359                 <fields oils_persist:primary="id">
11360                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11361                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11362                 </fields>
11363                 <links>
11364                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11365                 </links>
11366                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11367                         <actions>
11368                                 <retrieve permission="STAFF_LOGIN">
11369                                         <context link="id" field="circ_lib"/>
11370                                 </retrieve>
11371                         </actions>
11372                 </permacrud>
11373         </class>
11374         <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">
11375                 <fields oils_persist:primary="bibid">
11376                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11377                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11378                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11379                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11380                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11381                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11382                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11383                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11384                 </fields>
11385                 <links>
11386                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11387                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11388                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11389                 </links>
11390         </class>
11391         <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">
11392                 <fields oils_persist:primary="copy_id">
11393                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11394                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11395                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11396                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11397                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11398                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11399                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11400                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11401                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11402                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11403                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11404                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11405                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11406                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11407                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11408                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11409                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11410                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11411                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11412                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11413                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11414                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11415                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11416                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11417                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11418                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11419                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11420                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11421                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11422                 </fields>
11423                 <links>
11424                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11425                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11426                 </links>
11427         </class>
11428         <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">
11429                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11430                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11431                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11432                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11433                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11434                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11435                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11436                 </fields>
11437                 <links>
11438                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11439                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11440                 </links>
11441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11442                         <actions>
11443                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11444                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11445                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11446                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11447                         </actions>
11448                 </permacrud>
11449         </class>
11450         <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">
11451                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11452                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11453                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11454                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11455                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11456                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11457                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11458                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11459                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11460                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11461                 </fields>
11462                 <links>
11463                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11464                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11465                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11466                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11467                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11468                 </links>
11469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11470                         <actions>
11471                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11472                                         <context link="formula" field="owner"/>
11473                                 </create>
11474                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11475                                         <context link="formula" field="owner"/>
11476                                 </retrieve>
11477                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11478                                         <context link="formula" field="owner"/>
11479                                 </update>
11480                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11481                                         <context link="formula" field="owner"/>
11482                                 </delete>
11483                         </actions>
11484                 </permacrud>
11485         </class>
11486
11487         <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">
11488                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11489                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11490                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11491                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11492                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11493                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11494                 </fields>
11495                 <links>
11496                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11497                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11498                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11499                 </links>
11500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11501                         <actions>
11502                                 <create permission="CREATE_PURCHASE_ORDER">
11503                                         <context link="formula" field="owner"/>
11504                 </create>
11505                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11506                                         <context link="formula" field="owner"/>
11507                 </retrieve>
11508                                 <update permission="CREATE_PURCHASE_ORDER">
11509                                         <context link="formula" field="owner"/>
11510                 </update>
11511                                 <delete permission="CREATE_PURCHASE_ORDER">
11512                                         <context link="formula" field="owner"/>
11513                 </delete>
11514                         </actions>
11515                 </permacrud>
11516         </class>
11517
11518         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11519                 <fields oils_persist:primary="id">
11520                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11521                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11522                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11523                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11524                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11525                 </fields>
11526                 <links>
11527                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11528                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11529                 </links>
11530         </class>
11531
11532         <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">
11533                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11534                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11535                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11536                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11537                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11538                 </fields>
11539                 <links>
11540                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11541                 </links>
11542                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11543                         <actions>
11544                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11545                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11546                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11547                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11548                         </actions>
11549                 </permacrud>
11550         </class>
11551
11552         <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">
11553                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11554                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11555                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11556                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11557                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11558                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11559                 </fields>
11560                 <links>
11561                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11562                 </links>
11563                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11564                         <actions>
11565                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11566                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11567                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11568                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11569                         </actions>
11570                 </permacrud>
11571         </class>
11572
11573         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11574                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11575                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11576                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11577                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11578                 </fields>
11579                 <links>
11580                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11581                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11582                 </links>
11583         </class>
11584
11585         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11586                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11587                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11588                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11589                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11590                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11591                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11592                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11593                 </fields>
11594                 <links>
11595                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11596                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11597                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11598                 </links>
11599         </class>
11600
11601         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11602                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11603                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11604                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11605                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11606                 </fields>
11607                 <links>
11608                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11609                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11610                 </links>
11611         </class>
11612
11613         <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">
11614                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11615                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11616                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11617                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11618                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11619                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11620                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11621                 </fields>
11622                 <links>
11623                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11624                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11625                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11626                 </links>
11627         </class>
11628
11629         <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">
11630                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11631                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11632                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11633                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11634                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11635                 </fields>
11636                 <links>
11637                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11638                 </links>
11639                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11640             <actions>
11641                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11642                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11643                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11644                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11645             </actions>
11646                 </permacrud>
11647         </class>
11648
11649         <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">
11650                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11651                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11652                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11653                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11654                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11655                 </fields>
11656                 <links>
11657                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11658                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11659                 </links>
11660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11661                         <actions>
11662                                 <create permission="ADMIN_CLAIM_POLICY">
11663                                         <context link="claim_policy" field="org_unit"/>
11664                 </create>
11665                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11666                                         <context link="claim_policy" field="org_unit"/>
11667                 </retrieve>
11668                                 <update permission="ADMIN_CLAIM_POLICY">
11669                                         <context link="claim_policy" field="org_unit"/>
11670                 </update>
11671                                 <delete permission="ADMIN_CLAIM_POLICY">
11672                                         <context link="claim_policy" field="org_unit"/>
11673                 </delete>
11674                         </actions>
11675                 </permacrud>
11676         </class>
11677
11678     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11679         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11680             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11681             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11682             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11683             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11684             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11685             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11686             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11687             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11688             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11689             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11690             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11691             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11692             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11693             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11694             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11695             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11696                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11697                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11698                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11699         </fields>
11700         <links>
11701             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11702             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11703         </links>
11704     </class>
11705
11706     <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">
11707         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11708             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11709             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11710             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11711             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11712             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11713         </fields>
11714     </class>
11715
11716     <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">
11717         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11718             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11719             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11720             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11721             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11722             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11723             <field reporter:label="City" name="city" reporter:datatype="text"/>
11724             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11725             <field reporter:label="State" name="state" reporter:datatype="text"/>
11726             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11727             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11728             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11729         </fields>
11730     </class>
11731
11732     <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">
11733         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11734             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11735             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11736             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11737             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11738             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11739             <field reporter:label="City" name="city" reporter:datatype="text"/>
11740             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11741             <field reporter:label="State" name="state" reporter:datatype="text"/>
11742             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11743             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11744             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11745         </fields>
11746     </class>
11747
11748     <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">
11749         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11750             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11751             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11752             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11753             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11754             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11755             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11756         </fields>
11757     </class>
11758
11759     <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">
11760         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11761             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11762             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11763             <field reporter:label="Username" name="usrname" reporter:datatype="text"/>
11764             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11765             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11766             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11767         </fields>
11768     </class>
11769
11770         <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">
11771                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11772                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11773                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11774                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11775                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11776                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11777                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11778                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11779                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11780                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11781                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11782                 </fields>
11783                 <links>
11784                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11785                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11786                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11787                 </links>
11788                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11789                         <actions>
11790                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11791                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11792                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11793                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11794                         </actions>
11795                 </permacrud>
11796         </class>
11797
11798         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11799                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11800                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11801                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11802                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11803                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11804                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11805                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11806                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11807                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11808                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11809                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11810                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11811                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11812                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11813                 </fields>
11814                 <links>
11815                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11816                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11817                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11818                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11819                 </links>
11820                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11821                         <actions>
11822                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11823                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11824                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11825                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11826                         </actions>
11827                 </permacrud>
11828         </class>
11829
11830         <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">
11831                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11832                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11833                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11834                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11835                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11836                 </fields>
11837                 <links>
11838                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11839                 </links>
11840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11841                         <actions>
11842                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11843                     <context link="fieldset" field="owning_lib"/>
11844                 </create>
11845                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11846                     <context link="fieldset" field="owning_lib"/>
11847                 </retrieve>
11848                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11849                     <context link="fieldset" field="owning_lib"/>
11850                 </update>
11851                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11852                     <context link="fieldset" field="owning_lib"/>
11853                 </delete>
11854                         </actions>
11855                 </permacrud>
11856         </class>
11857
11858     <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">
11859         <fields>
11860             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11861             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11862             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11863         </fields>
11864                 <links>
11865                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11866                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11867                 </links>
11868     </class>
11869
11870     <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">
11871         <fields>
11872             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11873             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11874         </fields>
11875                 <links>
11876                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11877                 </links>
11878     </class>
11879
11880     <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">
11881         <fields>
11882             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11883             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11884             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11885         </fields>
11886                 <links>
11887                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11888                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11889                 </links>
11890     </class>
11891
11892     <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">
11893         <fields>
11894             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11895             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11896         </fields>
11897                 <links>
11898                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11899                 </links>
11900     </class>
11901
11902     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11903                 <oils_persist:source_definition><![CDATA[
11904
11905             SELECT  DISTINCT l.*
11906               FROM  action.unfulfilled_hold_loops l
11907                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11908               WHERE l.count = m.max
11909
11910                 ]]></oils_persist:source_definition>
11911         <fields>
11912             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11913             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11914             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11915         </fields>
11916                 <links>
11917                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11918                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11919                 </links>
11920     </class>
11921
11922         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11923                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11924                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11925                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11926                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11927                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11928                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11929                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11930                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11931                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11932                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11933                 </fields>
11934                 <links>
11935                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11936                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11937                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11938                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11939                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11940                 </links>
11941         </class>
11942
11943         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11944                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11945                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11946                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11947                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11948                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11949                 </fields>
11950                 <links>
11951                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11952                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11953                 </links>
11954         </class>
11955
11956         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11957                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11958                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11959                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11960                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11961                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11962                 </fields>
11963                 <links>
11964                 </links>
11965         </class>
11966
11967         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11968                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11969                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11970                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11971                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11972                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11973                 </fields>
11974                 <links>
11975                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11976                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11977                 </links>
11978         </class>
11979         
11980         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11981                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11982                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11983                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11984                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11985                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11986                 </fields>
11987                 <links>
11988                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11989                 </links>
11990         </class>
11991         
11992         <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">
11993                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11994                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11995                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11996                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11997                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11998                 </fields>
11999                 <links>
12000                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12001                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
12002                 </links>
12003         </class>
12004
12005         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
12006                 <fields oils_persist:primary="name">
12007                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
12008                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
12009                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
12010                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
12011                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
12012                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
12013                 </fields>
12014                 <links>
12015                 </links>
12016         </class>
12017
12018         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
12019                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12020                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12021                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
12022                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12023                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12024                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12025                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12026                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12027                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12028                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12029                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12030                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12031                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12032                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12033                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12034                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12035                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12036                 </fields>
12037                 <links>
12038                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12039                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12040                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12041                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12042                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12043                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12044                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12045                 </links>
12046         </class>
12047
12048         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
12049                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
12050                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
12051                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12052                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12053                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
12054                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
12055                 </fields>
12056                 <links>
12057                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12058                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
12059                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
12060                 </links>
12061         </class>
12062
12063         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
12064                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
12065                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
12066                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
12067                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
12068                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
12069                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
12070                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
12071                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12072                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
12073                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12074                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
12075                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
12076                 </fields>
12077                 <links>
12078                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12079                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
12080                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
12081                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
12082                 </links>
12083         </class>
12084
12085         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
12086                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
12087                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
12088                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
12089                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12090                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12091                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
12092                 </fields>
12093                 <links>
12094                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
12095                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
12096                 </links>
12097         </class>
12098
12099         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
12100                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
12101                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
12102                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12103                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12104                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12105                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
12106                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
12107                 </fields>
12108                 <links>
12109                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12110                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12111                 </links>
12112         </class>
12113
12114         <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">
12115                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12116                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12117                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12118                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12119                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12120                 </fields>
12121                 <links>
12122                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12123                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12124                 </links>
12125         </class>
12126
12127         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12128                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12129                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12130                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12131                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12132                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12133                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12134                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12135                 </fields>
12136                 <links>
12137                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12138                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12139                 </links>
12140         </class>
12141
12142         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12143                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12144                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12145                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12146                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12147                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12148                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12149                 </fields>
12150                 <links>
12151                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12152                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12153                 </links>
12154         </class>
12155
12156         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12157                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12158                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12159                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12160                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12161                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12162                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12163                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12164                 </fields>
12165                 <links>
12166                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12167                 </links>
12168         </class>
12169
12170         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12171                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12172                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12173                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12174                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12175                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12176                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12177                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12178                 </fields>
12179                 <links>
12180                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12181                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12182                 </links>
12183         </class>
12184
12185         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12186                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12187                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12188                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12189                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12190                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12191                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12192                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12193                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12194                 </fields>
12195                 <links>
12196                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12197                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12198                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12199                 </links>
12200         </class>
12201
12202         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12203                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12204                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12205                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12206                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12207                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12208                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12209                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12210                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12211                 </fields>
12212                 <links>
12213                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12214                 </links>
12215         </class>
12216
12217         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12218                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12219                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12220                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12221                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12222                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12223                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12224                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12225                 </fields>
12226                 <links>
12227                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12228                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12229                 </links>
12230         </class>
12231
12232         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12233                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12234                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12235                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12236                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12237                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12238                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12239                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12240                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12241                 </fields>
12242                 <links>
12243                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12244                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12245                 </links>
12246         </class>
12247
12248         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12249                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12250                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12251                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12252                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12253                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12254                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12255                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12256                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12257                 </fields>
12258                 <links>
12259                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12260                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12261                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12262                 </links>
12263         </class>
12264
12265         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL 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="Negate?" name="negate" reporter:datatype="bool"/>
12273                 </fields>
12274                 <links>
12275                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12276                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12277                 </links>
12278         </class>
12279
12280         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12281                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12282                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12283                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12284                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12285                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12286                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12287                 </fields>
12288                 <links>
12289                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12290                 </links>
12291         </class>
12292
12293         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12294                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12295                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12296                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12297                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12298                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12299                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12300                 </fields>
12301                 <links>
12302                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12303                 </links>
12304         </class>
12305
12306         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12307                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12308                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12309                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12310                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12311                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12312                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12313                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12314                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12315                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12316                 </fields>
12317                 <links>
12318                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12319                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12320                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12321                 </links>
12322         </class>
12323
12324         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12325                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12326                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12327                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12328                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12329                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12330                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12331                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12332                 </fields>
12333                 <links>
12334                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12335                 </links>
12336         </class>
12337
12338         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12339                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12340                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12341                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12342                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12343                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12344                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12345                 </fields>
12346                 <links>
12347                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12348                 </links>
12349         </class>
12350
12351         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12352                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12353                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12354                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12355                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12356                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12357                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12358                 </fields>
12359                 <links>
12360                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12361                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12362                 </links>
12363         </class>
12364
12365         <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">
12366                 <fields oils_persist:primary="id">
12367                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12368                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12369                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12370                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12371                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12372                 </fields>
12373                 <links>
12374                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12375                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12376                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12377                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12378                 </links>
12379         </class>
12380
12381         <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">
12382                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12383                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12384                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12385                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12386                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12387                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12388                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12389                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12390                 </fields>
12391                 <links/>
12392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12393                         <actions>
12394                                 <retrieve/>
12395                         </actions>
12396                 </permacrud>
12397         </class>
12398
12399         <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">
12400                 <fields oils_persist:primary="ptype_key">
12401                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12402                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12403                 </fields>
12404                 <links/>
12405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12406                         <actions>
12407                                 <retrieve/>
12408                         </actions>
12409                 </permacrud>
12410         </class>
12411
12412         <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">
12413                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12414                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12415                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12416                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12417                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12418                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12419                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12420                 </fields>
12421                 <links>
12422                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12423                 </links>
12424                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12425                         <actions>
12426                                 <retrieve/>
12427                         </actions>
12428                 </permacrud>
12429         </class>
12430
12431         <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">
12432                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12433                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12434                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12435                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12436                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12437                 </fields>
12438                 <links>
12439                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12440                 </links>
12441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12442                         <actions>
12443                                 <retrieve/>
12444                         </actions>
12445                 </permacrud>
12446         </class>
12447
12448     <class
12449         id="uvs"
12450         controller="open-ils.cstore open-ils.pcrud"
12451         oils_obj:fieldmapper="url_verify::session"
12452         oils_persist:tablename="url_verify.session"
12453         reporter:label="URL Verification Session"
12454     >
12455         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12456             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12457             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12458                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12459             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12460             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12461             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12462             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12463             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12464             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12465         </fields>
12466
12467         <links>
12468             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12469             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12470             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12471             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12472             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12473         </links>
12474
12475         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12476             <actions>
12477                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12478             </actions>
12479         </permacrud>
12480
12481     </class>
12482
12483     <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">
12484         <oils_persist:source_definition><![CDATA[
12485             SELECT
12486                 cbrebi.id AS id,  -- so we can have a pkey in our view
12487                 uvs.id AS session,
12488                 uvs.owning_lib,
12489                 cbrebi.target_biblio_record_entry
12490             FROM url_verify.session uvs
12491             JOIN container.biblio_record_entry_bucket cbreb
12492                 ON (uvs.container = cbreb.id)
12493             JOIN container.biblio_record_entry_bucket_item cbrebi
12494                 ON (cbrebi.bucket = cbreb.id)
12495         ]]></oils_persist:source_definition>
12496         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12497             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12498             <field reporter:label="Session" name="session" reporter:datatype="link" />
12499             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12500             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12501         </fields>
12502         <links>
12503             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12504             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12505             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12506         </links>
12507         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12508             <actions>
12509                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12510             </actions>
12511         </permacrud>
12512     </class>
12513
12514     <class
12515         id="uvus"
12516         controller="open-ils.cstore open-ils.pcrud"
12517         oils_obj:fieldmapper="url_verify::url_selector"
12518         oils_persist:tablename="url_verify.url_selector"
12519         reporter:label="URL Verification URL Selector"
12520     >
12521         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12522             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12523             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12524                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12525             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12526         </fields>
12527
12528         <links>
12529             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12530             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12531         </links>
12532
12533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12534             <actions>
12535                 <create permission="URL_VERIFY">
12536                     <context link="session" field="owning_lib"/>
12537                 </create>
12538                 <retrieve permission="URL_VERIFY">
12539                     <context link="session" field="owning_lib"/>
12540                 </retrieve>
12541                 <update permission="URL_VERIFY">
12542                     <context link="session" field="owning_lib"/>
12543                 </update>
12544                 <delete permission="URL_VERIFY">
12545                     <context link="session" field="owning_lib"/>
12546                 </delete>
12547             </actions>
12548         </permacrud>
12549
12550     </class>
12551
12552     <class
12553         id="uvu"
12554         controller="open-ils.cstore open-ils.pcrud"
12555         oils_obj:fieldmapper="url_verify::url"
12556         oils_persist:tablename="url_verify.url"
12557         reporter:label="URL Verification URL"
12558     >
12559         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12560             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12561                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12562                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12563                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12564                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12565             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12566             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12567             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12568             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12569             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12570             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12571             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12572             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12573             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12574             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12575             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12576             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12577             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12578         </fields>
12579
12580         <links>
12581             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12582             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12583             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12584             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12585             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12586         </links>
12587
12588         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12589             <actions>
12590                 <create permission="URL_VERIFY">
12591                     <context link="session" field="owning_lib"/>
12592                 </create>
12593                 <retrieve permission="URL_VERIFY">
12594                     <context link="session" field="owning_lib"/>
12595                 </retrieve>
12596                 <update permission="URL_VERIFY">
12597                     <context link="session" field="owning_lib"/>
12598                 </update>
12599                 <delete permission="URL_VERIFY">
12600                     <context link="session" field="owning_lib"/>
12601                 </delete>
12602             </actions>
12603         </permacrud>
12604
12605     </class>
12606
12607     <class
12608         id="uvva"
12609         controller="open-ils.cstore open-ils.pcrud"
12610         oils_obj:fieldmapper="url_verify::verification_attempt"
12611         oils_persist:tablename="url_verify.verification_attempt"
12612         reporter:label="URL Verification Attempt"
12613     >
12614         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12615             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12616                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12617                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12618             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12619             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12620         </fields>
12621
12622         <links>
12623             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12624             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12625         </links>
12626
12627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12628             <actions>
12629                 <create permission="URL_VERIFY">
12630                     <context link="session" field="owning_lib"/>
12631                 </create>
12632                 <retrieve permission="URL_VERIFY">
12633                     <context link="session" field="owning_lib"/>
12634                 </retrieve>
12635                 <update permission="URL_VERIFY">
12636                     <context link="session" field="owning_lib"/>
12637                 </update>
12638                 <delete permission="URL_VERIFY">
12639                     <context link="session" field="owning_lib"/>
12640                 </delete>
12641             </actions>
12642         </permacrud>
12643
12644     </class>
12645
12646     <class
12647         id="uvuv"
12648         controller="open-ils.cstore open-ils.pcrud"
12649         oils_obj:fieldmapper="url_verify::url_verification"
12650         oils_persist:tablename="url_verify.url_verification"
12651         reporter:label="URL Verification"
12652     >
12653         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12654             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12655                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12656                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12657             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12658             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12659             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12660             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12661                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12662         </fields>
12663
12664         <links>
12665             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12666             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12667             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12668         </links>
12669
12670         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12671             <actions>
12672                 <create permission="URL_VERIFY">
12673                     <context link="attempt" jump="session" field="owning_lib"/>
12674                 </create>
12675                 <retrieve permission="URL_VERIFY">
12676                     <context link="attempt" jump="session" field="owning_lib"/>
12677                 </retrieve>
12678                 <update permission="URL_VERIFY">
12679                     <context link="attempt" jump="session" field="owning_lib"/>
12680                 </update>
12681                 <delete permission="URL_VERIFY">
12682                     <context link="attempt" jump="session" field="owning_lib"/>
12683                 </delete>
12684             </actions>
12685         </permacrud>
12686
12687     </class>
12688
12689         <class
12690                 id="cfdi"
12691                 controller="open-ils.cstore open-ils.pcrud"
12692                 oils_obj:fieldmapper="config::filter_dialog_interface"
12693                 oils_persist:tablename="config.filter_dialog_interface"
12694                 reporter:label="FilterDialog Interface">
12695                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12696                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12697                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12698                 </fields>
12699                 <links>
12700                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12701                 </links>
12702                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12703                         <actions>
12704                                 <retrieve />
12705                         </actions>
12706                 </permacrud>
12707         </class>
12708
12709         <class
12710                 id="cfdfs"
12711                 controller="open-ils.cstore open-ils.pcrud"
12712                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12713                 oils_persist:tablename="config.filter_dialog_filter_set"
12714                 reporter:label="FilterDialog Filter Set">
12715                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12716                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12717                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12718                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12719                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12720                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12721                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12722                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12723                 </fields>
12724                 <links>
12725                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12726                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12727                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12728                 </links>
12729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12730                         <actions>
12731                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12732                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12733                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12734                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12735                         </actions>
12736                 </permacrud>
12737
12738         </class>
12739
12740         <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">
12741                 <fields oils_persist:primary="code">
12742                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12743                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12744                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12745                 </fields>
12746                 <links/>
12747                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12748                         <actions>
12749                                 <retrieve/>
12750                         </actions>
12751                 </permacrud>
12752         </class>
12753
12754         <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">
12755                 <oils_persist:source_definition><![CDATA[
12756
12757             SELECT  b.id,
12758                     MAX(dcp.edit_date) AS last_delete_date
12759              FROM   biblio.record_entry b
12760                     JOIN asset.call_number cn ON (cn.record = b.id)
12761                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12762              WHERE  NOT b.deleted
12763              GROUP BY b.id
12764              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12765
12766                 ]]></oils_persist:source_definition>
12767                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12768                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12769                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12770                 </fields>
12771                 <links>
12772                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12773                 </links>
12774                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12775                         <actions>
12776                                 <retrieve/>
12777                         </actions>
12778                 </permacrud>
12779         </class>
12780
12781         <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">
12782                 <fields oils_persist:primary="id">
12783                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12784                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12785                 </fields>
12786                 <links/>
12787                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12788                         <actions>
12789                                 <retrieve/>
12790                         </actions>
12791                 </permacrud>
12792         </class>
12793
12794         <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">
12795                 <fields oils_persist:primary="id">
12796                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12797                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12798                 </fields>
12799                 <links/>
12800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12801                         <actions>
12802                                 <retrieve/>
12803                         </actions>
12804                 </permacrud>
12805         </class>
12806
12807
12808         <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">
12809                 <oils_persist:source_definition><![CDATA[
12810                 SELECT
12811                     x.id,
12812                     COALESCE( y.copy_count, 0 ) AS copy_count,
12813                     x.hold_count AS hold_count,
12814                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12815                 FROM
12816                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12817                         FROM
12818                             action.hold_request ahr
12819                             JOIN reporter.hold_request_record rhrr USING (id)
12820                         WHERE
12821                             ahr.cancel_time IS NULL
12822                             AND ahr.fulfillment_time IS NULL
12823                         GROUP BY bib_record
12824                     )x
12825                     JOIN
12826                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12827                         FROM
12828                             action.hold_request ahr
12829                             JOIN reporter.hold_request_record rhrr USING (id)
12830                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12831                         WHERE
12832                             ahr.cancel_time IS NULL
12833                             AND ahr.fulfillment_time IS NULL
12834                             AND ahr.capture_time IS NULL
12835                             AND ahr.frozen IS FALSE
12836                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12837                             AND ahr.hold_type != 'M'
12838                            GROUP BY bib_record
12839                     )y
12840                     USING (id)
12841                 ]]></oils_persist:source_definition>
12842                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12843                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12844                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12845                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12846                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12847                 </fields>
12848                 <links>
12849                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12850                 </links>
12851                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12852                         <actions>
12853                                 <retrieve/>
12854                         </actions>
12855                 </permacrud>
12856         </class>
12857
12858         <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">
12859                 <oils_persist:source_definition><![CDATA[
12860             SELECT *,
12861                 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,
12862                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12863             FROM
12864                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12865                     FROM
12866                         action.hold_request ahr
12867                         JOIN reporter.hold_request_record rhrr USING (id)
12868                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12869                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12870                     WHERE
12871                         ahr.cancel_time IS NULL
12872                         AND ahr.fulfillment_time IS NULL
12873                     GROUP BY bib_record, pickup_lib
12874                 )x
12875                 JOIN
12876                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12877                     FROM
12878                         action.hold_request ahr
12879                         JOIN reporter.hold_request_record rhrr USING (id)
12880                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12881                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12882                     WHERE
12883                         ahr.cancel_time IS NULL
12884                         AND ahr.fulfillment_time IS NULL
12885                         AND ahr.capture_time IS NULL
12886                         AND ahr.frozen IS FALSE
12887                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12888                         AND ahr.hold_type != 'M'
12889                     GROUP BY bib_record, pickup_lib
12890                 )y
12891                 USING(id,pickup_lib)
12892                 JOIN
12893                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12894                     FROM
12895                         action.hold_request ahr
12896                         JOIN reporter.hold_request_record rhrr USING (id)
12897                     WHERE
12898                         ahr.cancel_time IS NULL
12899                         AND ahr.fulfillment_time IS NULL
12900                     GROUP BY bib_record
12901                 )z
12902                 USING (id)
12903                 JOIN
12904                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12905                     FROM
12906                         action.hold_request ahr
12907                         JOIN reporter.hold_request_record rhrr USING (id)
12908                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12909                     WHERE
12910                         ahr.cancel_time IS NULL
12911                         AND ahr.fulfillment_time IS NULL
12912                         AND ahr.capture_time IS NULL
12913                         AND ahr.frozen IS FALSE
12914                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12915                         AND ahr.hold_type != 'M'
12916                         GROUP BY bib_record
12917                 )u
12918                 USING (id)
12919                 ]]></oils_persist:source_definition>
12920                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12921                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12922                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12923                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12924                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12925                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12926                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12927                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12928                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12929                 </fields>
12930                 <links>
12931                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12932                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12933                 </links>
12934                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12935                         <actions>
12936                                 <retrieve/>
12937                         </actions>
12938                 </permacrud>
12939         </class>
12940
12941         <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">
12942                 <oils_persist:source_definition><![CDATA[
12943             SELECT *,
12944                 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,
12945                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12946             FROM
12947                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12948                     FROM
12949                         action.hold_request ahr
12950                         JOIN actor.usr au ON (ahr.usr = au.id)
12951                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12952                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12953                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12954                     WHERE
12955                         ahr.cancel_time IS NULL
12956                         AND ahr.fulfillment_time IS NULL
12957                     GROUP BY bib_record, home_ou
12958                 )x
12959                 JOIN
12960                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12961                     FROM
12962                         action.hold_request ahr
12963                         JOIN actor.usr au ON (ahr.usr = au.id)
12964                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12965                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12966                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12967                     WHERE
12968                         ahr.cancel_time IS NULL
12969                         AND ahr.fulfillment_time IS NULL
12970                         AND ahr.capture_time IS NULL
12971                         AND ahr.frozen IS FALSE
12972                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12973                         AND ahr.hold_type != 'M'
12974                     GROUP BY bib_record, home_ou
12975                 )y
12976                 USING (id,home_ou)
12977                 JOIN
12978                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12979                     FROM
12980                         action.hold_request ahr
12981                         JOIN reporter.hold_request_record rhrr USING (id)
12982                     WHERE
12983                         ahr.cancel_time IS NULL
12984                         AND ahr.fulfillment_time IS NULL
12985                     GROUP BY bib_record
12986                 )z
12987                 USING (id)
12988                 JOIN
12989                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12990                     FROM
12991                         action.hold_request ahr
12992                         JOIN reporter.hold_request_record rhrr USING (id)
12993                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12994                     WHERE
12995                         ahr.cancel_time IS NULL
12996                         AND ahr.fulfillment_time IS NULL
12997                         AND ahr.capture_time IS NULL
12998                         AND ahr.frozen IS FALSE
12999                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13000                         AND ahr.hold_type != 'M'
13001                     GROUP BY bib_record
13002                 )u
13003                 USING (id)
13004         ]]></oils_persist:source_definition>
13005         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13006                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13007                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13008                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
13009                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
13010                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13011                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13012                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
13013                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13014         </fields>
13015         <links>
13016                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13017                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13018         </links>
13019         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13020                 <actions>
13021                         <retrieve/>
13022                 </actions>
13023         </permacrud>
13024 </class>
13025
13026         <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) ">
13027                 <oils_persist:source_definition><![CDATA[
13028                 WITH counts_at_ou AS (
13029                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
13030                 FROM
13031                     (SELECT rhrr.bib_record AS id,
13032                             aou.id AS pickup_lib_or_desc,
13033                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
13034                        FROM actor.org_unit aou
13035                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13036                             action.hold_request ahr
13037                             JOIN reporter.hold_request_record rhrr USING (id)
13038                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13039                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13040                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
13041                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13042                             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
13043                       GROUP BY 1, 2
13044                 ) a
13045                 JOIN
13046                     (SELECT rhrr.bib_record AS id,
13047                             aou.id AS pickup_lib_or_desc,
13048                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
13049                        FROM actor.org_unit aou
13050                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
13051                             action.hold_request ahr
13052                             JOIN reporter.hold_request_record rhrr USING (id)
13053                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13054                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
13055                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
13056                             -- Comment out the next line to count copies included from other bibs by metarecord holds
13057                             AND ahr.hold_type != 'M'
13058                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
13059                             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
13060                       GROUP BY 1, 2
13061                 ) b
13062                 USING (id,pickup_lib_or_desc)
13063             )
13064             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
13065                    y.holds_everywhere, z.copy_count_everywhere,
13066                 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,
13067                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
13068             FROM counts_at_ou x
13069                 JOIN
13070                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
13071                     FROM
13072                         action.hold_request ahr
13073                         JOIN reporter.hold_request_record rhrr USING (id)
13074                     WHERE
13075                         ahr.cancel_time IS NULL
13076                         AND ahr.fulfillment_time IS NULL
13077                     GROUP BY bib_record
13078                 )y
13079                 USING (id)
13080                 JOIN
13081                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
13082                     FROM
13083                         action.hold_request ahr
13084                         JOIN reporter.hold_request_record rhrr USING (id)
13085                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
13086                     WHERE
13087                         ahr.cancel_time IS NULL
13088                         AND ahr.fulfillment_time IS NULL
13089                         AND ahr.capture_time IS NULL
13090                         AND ahr.frozen IS FALSE
13091                         -- Comment out the next line to count copies included from other bibs by metarecord holds
13092                         AND ahr.hold_type != 'M'
13093                         GROUP BY bib_record
13094                 )z
13095                 USING (id)
13096                 ]]></oils_persist:source_definition>
13097                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13098                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
13099                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
13100                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
13101                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
13102                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
13103                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
13104                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
13105                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
13106                 </fields>
13107                 <links>
13108                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
13109                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
13110                 </links>
13111                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13112                         <actions>
13113                                 <retrieve/>
13114                         </actions>
13115                 </permacrud>
13116         </class>
13117
13118         <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">
13119                 <oils_persist:source_definition><![CDATA[
13120             SELECT
13121                 ac.id,
13122                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13123                 MAX(actac.xact_start) AS last_circ
13124             FROM asset.copy ac
13125                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13126             GROUP BY ac.id
13127
13128             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13129             --SELECT
13130             --    ac.id,
13131             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13132             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13133             --FROM asset.copy ac
13134             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13135             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13136             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13137                 ]]></oils_persist:source_definition>
13138                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13139                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13140                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13141                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13142                 </fields>
13143                 <links>
13144                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13145                 </links>
13146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13147                         <actions>
13148                                 <retrieve/>
13149                         </actions>
13150                 </permacrud>
13151         </class>
13152
13153         <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">
13154                 <fields oils_persist:primary="id">
13155                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13156                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13157                 </fields>
13158                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13159                         <actions>
13160                                 <retrieve/>
13161                         </actions>
13162                 </permacrud>
13163         </class>
13164
13165         <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">
13166                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13167                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13168                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13169                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13170                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13171                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13172                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13173                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13174                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13175                 </fields>
13176                 <links>
13177                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13178                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13179                 </links>
13180                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13181                         <actions>
13182                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13183                                 <retrieve/>
13184                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13185                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13186                         </actions>
13187                 </permacrud>
13188         </class>
13189
13190         <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">
13191                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13192                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13193                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13194                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13195                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13196                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13197                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13198                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13199                 </fields>
13200                 <links>
13201                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13202                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13203                 </links>
13204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13205                         <actions>
13206                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13207                                 <retrieve/>
13208                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13209                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13210                         </actions>
13211                 </permacrud>
13212         </class>
13213
13214
13215         <!-- ********************************************************************************************************************* -->
13216         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13217         <!-- ********************************************************************************************************************* -->
13218         <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">
13219                 <fields oils_persist:primary="id">
13220                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13221                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13222                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13223                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13224                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13225                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13226                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13227                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13228                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13229                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13230                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13231                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13232                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13233                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13234                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13235                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13236                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13237                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13238                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13239                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13240                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13241                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13242                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13243                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13244                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13245                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13246                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13247                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13248                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13249                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13250                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13251                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13252                 </fields>
13253                 <links>
13254                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13255                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13256                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13257                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13258                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13259                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13260                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13261                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13262                 </links>
13263         </class>
13264
13265         <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">
13266                 <fields oils_persist:primary="id">
13267                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13268                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13269                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13270                 </fields>
13271                 <links>
13272                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13273                 </links>
13274         </class>
13275
13276         <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">
13277                 <fields oils_persist:primary="id">
13278                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13279                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13280                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13281                 </fields>
13282                 <links>
13283                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13284                 </links>
13285         </class>
13286
13287         <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">
13288                 <fields oils_persist:primary="id">
13289                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13290
13291                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13292                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13293                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13294
13295                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13296                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13297                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13298
13299                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13300                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13301
13302                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13303                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13304                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13305
13306                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13307                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13308
13309                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13310                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13311                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13312
13313                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13314                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13315                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13316
13317                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13318                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13319                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13320                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13321
13322                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13323                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13324
13325                 </fields>
13326                 <links>
13327                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13328                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13329                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13330                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13331                 </links>
13332         </class>
13333
13334         <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">
13335                 <oils_persist:source_definition><![CDATA[
13336
13337             SELECT
13338                 po.ordering_agency AS ordering_agency,
13339                 po.id AS purchase_order,
13340                 li.id AS lineitem,
13341                 lid.id AS lineitem_detail,
13342                 cpa.id AS claim_policy_action
13343             FROM
13344                 acq.lineitem_detail lid
13345                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13346                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13347                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13348                 JOIN acq.claim_policy_action cpa ON (
13349                     cpa.claim_policy = cp.id
13350
13351                     -- we only care about claim policy actions whose claim
13352                     -- interval we'd reached or exceeded
13353                     AND (NOW() - cpa.action_interval) > po.order_date
13354
13355                     -- filter out all claim policy actions where claim events
13356                     -- have occurred on or after the action's action_interval
13357                     AND NOT EXISTS (
13358                         SELECT 1
13359                         FROM
13360                             acq.claim_event evt
13361                             JOIN acq.claim claim ON (
13362                                 claim.id = evt.claim
13363                                 AND claim.lineitem_detail = lid.id
13364                             )
13365                         WHERE
13366                             evt.event_date >= (po.order_date + cpa.action_interval)
13367                     )
13368                 )
13369             WHERE
13370                 lid.cancel_reason IS NULL
13371                 AND li.cancel_reason IS NULL -- belt/suspenders
13372                 AND po.cancel_reason IS NULL -- belt/suspenders
13373                 AND lid.recv_time IS NULL
13374                 AND po.state = 'on-order'
13375             ORDER BY 1, 2, 3, 4, 5
13376
13377                 ]]></oils_persist:source_definition>
13378                 <fields>
13379                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13380                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13381                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13382                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13383                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13384                 </fields>
13385                 <links>
13386                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13387                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13388                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13389                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13390                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13391                 </links>
13392         </class>
13393         <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">
13394                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13395                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13396                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13397                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13398                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13399                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13400                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13401                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13402                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13403                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13404                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13405                 </fields>
13406                 <links>
13407                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13408                 </links>
13409     </class>
13410         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13411                 <oils_persist:source_definition><![CDATA[
13412             SELECT * FROM acq.lineitem_summary 
13413                                 WHERE item_count > (invoice_count + cancel_count)
13414         ]]></oils_persist:source_definition>
13415                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13416                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13417                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13418                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13419                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13420                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13421                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13422                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13423                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13424                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13425                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13426                 </fields>
13427                 <links>
13428                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13429                 </links>
13430     </class>
13431         <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">
13432                 <oils_persist:source_definition><![CDATA[
13433
13434                         SELECT  t.*
13435                           FROM  action.transit_copy t
13436                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13437                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13438                           WHERE s.parent_ou <> d.parent_ou
13439
13440                 ]]></oils_persist:source_definition>
13441                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13442                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13443                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13444                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13445                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13446                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13447                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13448                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13449                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13450                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13451                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13452                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13453                 </fields>
13454                 <links>
13455                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13456                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13457                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13458                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13459                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13460                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13461                 </links>
13462         </class>
13463
13464     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13465                 <oils_persist:source_definition><![CDATA[
13466
13467         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13468                 SELECT
13469                         cp.id as copy,
13470                         COUNT(circ.id),
13471                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13472                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13473                 FROM
13474                         asset.copy cp
13475                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13476                 GROUP BY 1, 3, 4
13477                 UNION ALL
13478                 SELECT
13479                         cp.id as copy,
13480                         COUNT(circ.id),
13481                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13482                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13483                 FROM
13484                         asset.copy cp
13485                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13486                 GROUP BY 1, 3, 4
13487                 UNION ALL
13488                 SELECT
13489                         id as copy,
13490                         circ_count,
13491                         -1 AS year,
13492                         false as is_renewal
13493                 FROM
13494                         extend_reporter.legacy_circ_count
13495         )x GROUP BY 1, 3, 4
13496
13497                 ]]></oils_persist:source_definition>
13498         <fields>
13499             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13500             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13501             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13502             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13503         </fields>
13504                 <links>
13505                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13506                 </links>
13507                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13508                         <actions>
13509                                 <retrieve/>
13510                         </actions>
13511                 </permacrud>
13512     </class>
13513
13514         <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">
13515                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13516                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13517                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13518                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13519                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13520                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13521                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13522                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13523                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13524                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13525                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13526                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13527                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13528                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13529                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13530                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13531                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13532                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13533                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13534                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13535                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13536                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13537                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13538                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13539                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13540                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13541                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13542                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13543                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13544                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13545                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13546                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13547                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13548                 </fields>
13549                 <links>
13550                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13551                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13552                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13553                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13554                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13555                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13556                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13557                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13558                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13559                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13560                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13561                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13562                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13563                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13564                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13565                 </links>
13566         </class>
13567
13568     <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">
13569         <fields oils_persist:primary="id">
13570             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13571             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13572             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13573             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13574             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13575             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13576             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13577             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13578             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13579             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13580             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13581             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13582             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13583             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13584             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13585             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13586             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13587             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13588             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13589             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13590             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13591             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13592             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13593             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13594             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13595             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13596             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13597             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13598             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13599             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13600             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13601             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13602             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13603             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13604         </fields>
13605         <links>
13606             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13607             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13608             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13609             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13610             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13611             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13612             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13613             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13614         </links>
13615     </class>
13616
13617     <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">
13618         <fields oils_persist:primary="id">
13619             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13620             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13621             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13622             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13623         </fields>
13624         <links>
13625             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13626             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13627         </links>
13628     </class>
13629
13630     <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">
13631         <fields oils_persist:primary="owning_lib">
13632             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13633             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13634             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13635         </fields>
13636         <links>
13637             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13638         </links>
13639     </class>
13640
13641     <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">
13642         <fields oils_persist:primary="id">
13643             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13644             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13645             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13646             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13647             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13648         </fields>
13649         <links>
13650             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13651             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13652             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13653         </links>
13654     </class>
13655
13656     <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">
13657         <fields oils_persist:primary="circ_lib">
13658             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13659             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13660             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13661             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13662         </fields>
13663         <links>
13664             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13665             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13666         </links>
13667     </class>
13668
13669     <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">
13670         <fields oils_persist:primary="id">
13671             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13672             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13673             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13674             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13675             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13676         </fields>
13677         <links>
13678             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13679             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13680             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13681         </links>
13682     </class>
13683
13684     <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">
13685         <fields oils_persist:primary="home_ou">
13686             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13687             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13688             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13689             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13690         </fields>
13691         <links>
13692             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13693             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13694         </links>
13695     </class>
13696         <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">
13697                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13698                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13699                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13700                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13701                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13702                 </fields>
13703                 <links>
13704                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13705                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13706                 </links>
13707                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13708                         <actions>
13709                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13710                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13711                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13712                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13713                         </actions>
13714                 </permacrud>
13715         </class>
13716         <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">
13717                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13718                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13719                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13720                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13721                 </fields>
13722                 <links>
13723                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13724                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13725                         </links>
13726                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13727                 <actions>
13728                                 <create permission="ADMIN_ACQ_FUND_TAG">
13729                                         <context link="tag" field="owner"/>
13730                                 </create>
13731                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13732                                         <context link="tag" field="owner"/>
13733                                 </retrieve>
13734                                 <update permission="ADMIN_ACQ_FUND_TAG">
13735                                         <context link="tag" field="owner"/>
13736                                 </update>
13737                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13738                                         <context link="tag" field="owner"/>
13739                                 </delete>
13740                         </actions>
13741                 </permacrud>
13742         </class>
13743         <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">
13744                 <oils_persist:source_definition><![CDATA[
13745                 SELECT
13746                         poi.purchase_order AS purchase_order,
13747                         ii.invoice AS invoice,
13748                         NULL AS lineitem,
13749                         poi.id AS po_item,
13750                         NULL AS picklist
13751                 FROM
13752                         acq.po_item poi
13753                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13754                 UNION SELECT
13755                         jub.purchase_order AS purchase_order,
13756                         ie.invoice AS invoice,
13757                         jub.id AS lineitem,
13758                         NULL AS po_item,
13759                         jub.picklist AS picklist
13760                 FROM
13761                         acq.lineitem jub
13762                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13763                 UNION SELECT
13764                         ii.purchase_order AS purchase_order,
13765                         ii.invoice AS invoice,
13766                         NULL AS lineitem,
13767                         NULL AS po_item,
13768                         NULL AS picklist
13769                 FROM
13770                         acq.invoice_item ii
13771                 WHERE ii.po_item IS NULL
13772                 UNION SELECT
13773                         ie.purchase_order AS purchase_order,
13774                         ie.invoice AS invoice,
13775                         NULL AS lineitem,
13776                         NULL AS po_item,
13777                         NULL AS picklist
13778                 FROM
13779                         acq.invoice_entry ie
13780                 WHERE ie.lineitem IS NULL
13781                 UNION SELECT
13782                         NULL AS purchase_order,
13783                         NULL AS invoice,
13784                         jub.id AS lineitem,
13785                         NULL AS po_item,
13786                         jub.picklist AS picklist
13787                 FROM
13788                         acq.lineitem jub
13789                 WHERE jub.purchase_order IS NULL
13790                 ]]></oils_persist:source_definition>
13791                 <fields>
13792                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13793                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13794                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13795                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13796                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13797                 </fields>
13798                 <links>
13799                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13800                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13801                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13802                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13803                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13804                 </links>
13805         </class>
13806         <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">
13807                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13808                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13809                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13810                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13811                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13812                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13813                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13814                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13815                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13816                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13817                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13818                 </fields>
13819                 <links>
13820                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13821                 </links>
13822                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13823                         <actions>
13824                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13825                                 <retrieve/>
13826                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13827                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13828                         </actions>
13829                 </permacrud>
13830         </class>
13831
13832         <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">
13833                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13834                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13835                         <field name="date_applied" reporter:datatype="timestamp"/>
13836                         <field name="org" reporter:datatype="org_unit"/>
13837                         <field name="original_value" reporter:datatype="text"/>
13838                         <field name="new_value" reporter:datatype="text"/>
13839                         <field name="field_name" reporter:datatype="link"/>
13840                 </fields>
13841                 <links>
13842                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13843                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13844                 </links>
13845         </class>
13846         <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">
13847                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13848                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13849                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13850                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13851                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13852                 </fields>
13853                 <links>
13854                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13855                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13856                 </links>
13857         </class>
13858         <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">
13859                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13860                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13861                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13862                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13863                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13864                 </fields>
13865                 <links>
13866                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13867                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13868                 </links>
13869         </class>
13870         <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">
13871                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13872                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13873                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13874                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13875                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13876                 </fields>
13877                 <links>
13878                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13879                 </links>
13880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13881                         <actions>
13882                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13883                                 <retrieve/>
13884                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13885                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13886                         </actions>
13887                 </permacrud>
13888         </class>
13889         <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">
13890                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13891                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13892                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13893                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13894                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13895                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13896                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13897                 </fields>
13898                 <links>
13899                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13900                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13901                 </links>
13902                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13903                         <actions>
13904                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13905                                 <retrieve/>
13906                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13907                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13908                         </actions>
13909                 </permacrud>
13910         </class>
13911         <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">
13912                 <fields oils_persist:primary="code">
13913                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13914                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13915                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13916                 </fields>
13917                 <links>
13918                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13919                 </links>
13920                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13921                         <actions>
13922                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13923                                 <retrieve/>
13924                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13925                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13926                         </actions>
13927                 </permacrud>
13928         </class>
13929         <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">
13930                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13932                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13933                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13934                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13935                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13936                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13937                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13938                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13939                 </fields>
13940                 <links>
13941                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13942                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13943                 </links>
13944                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13945                         <actions>
13946                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13947                                 <retrieve/>
13948                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13949                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13950                         </actions>
13951                 </permacrud>
13952         </class>
13953         <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">
13954                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13955                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13956                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13957                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13958                 </fields>
13959                 <links>
13960                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13961                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13962                 </links>
13963                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13964                         <actions>
13965                                 <create permission="UPDATE_COPY">
13966                     <context link="copy" field="circ_lib"/>
13967                 </create>
13968                                 <retrieve/>
13969                                 <update permission="UPDATE_COPY">
13970                     <context link="copy" field="circ_lib"/>
13971                 </update>
13972                                 <delete permission="UPDATE_COPY">
13973                     <context link="copy" field="circ_lib"/>
13974                 </delete>
13975                         </actions>
13976                 </permacrud>
13977         </class>
13978         <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">
13979         <oils_persist:source_definition><![CDATA[
13980         SELECT ahcm.target_copy AS id,count(*) AS count
13981          FROM
13982          action.hold_request ahr,
13983          action.hold_copy_map ahcm
13984          WHERE
13985          ahr.cancel_time IS NULL AND
13986          ahr.fulfillment_time IS NULL AND
13987          ahr.capture_time IS NULL AND
13988          ahr.id = ahcm.hold
13989          GROUP BY ahcm.target_copy
13990         ]]></oils_persist:source_definition>
13991         <fields oils_persist:primary="id">
13992             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13993             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13994         </fields>
13995         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13996             <actions>
13997                <retrieve/>
13998             </actions>
13999         </permacrud>
14000         </class>
14001
14002         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
14003                 oils_obj:fieldmapper="config::workstation_setting_type" 
14004                 oils_persist:tablename="config.workstation_setting_type" 
14005                 reporter:label="Workstation Setting Type">
14006                 <fields oils_persist:primary="name">
14007                         <field name="name" reporter:datatype="text"/>
14008                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
14009                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
14010                         <field name="datatype" reporter:datatype="text"/>
14011                         <field name="fm_class" reporter:datatype="text"/>
14012                         <field name="grp" reporter:datatype="link"/>
14013                 </fields>
14014                 <links>
14015                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
14016                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
14017                 </links>
14018                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14019                         <actions>
14020                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14021                                 <retrieve/>
14022                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14023                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
14024                         </actions>
14025                 </permacrud>
14026         </class>
14027
14028         <!-- no pcrud access is granted for now, because it's assumed these
14029                          setting values will be applied and retrived via the API. -->
14030         <class id="awss" 
14031                 controller="open-ils.cstore"
14032                 oils_obj:fieldmapper="actor::workstation_setting" 
14033                 oils_persist:tablename="actor.workstation_setting" 
14034                 reporter:label="Workstation Setting">
14035                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
14036                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
14037                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
14038                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
14039                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
14040                 </fields>
14041                 <links>
14042                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
14043                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
14044                 </links>
14045         </class>
14046
14047         <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">
14048         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
14049                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
14050                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
14051                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
14052         </fields>
14053         </class>
14054
14055         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
14056                 oils_obj:fieldmapper="config::print_template" 
14057                 oils_persist:tablename="config.print_template" 
14058                 reporter:label="Print Templates">
14059                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
14060                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
14061                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
14062                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14063                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
14064                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
14065                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
14066                         <field name="content_type" reporter:datatype="text"/>
14067                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
14068                 </fields>
14069                 <links>
14070                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14071                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
14072                 </links>
14073                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14074                         <actions>
14075                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14076                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14077                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14078                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
14079                         </actions>
14080                 </permacrud>
14081         </class>
14082
14083         <class id="cct" 
14084                 controller="open-ils.cstore open-ils.pcrud"
14085                 oils_obj:fieldmapper="config::carousel_type" 
14086                 oils_persist:tablename="config.carousel_type" 
14087                 reporter:label="Carousel Types">
14088                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
14089                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
14090                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14091                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
14092                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
14093                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
14094                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
14095                 </fields>
14096                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14097                         <actions>
14098                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14099                                 <retrieve/>
14100                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14101                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
14102                         </actions>
14103                 </permacrud>
14104         </class>
14105
14106         <class id="cc" 
14107                 controller="open-ils.cstore open-ils.pcrud"
14108                 oils_obj:fieldmapper="container::carousel" 
14109                 oils_persist:tablename="container.carousel" 
14110                 reporter:label="Carousels">
14111                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
14112                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
14113                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
14114                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14115                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14116                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14117                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14118                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14119                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14120                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14121                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14122                         <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 -->
14123                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14124                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14125                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14126                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14127                 </fields>
14128                 <links>
14129                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14130                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14131                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14132                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14133                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14134                 </links>
14135                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14136                         <actions>
14137                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14138                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14139                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14140                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14141                         </actions>
14142                 </permacrud>
14143         </class>
14144
14145         <class id="ccou" 
14146                 controller="open-ils.cstore open-ils.pcrud"
14147                 oils_obj:fieldmapper="container::carousel_org_unit" 
14148                 oils_persist:tablename="container.carousel_org_unit" 
14149                 reporter:label="Carousels Visible at Library">
14150                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14151                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14152                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14153                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14154                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14155                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14156                 </fields>
14157                 <links>
14158                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14159                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14160                 </links>
14161                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14162                         <actions>
14163                                 <create permission="ADMIN_CAROUSEL">
14164                                     <context link="carousel" field="owner" />
14165                                 </create>
14166                                 <retrieve permission="ADMIN_CAROUSEL">
14167                                     <context link="carousel" field="owner" />
14168                                 </retrieve>
14169                                 <update permission="ADMIN_CAROUSEL">
14170                                     <context link="carousel" field="owner" />
14171                                 </update>
14172                                 <delete permission="ADMIN_CAROUSEL">
14173                                     <context link="carousel" field="owner" />
14174                                 </delete>
14175                         </actions>
14176                 </permacrud>
14177         </class>
14178
14179         <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">
14180                 <fields oils_persist:primary="name">
14181                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14182                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14183                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14184                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14185                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14186                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14187                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14188                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14189                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14190                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14191                 </fields>
14192                 <links>
14193                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14194                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14195                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14196                 </links>
14197                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14198                         <actions>
14199                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14200                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14201                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14202                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14203                         </actions>
14204                 </permacrud>
14205         </class>
14206         <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">
14207                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14208                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14209                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14210                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14211                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14212                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14213                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14214                 </fields>
14215                 <links>
14216                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14217                 </links>
14218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14219                         <actions>
14220                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14221                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14222                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14223                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14224                         </actions>
14225                 </permacrud>
14226         </class>
14227
14228     <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">
14229         <fields oils_persist:primary="code">
14230             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14231             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14232         </fields>
14233                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14234                         <actions>
14235                                 <retrieve/>
14236                         </actions>
14237                 </permacrud>
14238         </class>
14239
14240     <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">
14241         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14242             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14243             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14244             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14245             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14246             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14247             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14248             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14249             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14250                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14251         </fields>
14252                 <links>
14253                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14254                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14255                 </links>
14256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14257             <actions>
14258                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14259                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14260                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14261                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14262             </actions>
14263         </permacrud>
14264     </class>
14265
14266         <!-- Simple Reporter classes are currently used only by the SR UI -->
14267     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14268         <oils_persist:source_definition><![CDATA[
14269             SELECT
14270               -- Circ id; just for counting
14271               combcirc.id AS circ_id,
14272
14273               -- User info, currently limiting to what's available from action.all_circulation
14274               combcirc.usr_post_code AS usr_post_code,
14275               combcirc.usr_birth_year AS usr_bith_year,
14276               combcirc.usr_profile AS usr_profile_id,
14277               pgtu.name AS usr_profile,
14278               combcirc.usr_home_ou AS usr_home_ou_id,
14279               aouuh.shortname AS usr_home_ou_shortname,
14280               aouuh.name AS usr_home_ou_name,
14281               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14282               aouus.shortname AS usr_sys_shortname,
14283               aouus.name AS usr_sys_name,
14284
14285               -- Circ info
14286               -- Checkout
14287               combcirc.xact_start AS xact_start,
14288               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14289               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14290               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14291               combcirc.circ_lib AS circ_lib_id,
14292               aouco.shortname AS circ_lib_shortname,
14293               aouco.name AS circ_lib_name,
14294               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14295               aoucos.shortname AS circ_sys_shortname,
14296               aoucos.name AS circ_sys_name,
14297               auco.usrname AS circ_staff,
14298               awso.name AS checkout_workstation,
14299
14300               combcirc.due_date AS due_date,
14301               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14302               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14303               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14304
14305               -- Checkin
14306               combcirc.xact_finish AS xact_finish,
14307               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14308               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14309               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14310               aouci.shortname AS checkin_lib_shortname,
14311               aouci.name AS checkin_lib_name,
14312               auci.usrname AS checkin_staff,
14313               awsi.name AS checkin_workstation,
14314               aoucis.shortname AS checkin_sys_shortname,
14315               aoucis.name AS checkin_sys_name,
14316
14317               combcirc.checkin_time AS checkin_time,
14318
14319               -- Misc circ info
14320               combcirc.renewal_remaining AS renewal_remaining,
14321               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14322               combcirc.grace_period AS grace_period,
14323
14324               combcirc.stop_fines AS stop_fines,
14325               combcirc.stop_fines_time AS stop_fines_time,
14326
14327               combcirc.duration AS duration,
14328               combcirc.fine_interval AS fine_interval,
14329               combcirc.recurring_fine AS recurring_fine,
14330               combcirc.max_fine AS max_fine,
14331               combcirc.duration_rule AS duration_rule,
14332               combcirc.recurring_fine_rule AS recurring_fine_rule,
14333               combcirc.max_fine_rule AS max_fine_rule,
14334               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14335               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,
14336               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14337
14338               -- Copy info
14339               acp.barcode AS copy_barcode,
14340               acp.circ_modifier AS copy_circ_modifier_code,
14341               ccm.name AS copy_circ_modifier_name,
14342               acp.circ_lib AS copy_circ_lib_id,
14343               acp.location AS location_id,
14344               acpl.name AS location_name,
14345               aoucp.shortname AS copy_circ_lib_shortname,
14346               aoucp.name AS copy_circ_lib_name,
14347               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14348               aoucps.shortname AS copy_sys_shortname,
14349               aoucps.name AS copy_sys_name,
14350               combcirc.copy_owning_lib AS copy_owning_lib_id,
14351               aoucpo.shortname AS copy_owning_lib_shortname,
14352               aoucpo.name AS copy_owning_lib_name,
14353               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14354               acnp.label AS copy_call_number_prefix,
14355               acn.label AS copy_call_number_label,
14356               acns.label AS copy_call_number_suffix,
14357               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14358               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14359               acn.label_sortkey AS copy_call_number_label_sortkey,
14360               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14361               COALESCE(rmsr.title, acp.dummy_title) AS title,
14362               COALESCE(rmsr.author, acp.dummy_author) AS author,
14363               rmsr.publisher AS publisher,
14364               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14365               array_to_string(rmsr.isbn, ', ') AS isbn,
14366               array_to_string(rmsr.issn, ', ') AS issn,
14367               part.label AS part_label,
14368               part.label_sortkey AS part_label_sortkey,
14369               acn.record AS bib_id,
14370               rmsr.tcn_value AS tcn_value
14371
14372             FROM
14373               action.all_circulation combcirc
14374
14375               -- User
14376               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14377               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14378               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14379
14380               -- Circ
14381               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14382               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14383               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14384               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14385               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14386               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14387               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14388               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14389
14390               -- Copy / call / title
14391               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14392                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14393               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14394               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14395               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14396               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14397               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14398               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14399               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14400               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14401               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14402               LEFT JOIN (
14403                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14404                 FROM biblio.monograph_part bmp
14405                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14406                 WHERE NOT bmp.deleted
14407               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14408         ]]></oils_persist:source_definition>
14409         <field_groups>
14410             <group name="common" reporter:label="Common Fields"/>
14411             <group name="item" reporter:label="Item Fields"/>
14412             <group name="user" reporter:label="Patron Fields"/>
14413             <group name="title" reporter:label="Call Number and Title Fields"/>
14414             <group name="org" reporter:label="Libraries"/>
14415         </field_groups>
14416         <fields oils_persist:primary="circ_id">
14417             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14418             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14419             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14420             <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"/>
14421             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14422             <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"/>
14423             <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"/>
14424             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14425             <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"/>
14426             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14427             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14428             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14429             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14430             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14431             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14432             <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"/>
14433             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14434             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14435             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14436             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14437             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14438             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14439             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14440             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14441             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14442             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14443             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14444             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14445             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14446             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14447             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14448             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14449             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14450             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14451             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14452             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14453             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14454             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14455             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14456             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14457             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14458             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14459             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14460             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14461             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14462             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14463             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14464             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14465             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14466             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14467             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14468             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14469             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14470             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14471             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14472             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14473             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14474             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14475             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14476             <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"/>
14477             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14478             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14479             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14480             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14481             <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"/>
14482             <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"/>
14483             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14484             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14485             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14486             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14487             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14488             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14489             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14490             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14491             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14492             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14493             <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"/>
14494             <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"/>
14495             <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"/>
14496             <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"/>
14497             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14498             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14499             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14500             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14501             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14502             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14503             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14504             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14505             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14506             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14507         </fields>
14508         <links>
14509             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14510             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14511             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14512         </links>
14513     </class>
14514
14515     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14516         <oils_persist:source_definition><![CDATA[
14517             SELECT
14518               au.home_ou AS home_ou_filter,
14519               au.id AS user_id,
14520               cardp.barcode AS barcode_primary,
14521               au.usrname AS usrname,
14522               au.email AS email,
14523               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14524               au.prefix AS prefix,
14525               au.first_given_name AS first_given_name,
14526               au.second_given_name AS second_given_name,
14527               au.family_name AS family_name,
14528               au.suffix AS suffix,
14529               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14530               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14531               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14532               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14533               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14534               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14535               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14536               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14537               au.profile AS profile_id,
14538               pgt.name AS profile,
14539               au.alias AS alias,
14540               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14541               au.day_phone AS day_phone,
14542               au.evening_phone AS evening_phone,
14543               au.other_phone AS other_phone,
14544               au.dob AS dob,
14545               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14546               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14547               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14548               au.active AS active,
14549               au.barred AS barred,
14550               au.deleted AS deleted,
14551               au.juvenile AS juvenile,
14552               au.claims_returned_count AS claims_returned_count,
14553               au.credit_forward_balance AS credit_forward_balance,
14554               au.create_date AS create_date,
14555               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14556               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14557               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14558               au.expire_date AS expire_date,
14559               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14560               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14561               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14562               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14563               au.last_update_time AS last_update_time,
14564               au.home_ou AS home_ou_id,
14565               aouh.shortname AS home_ou_shortname,
14566               aouh.name AS home_ou_name,
14567               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14568               aous.shortname AS home_sys_shortname,
14569               aous.name AS home_sys_name,
14570               auam.valid AS mailing_valid,
14571               auam.address_type AS mailing_address_type,
14572               auam.street1 AS mailing_street1,
14573               auam.street2 AS mailing_street2,
14574               auam.city AS mailing_city,
14575               auam.state AS mailing_state,
14576               auam.country AS mailing_country,
14577               auam.post_code AS mailing_post_code,
14578               auam.county AS mailing_county,
14579               auam.within_city_limits AS mailing_within_city_limits,
14580               auam.pending AS mailing_pending,
14581               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14582               auap.valid AS physical_valid,
14583               auap.address_type AS physical_address_type,
14584               auap.street1 AS physical_street1,
14585               auap.street2 AS physical_street2,
14586               auap.city AS physical_city,
14587               auap.state AS physical_state,
14588               auap.country AS physical_country,
14589               auap.post_code AS physical_post_code,
14590               auap.county AS physical_county,
14591               auap.within_city_limits AS physical_within_city_limits,
14592               auap.pending AS physical_pending,
14593               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14594               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14595               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14596               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14597               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14598               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14599               asceum1.stat_cat_entry AS legacy_stat_cat1,
14600               asceum2.stat_cat_entry AS legacy_stat_cat2,
14601
14602               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14603               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14604               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14605               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14606               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,
14607               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14608
14609             FROM
14610               actor.usr au
14611               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14612               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14613               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14614               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14615               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14616               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14617               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14618               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14619               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14620               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14621               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14622               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14623               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14624               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14625               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14626               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14627
14628             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14629               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14630               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14631               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14632               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14633               76,77,78,79,80,81
14634         ]]></oils_persist:source_definition>
14635         <field_groups>
14636             <group name="common" reporter:label="Common Fields"/>
14637             <group name="name" reporter:label="Name Fields"/>
14638             <group name="contact" reporter:label="Contact Fields"/>
14639             <group name="address" reporter:label="Address Related Fields"/>
14640             <group name="org" reporter:label="Libraries"/>
14641         </field_groups>
14642         <fields oils_persist:primary="user_id">
14643             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14644                 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"/>
14645             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14646             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14647             <field reporter:label="OPAC/Staff Client Username" name="usrname" reporter:datatype="text" field_groups="common"/>
14648             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14649             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14650             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14651             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14652             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14653             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14654             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14655             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14656             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14657             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14658             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14659             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14660             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14661             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14662             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14663             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14664             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14665             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14666             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14667             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14668             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14669             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14670             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14671             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14672             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14673             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14674             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14675             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14676             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14677             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14678             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14679             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14680             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14681             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14682             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14683             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14684             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14685             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14686             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14687             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14688             <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"/>
14689             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14690             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14691             <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"/>
14692             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14693             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14694             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14695             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14696             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14697             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14698             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14699             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14700             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14701             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14702             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14703             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14704             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14705             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14706             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14707             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14708             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14709             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14710             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14711             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14712             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14713             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14714             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14715             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14716             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14717             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14718             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14719             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14720             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14721             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14722             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14723             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14724             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14725             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14726             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14727             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14728             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14729             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14730         </fields>
14731         <links>
14732             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14733         </links>
14734     </class>
14735
14736     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14737         <oils_persist:source_definition><![CDATA[
14738             SELECT
14739               -- ids
14740               acp.id AS copy_id,
14741               acp.floating AS floating_id,
14742               acn.id AS acn_id,
14743               acp.circ_lib AS circ_lib_id,
14744               acp.status AS status_id,
14745               acp.location AS location_id,
14746               acp.age_protect AS age_protect_id,
14747               aous.id AS circ_sys_id,
14748               acn.owning_lib AS owning_lib_id,
14749               aouos.id AS owning_sys_id,
14750               awsi.id AS inv_workstation_id,
14751
14752               -- OUs
14753               aou.shortname AS circ_lib_shortname,
14754               aou.name AS circ_lib_name,
14755               aous.shortname AS circ_sys_shortname,
14756               aous.name AS circ_sys_name,
14757               aouo.shortname AS owning_lib_shortname,
14758               aouo.name AS owning_lib_name,
14759               aouos.shortname AS owning_sys_shortname,
14760               aouos.name AS owning_sys_name,
14761
14762               -- dates
14763               acp.create_date AS create_date_time,
14764               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14765               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14766               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14767               acp.active_date AS active_date_time,
14768               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14769               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14770               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14771               acp.edit_date AS edit_date_time,
14772               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14773               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14774               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14775               acp.status_changed_time AS status_changed_time_time,
14776               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14777               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14778               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14779               ali.inventory_date AS latest_inv_date,
14780               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14781               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14782               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14783
14784               -- acp
14785               acp.barcode AS barcode,
14786               ccs.name AS status,
14787               acpl.name AS location_name,
14788                                                         acp.circ_modifier AS copy_circ_modifier_code,
14789                                                         ccm.name AS copy_circ_modifier_name,
14790               acp.price AS price,
14791               acp.cost AS acq_price,
14792               acp.deleted AS copy_deleted,
14793               acp.ref AS reference,
14794               acp.circulate AS copy_circulate,
14795               (acp.circulate AND acpl.circulate) AS circulate,
14796               acp.holdable AS copy_holdable,
14797               acp.deposit AS deposit,
14798               acp.deposit_amount AS deposit_amount,
14799               acp.alert_message AS alert_message,
14800               acp.opac_visible AS copy_opac_visible,
14801               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14802               crahp.name AS age_protect,
14803               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14804               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14805               acp.copy_number AS copy_number,
14806               acp.circ_as_type AS circ_as_type,
14807               acp.loan_duration AS loan_duration_int,
14808               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14809               acp.fine_level AS fine_level_int,
14810               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14811
14812               -- Call Number
14813               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14814               acnp.label AS copy_call_number_prefix,
14815               acn.label AS copy_call_number_label,
14816               acns.label AS copy_call_number_suffix,
14817               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14818               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14819               acn.label_sortkey AS copy_call_number_label_sortkey,
14820               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14821               racnd.dewey AS call_number_dewey,
14822               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14823               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14824               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14825               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14826
14827               -- Misc
14828               COALESCE(rmsr.title, acp.dummy_title) AS title,
14829               COALESCE(rmsr.author, acp.dummy_author) AS author,
14830               rmsr.publisher AS publisher,
14831               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14832               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14833               array_to_string(rmsr.issn, ', ') AS issn,
14834               part.label AS part_label,
14835               part.label_sortkey AS part_label_sortkey,
14836               acn.record AS bib_id,
14837               rmsr.tcn_value AS tcn_value,
14838               acn.deleted AS call_deleted,
14839               bre.deleted AS bib_deleted,
14840               ccs.holdable AS status_holdable,
14841               acpl.holdable AS location_holdable,
14842               acp.circulate AS location_circulate,
14843               awsi.name AS inventory_workstation,
14844               aucr.usrname AS creating_user,
14845               aued.usrname AS editing_user,
14846
14847               -- Aggregates
14848               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14849               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,
14850               COUNT(DISTINCT combcirc.id) AS circ_total,
14851               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14852
14853             FROM
14854               asset.copy acp
14855               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14856               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14857               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14858               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14859               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14860               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14861               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14862               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14863               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14864               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14865               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14866               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14867               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14868               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14869               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14870               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14871               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14872               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14873               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14874               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14875               LEFT JOIN (
14876                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14877                 FROM biblio.monograph_part bmp
14878                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14879                 WHERE NOT bmp.deleted
14880               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14881
14882             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14883               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14884               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14885               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14886               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14887               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14888               91,92,93,94,95,96
14889
14890         ]]></oils_persist:source_definition>
14891         <field_groups>
14892             <group name="common" reporter:label="Common Fields"/>
14893             <group name="dates" reporter:label="Date Fields"/>
14894             <group name="title" reporter:label="Call Number and Title Fields"/>
14895             <group name="org" reporter:label="Libraries"/>
14896         </field_groups>
14897         <fields oils_persist:primary="copy_id">
14898             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14899             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14900             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14901             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14902             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14903             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14904             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14905             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14906             <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"/>
14907             <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"/>
14908             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14909             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14910             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14911             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14912             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14913             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14914             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14915             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14916             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14917             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14918             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14919             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14920             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14921             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14922             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14923             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14924             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14925             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14926             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14927             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14928             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14929             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14930             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14931             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14932             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14933             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14934             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14935             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14936             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14937             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14938             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14939             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14940             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14941             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14942             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14943             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14944             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14945             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14946             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14947             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14948             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14949             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14950             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14951             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14952             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14953             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14954             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14955             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14956             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14957             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14958             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14959             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14960             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14961             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14962             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14963             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14964             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14965             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14966             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14967             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14968             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14969             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14970             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14971             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14972             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14973             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14974             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14975             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14976             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14977             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14978             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14979             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14980             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14981             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14982             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14983             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14984             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14985             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14986             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14987             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14988             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14989             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14990             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14991             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14992         </fields>
14993         <links>
14994             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14995             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14996             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14997             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14998             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14999             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15000         </links>
15001     </class>
15002
15003     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
15004         <oils_persist:source_definition><![CDATA[
15005
15006             SELECT
15007               -- ids
15008               acp.id AS copy_id,
15009               acn.id AS acn_id,
15010               acp.circ_lib AS circ_lib_id,
15011               acp.status AS status_id,
15012               acp.location AS location_id,
15013               acp.age_protect AS age_protect_id,
15014               aous.id AS circ_sys_id,
15015               acn.owning_lib AS owning_lib_id,
15016               aouos.id AS owning_sys_id,
15017               awsi.id AS inv_workstation_id,
15018
15019               -- OUs
15020               aou.shortname AS circ_lib_shortname,
15021               aou.name AS circ_lib_name,
15022               aous.shortname AS circ_sys_shortname,
15023               aous.name AS circ_sys_name,
15024               aouo.shortname AS owning_lib_shortname,
15025               aouo.name AS owning_lib_name,
15026               aouos.shortname AS owning_sys_shortname,
15027               aouos.name AS owning_sys_name,
15028
15029               -- dates
15030               acp.create_date AS create_date_time,
15031               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
15032               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
15033               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
15034               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
15035               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
15036               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
15037               acp.active_date AS active_date_time,
15038               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
15039               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
15040               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
15041               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
15042               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
15043               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
15044               acp.edit_date AS edit_date_time,
15045               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
15046               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
15047               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
15048               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
15049               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
15050               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
15051               acp.status_changed_time AS status_changed_time_time,
15052               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
15053               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
15054               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
15055               ali.inventory_date AS latest_inv_date,
15056               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
15057               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
15058               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
15059               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
15060               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
15061               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
15062
15063               -- acp
15064               acp.barcode AS barcode,
15065               ccs.name AS status,
15066               acpl.name AS location_name,
15067               acp.circ_modifier AS circ_modifier_code,
15068               ccm.name AS circ_modifier_name,
15069               acp.price AS price,
15070               acp.cost AS acq_price,
15071               acp.deleted AS copy_deleted,
15072               acp.ref AS reference,
15073               acp.circulate AS copy_circulate,
15074               (acp.circulate AND acpl.circulate) AS circulate,
15075               acp.holdable AS copy_holdable,
15076               acp.deposit AS deposit,
15077               acp.deposit_amount AS deposit_amount,
15078               acp.alert_message AS alert_message,
15079               acp.opac_visible AS copy_opac_visible,
15080               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
15081               crahp.name AS age_protect,
15082               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
15083               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
15084               acp.copy_number AS copy_number,
15085               acp.circ_as_type AS circ_as_type,
15086               acp.loan_duration AS loan_duration_int,
15087               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
15088               acp.fine_level AS fine_level_int,
15089               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
15090
15091               -- Call Number
15092               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
15093               acnp.label AS copy_call_number_prefix,
15094               acn.label AS copy_call_number_label,
15095               acns.label AS copy_call_number_suffix,
15096               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
15097               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
15098               acn.label_sortkey AS copy_call_number_label_sortkey,
15099               acns.label_sortkey AS copy_call_number_suffix_sortkey,
15100               racnd.dewey AS call_number_dewey,
15101               racnd.dewey_block_tens AS call_number_dewey_block_tens,
15102               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
15103               racnd.dewey_range_tens AS call_number_dewey_range_tens,
15104               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
15105
15106               -- Misc
15107               COALESCE(rmsr.title, acp.dummy_title) AS title,
15108               COALESCE(rmsr.author, acp.dummy_author) AS author,
15109               rmsr.publisher AS publisher,
15110               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
15111               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
15112               array_to_string(rmsr.issn, ', ') AS issn,
15113               part.label AS part_label,
15114               part.label_sortkey AS part_label_sortkey,
15115               acn.record AS bib_id,
15116               rmsr.tcn_value AS tcn_value,
15117               acn.deleted AS call_deleted,
15118               bre.deleted AS bib_deleted,
15119               ccs.holdable AS status_holdable,
15120               acpl.holdable AS location_holdable,
15121               acp.circulate AS location_circulate,
15122               awsi.name AS inventory_workstation,
15123
15124               -- Aggregates
15125               -- may decide these price games aren't worth it, but estimated collection value is useful
15126               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,
15127               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15128               MAX(combcirc.xact_start) AS last_circ_datetime,
15129               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15130               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15131               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15132               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15133               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15134               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15135               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15136               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15137               (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,
15138               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15139               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15140               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15141               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15142               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15143               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15144               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,
15145               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,
15146               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,
15147               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
15148
15149             FROM
15150               asset.copy acp
15151               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15152               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15153               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15154               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15155               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15156               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15157               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15158               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15159               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15160               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15161               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15162               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15163               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15164               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15165               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15166               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15167               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15168               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15169               LEFT JOIN (
15170                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15171                 FROM biblio.monograph_part bmp
15172                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15173                 WHERE NOT bmp.deleted
15174               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15175
15176             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15177               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15178               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15179               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15180               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15181               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15182               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15183
15184         ]]></oils_persist:source_definition>
15185         <field_groups>
15186             <group name="common" reporter:label="Common Fields"/>
15187             <group name="dates" reporter:label="Date Fields"/>
15188             <group name="inv" reporter:label="Inventory Fields"/>
15189             <group name="title" reporter:label="Call Number and Title Fields"/>
15190             <group name="org" reporter:label="Libraries"/>
15191         </field_groups>
15192         <fields oils_persist:primary="copy_id">
15193              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15194              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15195              <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"/>
15196              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15197              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15198              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15199              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15200              <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"/>
15201              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15202              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15203              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15204              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15205              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15206              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15207              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15208              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15209              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15210              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15211              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15212              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15213              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15214              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15215              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15216              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15217              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15218              <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"/>
15219              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15220              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15221              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15222              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15223              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15224              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15225              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15226              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15227              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15228              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15229              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15230              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15231              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15232              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15233              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15234              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15235              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15236              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15237              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15238              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15239              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15240              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15241              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15242              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15243              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15244              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15245              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15246              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15247              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15248              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15249              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15250              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15251              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15252              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15253              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15254              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15255              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15256              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15257              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15258              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15259              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15260              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15261              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15262              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15263              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15264              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15265              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15266              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15267              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15268              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15269              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15270              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15271              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15272              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15273              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15274              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15275              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15276              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15277              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15278              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15279              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15280              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15281              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15282              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15283              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15284              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15285              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15286              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15287              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15288              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15289              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15290              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15291              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15292              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15293              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15294              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15295              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15296              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15297              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15298              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15299              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15300              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15301              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15302              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15303              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15304              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15305              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15306              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15307              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15308              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15309              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15310              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15311              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15312              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15313              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15314              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15315              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15316              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15317              <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"/>
15318              <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"/>
15319              <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"/>
15320         </fields>
15321         <links>
15322             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15323             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15324             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15325             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15326             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15327         </links>
15328     </class>
15329
15330     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15331         <oils_persist:source_definition><![CDATA[
15332
15333             SELECT
15334               -- ids
15335               xact.id AS xact_id,
15336               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15337               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15338
15339               -- OUs
15340               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15341               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15342               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15343               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15344
15345               -- billings
15346               billings.total_amount AS billing_grand_total,
15347               billings.total_unvoided_amount AS billing_total,
15348
15349               billings.voided_billing_count AS billing_voided_count,
15350               billings.all_billing_types AS all_billing_types,
15351               billings.billing_types AS billing_types,
15352
15353               billings.total_voided_amount AS billing_total_voided,
15354               billings.total_overdue_amount AS billing_overdue_amount,
15355               billings.total_lost_amount AS billing_lost_amount,
15356               billings.total_long_od_amount AS billing_long_od_amount,
15357               billings.total_damaged_amount AS billing_damaged_amount,
15358               billings.total_deposit_amount AS billing_deposit_amount,
15359               billings.total_rental_amount AS billing_rental_amount,
15360
15361               -- payments
15362               payments.total_amount AS payment_grand_total,
15363               payments.total_unvoided_amount AS payment_total,
15364
15365               payments.voided_payment_count AS payment_voided_count,
15366               payments.all_payment_types AS all_payment_types,
15367               payments.payment_types AS payment_types,
15368
15369               payments.total_voided_amount AS payment_total_voided,
15370               payments.total_account_adjustment AS payment_account_adjustment_amount,
15371               payments.total_cash_payment AS payment_cash_amount,
15372               payments.total_check_payment AS payment_check_amount,
15373               payments.total_credit_card_payment AS payment_credit_card_amount,
15374               payments.total_debit_card_payment AS payment_debit_card_amount,
15375               payments.total_credit_payment AS payment_credit_amount,
15376               payments.total_forgive_payment AS payment_forgive_amount,
15377               payments.total_work_payment AS payment_work_amount,
15378               payments.total_goods_payment AS payment_goods_amount,
15379               payments.total_currency_payment AS payment_currency_amount,
15380               payments.total_non_currency_payment AS payment_non_currency_amount,
15381
15382               -- dates
15383               xact.xact_start AS xact_start,
15384               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15385               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15386               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15387               xact.xact_finish AS xact_finish,
15388               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15389               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15390               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15391               billings.earliest_billing_ts AS earliest_billing_ts,
15392               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15393               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15394               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15395               billings.latest_billing_ts AS latest_billing_ts,
15396               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15397               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15398               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15399               payments.earliest_payment_ts AS earliest_payment_ts,
15400               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15401               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15402               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15403               payments.latest_payment_ts AS latest_payment_ts,
15404               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15405               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15406               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15407
15408               -- Misc
15409               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15410               (xact.xact_finish IS NOT NULL) AS xact_closed
15411
15412             FROM
15413               money.billable_xact xact
15414               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15415               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15416               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15417               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15418               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15419               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15420
15421               -- oohh nooo.... If not done this way you encounter situations
15422               -- like multiplying billing totals x number of payments and
15423               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15424               LEFT JOIN (
15425                 SELECT
15426                   xact,
15427                   MIN(billing_ts) AS earliest_billing_ts,
15428                   MAX(billing_ts) AS latest_billing_ts,
15429
15430                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15431                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15432                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15433
15434                   SUM(amount) AS total_amount,
15435                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15436                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15437                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15438                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15439                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15440                   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.
15441                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15442                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15443
15444                 FROM
15445                   money.all_billings
15446                 GROUP BY 1
15447               ) billings ON (xact.id = billings.xact)
15448               -- Can't include accepting user or cash_drawer because that will "duplicate"
15449               -- rows if multiple staff accept payments on a single xact...
15450               LEFT JOIN (
15451                 SELECT
15452                   xact,
15453                   MIN(payment_ts) AS earliest_payment_ts,
15454                   MAX(payment_ts) AS latest_payment_ts,
15455
15456                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15457                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15458                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15459
15460                   SUM(amount) AS total_amount,
15461                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15462                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15463                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15464                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15465                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15466                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15467                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15468                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15469                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15470                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15471                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15472                   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,
15473                   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
15474
15475                 FROM
15476                   money.all_payments
15477                 GROUP BY 1
15478               ) payments ON (xact.id = payments.xact)
15479
15480         ]]></oils_persist:source_definition>
15481         <field_groups>
15482             <group name="common" reporter:label="Common Fields"/>
15483             <group name="bill" reporter:label="Billing Fields"/>
15484             <group name="pay" reporter:label="Payment Fields"/>
15485             <group name="dates" reporter:label="Date Fields"/>
15486             <group name="org" reporter:label="Libraries"/>
15487         </field_groups>
15488         <fields oils_persist:primary="xact_id">
15489              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15490              <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"/>
15491              <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"/>
15492              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15493              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15494              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15495              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15496              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15497              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15498              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15499              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15500              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15501              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15502              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15503              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15504              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15505              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15506              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15507              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15508              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15509              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15510              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15511              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15512              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15513              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15514              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15515              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15516              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15517              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15518              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15519              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15520              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15521              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15522              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15523              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15524              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15525              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15526              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15527              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15528              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15529              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15530              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15531              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15532              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15533              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15534              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15535              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15536              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15537              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15538              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15539              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15540              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15541              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15542              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15543              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15544              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15545              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15546              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15547              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15548              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15549              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15550              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15551         </fields>
15552     </class>
15553
15554         <class id="coauf" 
15555                 controller="open-ils.cstore open-ils.pcrud"
15556                 oils_obj:fieldmapper="config::openathens_uid_field" 
15557                 oils_persist:tablename="config.openathens_uid_field" 
15558                 reporter:label="OpenAthens unique identifiers">
15559                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15560                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15561                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15562                 </fields>
15563                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15564                         <actions>
15565                                 <retrieve/>
15566                         </actions>
15567                 </permacrud>
15568         </class>
15569
15570         <class id="coanf" 
15571                 controller="open-ils.cstore open-ils.pcrud"
15572                 oils_obj:fieldmapper="config::openathens_name_field" 
15573                 oils_persist:tablename="config.openathens_name_field" 
15574                 reporter:label="OpenAthens name fields">
15575                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15576                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15577                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15578                 </fields>
15579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15580                         <actions>
15581                                 <retrieve/>
15582                         </actions>
15583                 </permacrud>
15584         </class>
15585
15586         <class id="coai" 
15587                 controller="open-ils.cstore open-ils.pcrud"
15588                 oils_obj:fieldmapper="config::openathens_identity" 
15589                 oils_persist:tablename="config.openathens_identity" 
15590                 reporter:label="Sign-on to OpenAthens">
15591                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15592                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15593                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15594                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15595                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15596                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15597                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15598                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15599                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15600                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15601                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15602                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15603                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15604                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15605                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15606                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15607                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15608                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15609                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15610                 </fields>
15611                 <links>
15612                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15613                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15614                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15615                 </links>
15616                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15617                         <actions>
15618                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15619                                 <retrieve/>
15620                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15621                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15622                         </actions>
15623                 </permacrud>
15624         </class>
15625
15626         <!-- ********************************************************************************************************************* -->
15627 </IDL>
15628
15629 <!-- Local Variables: -->
15630 <!-- indent-tabs-mode: t -->
15631 <!-- tab-width: 4 -->
15632 <!-- nxml-child-indent: 4 -->
15633 <!-- End: -->
15634 <!--
15635         vim:noet:ts=4:sw=4:
15636 -->