source: trunk/grails-app/views/inventoryItemPurchaseDetailed/search.gsp @ 468

Last change on this file since 468 was 468, checked in by gav, 14 years ago

Add inventory item purchase search view and logic.

File size: 13.2 KB
Line 
1<html>
2    <head>
3        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4        <meta name="layout" content="main" />
5        <title>Inventory Item Purchase Search</title>
6        <filterpane:includes />
7        <nav:resources override="true"/>
8        <export:resource />
9    </head>
10    <body>
11        <div class="nav">
12            <h1>Inventory Purchases</h1>
13        </div>
14
15        <div class="body">
16            <g:render template="/shared/messages" />
17            <g:if test="${params.message}">
18                <div class="message">${params.message}</div>
19            </g:if>
20            <filterpane:currentCriteria domainBean="InventoryItemPurchase"
21                                    action="search"
22                                    dateFormat="EEE, dd-MMM-yyyy"
23                                    removeImgDir="images"
24                                    removeImgFile="bullet_delete.png"
25                                    title="Advanced Search"/>
26
27            <div class="paginateButtons">
28                <span class="searchButtons">
29                    <a href='' onclick="showElement('searchPane'); return false;">Quick</a>
30                </span>
31                Results: ${inventoryItemPurchaseList.size()} / ${inventoryItemPurchaseTotal}
32                <span class="searchButtons">
33                    <filterpane:filterButton text="Advanced" appliedText="Advanced" />
34                </span>
35            </div>
36
37            <jsUtil:toggleControl toggleId="options"
38                                                    imageId="optionsImg"
39                                                    closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}"
40                                                    openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}"
41                                                    text="${g.message(code: 'default.options.text')}"
42                                                    />
43
44            <div id="options" style="display:none;">
45                <g:form method="post" >
46                    <g:hiddenField name="params" value="${filterParams}" />
47                    <div class="dialog">
48                        <table>
49                            <tbody>
50
51                                <tr class="prop">
52                                    <td valign="top" class="name">
53                                        <label for="max">Results per page:</label>
54                                    </td>
55                                    <td valign="top" class="value">
56                                        <input type="text" maxlength="4" id="description" name="newMax" value="${params.max}"/>
57
58                                        <span class="buttons">
59                                            <g:actionSubmit action="setSearchParamsMax" class="go" value="Update" />
60                                        </span>
61                                    </td>
62                                </tr>
63
64                            </tbody>
65                        </table>
66                    </div>
67                <export:formats  params="${filterParams}" formats="['csv', 'excel', 'pdf', 'rtf']"/>
68                </g:form>
69            </div>
70
71            <br />
72
73            <g:if test="${inventoryItemPurchaseList.size() > 10}">
74                <g:if test="${inventoryItemPurchaseTotal > inventoryItemPurchaseList.size()}">
75                    <div class="paginateButtons">
76                        <g:paginate total="${inventoryItemPurchaseTotal}" params="${filterParams}" />
77                    </div>
78                </g:if>
79            </g:if>
80
81            <g:if test="${inventoryItemPurchaseList.size() > 0}">
82                <div class="list">
83                    <table>
84                        <thead>
85                            <tr>
86                                <g:sortableColumn property="purchaseOrderNumber"
87                                                                    title="Order #" params="${filterParams}"  />
88                                <g:sortableColumn property="dateEntered"
89                                                                    title="Date" params="${filterParams}" />
90                                <g:sortableColumn property="costCode"
91                                                                    title="Cost Code" params="${filterParams}" />
92                                <g:sortableColumn property="quantity"
93                                                                    title="Quantity" params="${filterParams}" />
94                                <g:sortableColumn property="orderValueAmount"
95                                                                    title="Order \$" params="${filterParams}" />
96                                <g:sortableColumn property="invoiceNumber"
97                                                                    title="Invoice Number" params="${filterParams}" />
98                                <g:sortableColumn property="inventoryItemPurchaseType"
99                                                                    title="Type" params="${filterParams}" />
100                                <th>
101                                    <img  src="${resource(dir:'images/skin',file:'database_go_grey.png')}" alt="Show" title="Show" />
102                                </th>
103                                <th>
104                                    <img  src="${resource(dir:'images/skin',file:'basket_put_grey.png')}" alt="Receive" title="Receive" />
105                                </th>
106                                <th>
107                                    <img  src="${resource(dir:'images/skin',file:'tick_grey.png')}" alt="Approve" title="Approve Payment" />
108                                </th>
109                            </tr>
110                        </thead>
111                        <tbody>
112                            <g:each in="${inventoryItemPurchaseList}" status="i" var="purchase">
113                                <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
114
115                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
116                                        ${fieldValue(bean:purchase, field:'purchaseOrderNumber')}
117                                    </td>
118                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
119                                        <g:formatDate date="${purchase.dateEntered}" format="EEE, dd-MMM-yyyy"/>
120                                    </td>
121                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
122                                        ${fieldValue(bean:purchase, field:'costCode')}
123                                    </td>
124                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
125                                        ${fieldValue(bean:purchase, field:'quantity')}
126                                    </td>
127                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
128                                        ${fieldValue(bean:purchase, field:'orderValueAmount')}
129                                        ${fieldValue(bean:purchase, field:'orderValueCurrency')}
130                                    </td>
131                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
132                                        ${fieldValue(bean:purchase, field:'invoiceNumber')}
133                                    </td>
134                                    <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
135                                        ${fieldValue(bean:purchase, field:'inventoryItemPurchaseType')}
136                                    </td>
137                                    <td>
138                                        <g:link controller="inventoryItemPurchaseDetailed" action="show" id="${purchase.id}">
139                                            <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" />
140                                        </g:link>
141                                    </td>
142                                    <g:if test="${purchase.inventoryItemPurchaseType.id == 1}">
143                                        <g:if test="${!purchase.receivedComplete}">
144                                            <td>
145                                                <g:link controller="inventoryItemPurchaseDetailed" action="receive" id="${purchase.id}">
146                                                    <img  src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" />
147                                                </g:link>
148                                            </td>
149                                        </g:if>
150                                        <g:else>
151                                            <td>
152                                            </td>
153                                        </g:else>
154                                        <g:if test="${!purchase.invoicePaymentApproved}">
155                                            <td>
156                                                <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" id="${purchase.id}">
157                                                    <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" />
158                                                </g:link>
159                                            </td>
160                                        </g:if>
161                                        <g:else>
162                                            <td>
163                                            </td>
164                                        </g:else>
165                                    </g:if>
166                                    <g:else>
167                                        <td>
168                                        </td>
169                                        <td>
170                                        </td>
171                                    </g:else>
172
173                                </tr>
174                            </g:each>
175                        </tbody>
176                    </table>
177                </div>
178            </g:if>
179            <div class="paginateButtons">
180                <g:paginate total="${inventoryItemPurchaseTotal}" params="${filterParams}" />
181            </div>
182
183            <filterpane:filterPane domainBean="InventoryItemPurchase"
184                                    title="Advanced Search"
185                                    action="search"
186                                    class="overlayPane"
187                                    excludeProperties="orderValueCurrency"
188                                    associatedProperties="inventoryItemPurchaseType.name"
189                                    filterPropertyValues="${['inventoryItemPurchaseType.name':[values:InventoryItemPurchaseType.findAllByIsActive(true)],
190                                                                                dateEntered:[years:2020..2000,precision:'day']
191                                                                                ]}"/>
192        </div> <!-- end body  -->
193
194        <!-- Start Search Pane -->
195        <div class="overlayPane" id="searchPane" style="display:none;">
196            <h2>Quick Search</h2>
197            <g:form method="post" id="searchForm" name="searchForm" >
198                <table>
199                    <tbody>
200
201                        <tr class="prop">
202                            <td valign="top" class="name">
203                                <label>Type:</label>
204                            </td>
205                            <td valign="top" class="value">
206                                <g:link controller="inventoryItemPurchaseDetailed"
207                                                action="search"
208                                                params="[quickSearch: 'searchAllOrders']">
209                                                All Orders
210                                </g:link>
211                                <br />
212                                <g:link controller="inventoryItemPurchaseDetailed"
213                                                action="search"
214                                                params="[quickSearch: 'searchAllReceived']">
215                                                All Received
216                                </g:link>
217                            </td>
218                        </tr>
219
220                    </tbody>
221                </table>
222                <div class="buttons">
223                    <span class="button">
224                        <input type="button" value="${g.message(code:'fp.tag.filterPane.button.cancel.text', default:'Cancel')}" onclick="return hideElement('searchPane');" />
225                    </span>
226                </div>
227            </g:form>
228        </div> <!-- end search pane -->
229
230    </body>
231</html>
Note: See TracBrowser for help on using the repository browser.