source: trunk/grails-app/views/inventoryItemDetailed/show.gsp @ 718

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

Domain change: remove InventoryItem.averageDeliveryPeriod and averageDeliveryTime.

File size: 38.1 KB
Line 
1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
7        <title>Show InventoryItem</title>
8        <nav:resources override="true"/>
9        <resource:tabView skin="tabviewCustom" />
10        <g:render template="/shared/pictureHead" />
11    </head>
12    <body>
13        <div class="nav">
14            <nav:renderSubItems group="nav"/>
15        </div>
16        <div class="body">
17            <g:render template="/shared/messages" />
18            <g:if test="${inventoryItemInstance.isObsolete || !inventoryItemInstance.isActive}" >
19                <div class="errors">
20                    <ul>
21                        <g:if test="${inventoryItemInstance.isObsolete}" >
22                            <li><g:message code="inventory.item.is.obsolete.message" /><li>
23                        </g:if>
24                        <g:if test="${!inventoryItemInstance.isActive}" >
25                            <li><g:message code="inventory.item.not.active.message" /><li>
26                        </g:if>
27                    </ul>
28                </div>
29            </g:if>
30            <g:if test="${!inventoryItemInstance.enableReorderListing}" >
31                <div class="message">
32                    <g:message code="inventory.item.reorder.listing.disabled" />
33                </div>
34            </g:if>
35            <g:hasErrors bean="${inventoryMovementInstance}">
36                <div class="errors">
37                    <g:renderErrors bean="${inventoryMovementInstance}" as="list" />
38                </div>
39            </g:hasErrors>
40
41            <g:hasErrors bean="${inventoryItemInstance}">
42                <div class="errors">
43                    <g:renderErrors bean="${inventoryItemInstance}" as="list" />
44                </div>
45            </g:hasErrors>
46
47            <div class="tabHeader">
48                <h1>
49                    ${inventoryItemInstance.name}
50                </h1>
51                ${fieldValue(bean:inventoryItemInstance, field:'description')}
52            </div>
53
54            <br/>
55
56            <richui:tabView id="tabView">
57
58                <richui:tabLabels>
59                    <richui:tabLabel selected="${showTab.inventory}" title="Inventory Item" />
60                    <richui:tabLabel selected="${showTab.detail}" title="Detail" />
61                    <g:if test="${!inventoryMovementList.isEmpty()}">
62                        <richui:tabLabel selected="${showTab.movement}" title="Movement (${inventoryMovementList.size()})" />
63                    </g:if>
64                    <g:else>
65                        <richui:tabLabel selected="${showTab.movement}" title="Movement" />
66                    </g:else>
67                    <g:if test="${!inventoryItemPurchases.isEmpty()}">
68                        <richui:tabLabel selected="${showTab.purchasing}" title="Purchasing (${inventoryItemPurchases.size()})" />
69                    </g:if>
70                    <g:else>
71                        <richui:tabLabel selected="${showTab.purchasing}" title="Purchasing" />
72                    </g:else>
73                </richui:tabLabels>
74
75                <richui:tabContents>
76
77<!-- Start Inventory tab -->
78                    <richui:tabContent>
79
80                        <g:if test="${inventoryMovementInstance}" >
81
82                            <div id="useInventoryItemDiv" style="display:inline"> <!-- inline required for IE -->
83                                <div class="pane_close" >
84                                    <g:remoteLink action="clearUseInventoryItem" update="useInventoryItemDiv">
85                                        <img  src="${resource(dir:'images/skin',file:'cross.png')}" alt="Clear" title="Clear"/>
86                                    </g:remoteLink>
87                                </div>
88                                <g:form controller="inventoryItemDetailed" action="useInventoryItem" method="post" >
89                                    <div class="dialog">
90                                        <table>
91                                            <tbody>
92                                                    <g:hiddenField name="task.id" value="${inventoryMovementInstance.task.id}"/>
93                                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}"/>
94                                                    <tr class="prop">
95                                                        <td valign="top" class="name">Use on task:</td>
96                                                        <td valign="top" class="value">
97                                                            <g:link controller="taskDetailed" action="show" id="${inventoryMovementInstance.task.id}" >
98                                                                ${Task.get(inventoryMovementInstance.task.id).encodeAsHTML()}
99                                                            </g:link>
100                                                        </td>
101                                                    </tr>
102
103                                                    <tr class="prop">
104                                                        <td valign="top" class="name">
105                                                            <label for="quantity">Quantity:</label>
106                                                        </td>
107                                                        <td valign="top">
108                                                            <input class="medium ${hasErrors(bean:inventoryMovementInstance,field:'quantity','errors')}"
109                                                                        type="text" id="quantity" name="quantity"
110                                                                        value="${fieldValue(bean:inventoryMovementInstance,field:'quantity')}"/>
111                                                            ${inventoryItemInstance.unitOfMeasure?.encodeAsHTML()}
112
113                                                            <span class="buttons">
114                                                                <g:actionSubmit action="useInventoryItem" class="save" value="${InventoryMovementType.read(1)}" />
115                                                            </span>
116
117                                                        </td>
118                                                    </tr>
119
120                                            </tbody>
121                                        </table>
122                                    </div>
123                                </g:form>
124
125                                <br />
126                            </div>
127
128                        </g:if>
129
130                        <div class="dialog">
131                            <table>
132                                <tbody>
133
134                                    <tr class="prop">
135                                        <td valign="top" class="name">Picture:</td>
136                                        <td valign="top" class="value">
137                                            <g:if test="${inventoryItemInstance.picture}" >
138                                                <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span>
139                                            </g:if>
140                                            <g:else>
141                                                <g:link controller="pictureDetailed"
142                                                                params="['inventoryItem.id':inventoryItemInstance.id]"
143                                                                action="create">
144                                                    Add Picture
145                                                </g:link>
146                                            </g:else>
147                                        </td>
148                                    </tr>
149
150                                    <tr class="prop">
151                                        <td valign="top" class="name">Comment:</td>
152
153                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'comment')}</td>
154                                    </tr>
155
156                                    <tr class="prop">
157                                        <td valign="top" class="name">In Stock:</td>
158
159                                        <td valign="top" class="value">
160                                            ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')} ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()}
161                                        </td>
162                                    </tr>
163
164                                    <tr class="prop">
165                                        <td valign="top" class="name">Location:</td>
166
167                                        <td valign="top" class="value">
168                                            <g:link controller="inventoryLocationDetailed" action="show" id="${inventoryItemInstance.inventoryLocation?.id}">
169                                                ${inventoryItemInstance.inventoryLocation?.encodeAsHTML()}
170                                            </g:link>
171                                                in ${inventoryItemInstance.inventoryLocation?.inventoryStore.encodeAsHTML()}
172                                        </td>
173                                    </tr>
174
175                                    <tr class="prop">
176                                        <td valign="top" class="name">Active:</td>
177
178                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isActive')}</td>
179                                    </tr>
180
181                                    <tr class="prop">
182                                        <td valign="top" class="name">Alternate Items:</td>
183
184                                        <td  valign="top" style="text-align:left;" class="value">
185                                            <ul>
186                                            <g:each var="a" in="${ inventoryItemInstance.alternateItems.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
187                                                <li><g:link controller="inventoryItemDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
188                                            </g:each>
189                                            </ul>
190                                        </td>
191                                    </tr>
192
193                                    <tr class="prop">
194                                        <td valign="top" class="name">Spare For:</td>
195
196                                        <td  valign="top" style="text-align:left;" class="value">
197                                            <ul>
198                                            <g:each var="s" in="${ inventoryItemInstance.spareFor.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
199                                                <li><g:link controller="assetDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
200                                            </g:each>
201                                            </ul>
202                                        </td>
203                                    </tr>
204
205                                </tbody>
206                            </table>
207                        </div>
208                        <div class="buttons">
209                            <g:form>
210                                <g:hiddenField name="id" value="${inventoryItemInstance.id}" />
211                                <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
212                                <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
213                            </g:form>
214                        </div>
215
216                        <br />
217
218                    </richui:tabContent>
219<!-- End Inventory tab -->
220
221<!-- Start Detail tab -->
222                    <richui:tabContent>
223
224                        <div class="dialog">
225                            <table>
226                                <tbody>
227
228                                    <tr class="prop">
229                                        <td valign="top" class="name">Id:</td>
230                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'id')}</td>
231                                    </tr>
232
233                                    <tr class="prop">
234                                        <td valign="top" class="name">Obsolete:</td>
235                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isObsolete')}</td>
236                                    </tr>
237
238                                    <tr class="prop">
239                                        <td valign="top" class="name">Inventory Group:</td>
240                                        <td valign="top" class="value">${inventoryItemInstance.inventoryGroup?.encodeAsHTML()}</td>
241                                    </tr>
242
243                                    <tr class="prop">
244                                        <td valign="top" class="name">Inventory Type:</td>
245                                        <td valign="top" class="value">${inventoryItemInstance.inventoryType?.encodeAsHTML()}</td>
246                                    </tr>
247
248                                    <tr class="prop">
249                                        <td valign="top" class="name">Reorder Point:</td>
250                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderPoint')}</td>
251                                    </tr>
252
253                                    <tr class="prop">
254                                        <td valign="top" class="name">Enable Reorder Listing:</td>
255                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorderListing')}</td>
256                                    </tr>
257
258                                    <tr class="prop">
259                                        <td valign="top" class="name">Reorder Quantity:</td>
260                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderQuantity')}</td>
261                                    </tr>
262
263                                    <tr class="prop">
264                                        <td valign="top" class="name">Estimated Unit Price:</td>
265
266                                        <td valign="top" class="value">
267                                            <g:if test="${inventoryItemInstance.estimatedUnitPriceAmount}">
268                                                ${inventoryItemInstance.estimatedUnitPriceAmount.encodeAsHTML()}
269                                                ${inventoryItemInstance.estimatedUnitPriceCurrency.encodeAsHTML()}
270                                            </g:if>
271                                        </td>
272                                    </tr>
273
274                                    <tr class="prop">
275                                        <td valign="top" class="name">Suppliers Part Number:</td>
276                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'suppliersPartNumber')}</td>
277                                    </tr>
278
279                                    <tr class="prop">
280                                        <td valign="top" class="name">Preferred Supplier:</td>
281
282                                        <td  valign="top" style="text-align:left;" class="value">
283                                            <g:link controller="supplierDetailed" action="show" id="${inventoryItemInstance.preferredSupplier?.id}">
284                                                ${inventoryItemInstance.preferredSupplier?.encodeAsHTML()}
285                                            </g:link>
286                                        </td>
287                                    </tr>
288
289                                    <tr class="prop">
290                                        <td valign="top" class="name">Alternate Suppliers:</td>
291
292                                        <td  valign="top" style="text-align:left;" class="value">
293                                            <ul>
294                                            <g:each var="s" in="${ inventoryItemInstance.alternateSuppliers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
295                                                <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
296                                            </g:each>
297                                            </ul>
298                                        </td>
299                                    </tr>
300
301                                    <tr class="prop">
302                                        <td valign="top" class="name">Manufacturers Part Number:</td>
303                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'manufacturersPartNumber')}</td>
304                                    </tr>
305
306                                    <tr class="prop">
307                                        <td valign="top" class="name">Preferred Manufacturer:</td>
308
309                                        <td  valign="top" style="text-align:left;" class="value">
310                                            <g:link controller="manufacturerDetailed" action="show" id="${inventoryItemInstance.preferredManufacturer?.id}">
311                                                ${inventoryItemInstance.preferredManufacturer?.encodeAsHTML()}
312                                            </g:link>
313                                        </td>
314                                    </tr>
315
316                                    <tr class="prop">
317                                        <td valign="top" class="name">Alternate Manufacturers:</td>
318
319                                        <td  valign="top" style="text-align:left;" class="value">
320                                            <ul>
321                                            <g:each var="m" in="${ inventoryItemInstance.alternateManufacturers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
322                                                <li><g:link controller="manufacturerDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
323                                            </g:each>
324                                            </ul>
325                                        </td>
326                                    </tr>
327
328
329                                </tbody>
330                            </table>
331                        </div>
332                        <div class="buttons">
333                            <g:form>
334                                <g:hiddenField name="id" value="${inventoryItemInstance.id}" />
335                                <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
336                                <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
337                            </g:form>
338                        </div>
339                    </richui:tabContent>
340<!-- End Detail tab -->
341
342<!-- Start Movement tab -->
343                    <richui:tabContent>
344
345                        <g:if test="${inventoryMovementList.isEmpty()}">
346                            <br />
347                            No Inventory Movements.
348                            <br />
349                            <br />
350
351                            <div class="buttons">
352                                <g:form controller="inventoryMovementDetailed">
353                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
354                                    <span class="button"><g:actionSubmit action="create" class="add" value="Create" /></span>
355                                </g:form>
356                            </div>
357
358                        </g:if>
359                        <g:else>
360
361                            <div class="list">
362                                <table>
363                                    <thead>
364                                        <tr>
365                                            <th>Quantity</th>
366                                            <th>Movement Type</th>
367                                            <th>Date</th>
368                                            <th>Person</th>
369                                            <th></th>
370                                        </tr>
371                                    </thead>
372                                    <tbody>
373                                        <g:each in="${inventoryMovementList}" status="i" var="movements">
374                                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
375
376                                                <td onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${movements.id}"'>
377                                                    ${fieldValue(bean:movements, field:'quantity')}
378                                                </td>
379                                                <td onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${movements.id}"'>
380                                                    ${fieldValue(bean:movements, field:'inventoryMovementType')}
381                                                </td>
382                                                <td onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${movements.id}"'>
383                                                    <g:formatDate date="${movements.date}" format="EEE, dd-MMM-yyyy"/>
384                                                </td>
385                                                <td onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${movements.id}"'>
386                                                    ${fieldValue(bean:movements, field:'person')}
387                                                </td>
388
389                                                <td class="notClickable">
390                                                    <g:link controller="inventoryMovementDetailed" action="show" id="${movements.id}">
391                                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
392                                                    </g:link>
393                                                </td>
394
395                                            </tr>
396                                        </g:each>
397                                    </tbody>
398                                </table>
399                            </div>
400
401                            <div class="buttons">
402                                <g:form controller="inventoryMovementDetailed">
403                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
404                                    <g:if test="${inventoryMovementListTotal > inventoryMovementListMax}">
405                                        Showing ${inventoryMovementListMax} of ${inventoryMovementListTotal}
406                                        <br />
407                                    </g:if>
408                                    <g:else>
409                                        Total ${inventoryMovementListTotal}
410                                        <br />
411                                    </g:else>
412                                    <span class="button"><g:actionSubmit action="listInventoryMovements" class="table" value="List" /></span>
413                                    <span class="button"><g:actionSubmit action="create" class="add" value="Create" /></span>
414                                </g:form>
415                            </div>
416
417                        </g:else>
418
419                    </richui:tabContent>
420<!-- End Movement tab -->
421
422<!-- Start Purchases tab -->
423                    <richui:tabContent>
424
425                        <g:if test="${inventoryItemPurchases.isEmpty()}">
426                            <br />
427                            No Inventory Purchases.
428                            <br />
429                            <br />
430
431                            <div class="buttons">
432                                <!--Fake button to prevent ordering disabled inventory items-->
433                                <g:if test="${inventoryItemInstance.isObsolete || !inventoryItemInstance.isActive}" >
434                                    <g:form controller="inventoryItemDetailed">
435                                        <g:hiddenField name="id" value="${inventoryItemInstance.id}" />
436                                        <span class="button">
437                                            <g:actionSubmit action="show" class="add" value="${g.message(code:'inventory.item.reorder.not.allowed')}" />
438                                        </span>
439                                        <span class="button">
440                                            <input type="button" class="search" value="Search"
441                                                        onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/search"' />
442                                        </span>
443                                    </g:form>
444                                </g:if>
445                                <g:else><!--Real order button.-->
446                                    <g:form controller="inventoryItemPurchaseDetailed">
447                                        <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
448                                        <span class="button">
449                                            <g:actionSubmit action="create" class="add" value="Order" />
450                                        </span>
451                                        <span class="button">
452                                            <g:actionSubmit action="search" class="search" value="Search" />
453                                        </span>
454                                    </g:form>
455                                </g:else>
456                            </div>
457
458                        </g:if>
459                        <g:else>
460
461                            <div class="list">
462                                <table>
463                                    <thead>
464                                        <tr>
465                                            <g:sortableColumn action="show" property="purchaseOrderNumber"
466                                                                                title="Order #" params="[paginate: 'purchases']"  />
467                                            <g:sortableColumn action="show"  property="date"
468                                                                                title="Date" params="[paginate: 'purchases']" />
469                                            <g:sortableColumn action="show"  property="costCode"
470                                                                                title="Cost Code" params="[paginate: 'purchases']" />
471                                            <g:sortableColumn action="show"  property="quantity"
472                                                                                title="Quantity" params="[paginate: 'purchases']" />
473                                            <g:sortableColumn action="show"  property="orderValueAmount"
474                                                                                title="Order \$" params="[paginate: 'purchases']" />
475                                            <g:sortableColumn action="show"  property="invoiceNumber"
476                                                                                title="Invoice Number" params="[paginate: 'purchases']" />
477                                            <g:sortableColumn action="show"  property="inventoryItemPurchaseType"
478                                                                                title="Type" params="[paginate: 'purchases']" />
479                                            <th>
480                                                <img  src="${resource(dir:'images/skin',file:'database_go_grey.png')}" alt="Show" title="Show" />
481                                            </th>
482                                            <th>
483                                                <img  src="${resource(dir:'images/skin',file:'basket_put_grey.png')}" alt="Receive" title="Receive" />
484                                            </th>
485                                            <th>
486                                                <img  src="${resource(dir:'images/skin',file:'tick_grey.png')}" alt="Approve" title="Approve Payment" />
487                                            </th>
488                                        </tr>
489                                    </thead>
490                                    <tbody>
491                                        <g:each in="${inventoryItemPurchases}" status="i" var="purchase">
492                                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
493
494                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
495                                                    ${fieldValue(bean:purchase, field:'purchaseOrderNumber')}
496                                                </td>
497                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
498                                                    <g:formatDate date="${purchase.date}" format="EEE, dd-MMM-yyyy"/>
499                                                </td>
500                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
501                                                    ${fieldValue(bean:purchase, field:'costCode')}
502                                                </td>
503                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
504                                                    ${fieldValue(bean:purchase, field:'quantity')}
505                                                </td>
506                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
507                                                    ${fieldValue(bean:purchase, field:'orderValueAmount')}
508                                                    ${fieldValue(bean:purchase, field:'orderValueCurrency')}
509                                                </td>
510                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
511                                                    ${fieldValue(bean:purchase, field:'invoiceNumber')}
512                                                </td>
513                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
514                                                    ${fieldValue(bean:purchase, field:'inventoryItemPurchaseType')}
515                                                </td>
516                                                <td class="notClickable">
517                                                    <g:link controller="inventoryItemPurchaseDetailed" action="show" id="${purchase.id}">
518                                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" />
519                                                    </g:link>
520                                                </td>
521
522                                                <g:if test="${purchase.inventoryItemPurchaseType.id == 1}">
523                                                    <g:if test="${!purchase.receivedComplete}">
524                                                        <td class="notClickable">
525                                                            <g:link controller="inventoryItemPurchaseDetailed" action="receive" params="[id: purchase.id, returnTo: 'inventoryItem']">
526                                                                <img  src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" />
527                                                            </g:link>
528                                                        </td>
529                                                        <td class="notClickable">
530                                                        </td>
531                                                    </g:if>
532                                                    <g:else>
533                                                        <td class="notClickable">
534                                                        </td>
535                                                        <td class="notClickable">
536                                                        </td>
537                                                    </g:else>
538                                                </g:if>
539                                                <g:elseif test="${(purchase.inventoryItemPurchaseType.id == 2)||(purchase.inventoryItemPurchaseType.id == 3)}">
540                                                    <g:if test="${!purchase.invoicePaymentApproved}">
541                                                        <td class="notClickable">
542                                                        </td>
543                                                        <td class="notClickable">
544                                                            <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" params="[id: purchase.id, returnTo: 'inventoryItem']">
545                                                                <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" />
546                                                            </g:link>
547                                                        </td>
548                                                    </g:if>
549                                                    <g:else>
550                                                        <td class="notClickable">
551                                                        </td>
552                                                        <td class="notClickable">
553                                                        </td>
554                                                    </g:else>
555                                                </g:elseif>
556                                                <g:else>
557                                                    <td class="notClickable">
558                                                    </td>
559                                                    <td class="notClickable">
560                                                    </td>
561                                                </g:else>
562
563                                            </tr>
564                                        </g:each>
565                                    </tbody>
566                                </table>
567                            </div>
568
569                            <div class="buttons">
570                                <!--Fake button to prevent ordering disabled inventory items-->
571                                <g:if test="${inventoryItemInstance.isObsolete || !inventoryItemInstance.isActive}" >
572                                    <g:form controller="inventoryItemDetailed">
573                                        <g:hiddenField name="id" value="${inventoryItemInstance.id}" />
574                                        Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal}
575                                        <span class="button">
576                                            <g:actionSubmit action="show" class="add" value="${g.message(code:'inventory.item.reorder.not.allowed')}" />
577                                        </span>
578                                        <span class="button">
579                                            <input type="button" class="search" value="Search"
580                                                        onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/search"' />
581                                        </span>
582                                    </g:form>
583                                </g:if>
584                                <g:else><!--Real order button.-->
585                                    <g:form controller="inventoryItemPurchaseDetailed">
586                                        <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
587                                        Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal}
588                                        <span class="button">
589                                            <g:actionSubmit action="create" class="add" value="Order" />
590                                        </span>
591                                        <span class="button">
592                                            <g:actionSubmit action="search" class="search" value="Search" />
593                                        </span>
594                                    </g:form>
595                                </g:else>
596                            </div>
597
598                            <div class="paginateButtons">
599                                <g:paginate action="show"
600                                                        id="${inventoryItemInstance?.id}"
601                                                        total="${inventoryItemPurchasesTotal}"
602                                                        params="[paginate: 'purchases']" />
603                            </div>
604
605                        </g:else>
606
607                    </richui:tabContent>
608<!-- End Movement tab -->
609
610                </richui:tabContents>
611            </richui:tabView>
612
613        </div>
614    </body>
615</html>
Note: See TracBrowser for help on using the repository browser.