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

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

Improvements to use inventory item flow and logic and added a clear function.
Rename CSS tree_pane_close to the more re-useable pane_close.

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