2 [% ctx.page_title = l('Invoice Item Types') %]
3 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
4 <div>[% l('Invoice Item Types') %]</div>
6 <button dojoType="dijit.form.Button" onClick="aiitGrid.showCreateDialog();">[% l('New Invoice Item Type') %]</button>
7 <button dojoType="dijit.form.Button" onClick="aiitGrid.deleteSelected();">[% l('Delete Selected') %]</button>
10 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
11 <table jsId="aiitGrid"
12 dojoType="openils.widget.AutoGrid"
13 fieldOrder="['code', 'name', 'prorate']"
14 defaultCellWidth="'auto'"
21 <script type="text/javascript">
22 dojo.require("openils.widget.AutoGrid");
23 dojo.require("dijit.form.FilteringSelect");
24 dojo.require('openils.PermaCrud');
25 openils.Util.addOnLoad(
27 aiitGrid.loadAll({"order_by": {"aiit": "name"}});
29 // If either "prorate" or "blanket" are selected,
30 // the other must be deselected.
31 // "For neither can live while the other survives...."
32 aiitGrid.onEditPane = function(pane) {
34 pane.onSubmit = function(inv_type, ops) {
36 if (inv_type.blanket() == 't') {
37 if (inv_type.prorate() == 't') {
38 alert('[% l('Only one of "prorate" and "blanket" may be selected') %]');
43 (new openils.PermaCrud())[pane.mode](inv_type, ops);