1 [% WRAPPER 'default/base.tt2' %]
3 var fundID = [% ctx.page_args.0 %]
4 function getFundingSource(rowIndex) {
5 data = fundAllocationGrid.model.getRow(rowIndex);
7 var fs = openils.acq.FundingSource.retrieve(data.funding_source);
8 return '<a href="[% ctx.base_uri %]/acq/funding_source/view/'+fs.id()+'">'+fs.name()+'</a>';
13 <!-- load the page-specific JS -->
14 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/view_fund.js'> </script>
16 <div id='oils-acq-list-header' class='container'>
17 <div id='oils-acq-list-header-label'>Fund Details</div>
20 <div class='oils-acq-actions-div' style='margin:8px;'> <!-- XXX CSS -->
21 <!-- Dropdown menu for creating a new funding source credit -->
22 <div dojoType="dijit.form.DropDownButton">
23 <span>Create Allocation</span>
24 <div dojoType="dijit.TooltipDialog" execute="createAllocation(arguments[0]);">
25 <script type='dojo/connect' event='onOpen'>
26 openils.acq.FundingSource.createStore(
28 fundingSourceSelector.store =
29 new dojo.data.ItemFileReadStore({data:store});
30 fundingSourceSelector.setValue(store.items[0].code);
31 }, 'MANAGE_FUNDING_SOURCE'
34 <table class='dijitTooltipTable'>
36 <td><label for="amount">Funding Source: </label></td>
38 <input jsId='fundingSourceSelector' name="funding_source"
39 dojoType="dijit.form.FilteringSelect" searchAttr='code' labelAttr='code'>
44 <td><label for="amount">Amount: </label></td>
46 <!-- XXX get currency from funding source ... -->
47 <input dojoType="dijit.form.CurrencyTextBox" name="amount" currency='USD'> </input>
51 <td><label for="amount">Percent: </label></td>
54 dojoType="dijit.form.NumberTextBox"
55 constraints="{min:0,max:100}"
56 promptMessage="Please enter an amount between 0 and 100"
62 <td><label for="note">Note: </label></td>
64 <input dojoType="dijit.form.TextBox" name="note"> </input>
68 <td colspan='2' align='center'>
69 <button dojoType=dijit.form.Button type="submit">Apply</button>
78 <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
79 <div dojoType="dijit.layout.TabContainer">
80 <div dojoType="dijit.layout.ContentPane"
81 class='oils-acq-detail-content-pane' title="Summary" selected='true'>
83 /** Define the columns for the fund grid ----- */
84 var fundGridLayout = [{
86 {name: 'ID', field: 'id'},
87 {name: 'Name', field: "name", width:'auto'},
88 {name: 'Code', field: "code"},
89 {name: 'Currency Type', field: "currency_type"},
90 {name: 'Owner', get:getOrgInfo},
92 {name: 'Balance (Total - (Spent + Encumbrances))")}', get:getSummaryInfo},
93 {name: 'Amount Allocated to this Fund")}', get:getSummaryInfo},
94 {name: 'Spent Balance (Total - Spent)")}', get:getSummaryInfo},
95 {name: 'Total Debits (Spent + Encumbered)")}', get:getSummaryInfo},
97 {name: 'Balance', get:getSummaryInfo, field:'combined_balance'},
98 {name: 'Total Allocated', get:getSummaryInfo, field:'allocation_total'},
99 {name: 'Spent Balance', get:getSummaryInfo, field:'spent_balance'},
100 {name: 'Total Debits', get:getSummaryInfo, field:'debit_total'},
101 {name: 'Total Spent', get:getSummaryInfo, field:'spent_total'},
102 {name: 'Total Encumbered', get:getSummaryInfo, field:'encumbrance_total'}
106 <div jsId='fundGrid' dojoType="dojox.Grid" structure='fundGridLayout'> </div>
108 <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Allocations">
109 <script type='dojo/connect' event='onShow'>loadAllocationGrid();</script>
111 /** Define the columns for the funding source allocations grid ----- */
112 var fundAllocationGridLayout = [{
114 {name: 'ID', field: 'id'},
115 {name: 'Funding Source', field: "fund", get:getFundingSource},
116 {name: 'Amount', field: "amount"},
117 {name: 'Percent', field: "percent"},
118 {name: 'Allocated By', field: "allocator"},
119 {name: 'Note', field: "note", width:'auto'},
123 <div jsId='fundAllocationGrid' dojoType="dojox.Grid" structure='fundAllocationGridLayout'> </div>
125 <div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="Debits">
126 <script type='dojo/connect' event='onShow'>loadDebitGrid();</script>
128 /** Define the columns for the funding source credits grid ----- */
129 var fundDebitGridLayout = [{
131 {name: 'ID', field: 'id'},
132 {name: 'Origin Amount', field: "origin_amount"},
133 {name: 'Origin Currency Type', field: "origin_currency_type"},
134 {name: 'Amount', field: "amount"},
135 {name: 'Encumbrance', field: "encumbrance"},
136 {name: 'Debit Type', field: "debit_type"},
137 {name: 'Transfer Destination', field: "xfer_destination", get:getXferDest},
141 <div jsId='fundDebitGrid' dojoType="dojox.Grid" structure='fundDebitGridLayout'> </div>