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

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

Add indication to inventory item tabs.

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