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

Last change on this file since 734 was 734, checked in by gav, 13 years ago

Include supplier.name in InventoryPurchase filterpane search.

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