source: trunk/grails-app/views/inventoryItemDetailed/edit.gsp @ 610

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

Prevent reordering of obsolete or inactive inventory items.

File size: 18.6 KB
RevLine 
[116]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>Edit InventoryItem</title>
[139]8        <nav:resources override="true"/>
[182]9        <g:render template="/shared/pictureHead" />
[116]10    </head>
11    <body>
12        <div class="nav">
[139]13            <nav:renderSubItems group="nav"/>
[116]14        </div>
15        <div class="body">
[405]16            <g:render template="/shared/messages" />
[116]17            <g:hasErrors bean="${inventoryItemInstance}">
18            <div class="errors">
19                <g:renderErrors bean="${inventoryItemInstance}" as="list" />
20            </div>
21            </g:hasErrors>
22            <g:form method="post" >
23                <input type="hidden" name="id" value="${inventoryItemInstance?.id}" />
24                <input type="hidden" name="version" value="${inventoryItemInstance?.version}" />
25                <div class="dialog">
26                    <table>
27                        <tbody>
[223]28
[182]29                            <tr class="prop">
30                                <td valign="top" class="name">Picture:</td>
31                                <td valign="top" class="value">
32                                    <g:if test="${inventoryItemInstance.picture}" >
33                                        <span class='gallery'>
34                                            <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" />
35                                        </span>
36                                        <br />
37                                        <g:link controller="pictureDetailed" action="edit" id="${inventoryItemInstance.picture.id}" >
38                                            Edit Picture
39                                        </g:link>
40                                    </g:if>
41                                </td>
42                            </tr>
[223]43
[116]44                            <tr class="prop">
45                                <td valign="top" class="name">
46                                    <label for="name">Name:</label>
47                                </td>
[223]48                                <td valign="top">
49                                    <input class="description ${hasErrors(bean:inventoryItemInstance,field:'name','errors')}"
50                                                type="text" maxlength="50" id="name" name="name"
51                                                value="${fieldValue(bean:inventoryItemInstance,field:'name')}"/>
[116]52                                </td>
[223]53                            </tr>
54
[116]55                            <tr class="prop">
56                                <td valign="top" class="name">
57                                    <label for="description">Description:</label>
58                                </td>
[422]59                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'description','errors')}">
60                                    <textarea rows="5" cols="40" name="description">${fieldValue(bean:inventoryItemInstance, field:'description')}</textarea>
[116]61                                </td>
[223]62                            </tr>
63
[116]64                            <tr class="prop">
65                                <td valign="top" class="name">
[422]66                                    <label for="comment">Comment:</label>
67                                </td>
68                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'comment','errors')}">
69                                    <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemInstance, field:'comment')}</textarea>
70                                </td>
71                            </tr>
72
73                            <tr class="prop">
74                                <td valign="top" class="name">
[223]75                                    <label for="unitsInStock">In Stock:</label>
[175]76                                </td>
[182]77                                <td valign="top" class="value">
[223]78                                    ${inventoryItemInstance.unitsInStock} ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()}
[175]79                                </td>
80                            </tr>
[223]81
[175]82                            <tr class="prop">
83                                <td valign="top" class="name">
[223]84                                    <label for="inventoryLocation">Location:</label>
[116]85                                </td>
[223]86                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
[382]87                                    <g:select optionKey="id"
88                                                        from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
89                                                        name="inventoryLocation.id"
[392]90                                                        value="${inventoryItemInstance?.inventoryLocation?.id}"
91                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}">
[382]92                                    </g:select>
[116]93                                </td>
[175]94                            </tr>
[223]95
[175]96                            <tr class="prop">
97                                <td valign="top" class="name">
98                                    <label for="isActive">Active:</label>
[116]99                                </td>
100                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isActive','errors')}">
101                                    <g:checkBox name="isActive" value="${inventoryItemInstance?.isActive}" ></g:checkBox>
102                                </td>
[223]103                            </tr>
104
[116]105                            <tr class="prop">
106                                <td valign="top" class="name">
[223]107                                    <label for="reorderPoint">Reorder Point:</label>
[116]108                                </td>
[223]109                                <td valign="top">
110                                    <input  class="medium ${hasErrors(bean:inventoryItemInstance,field:'reorderPoint','errors')}"
111                                                    type="text" id="reorderPoint" name="reorderPoint"
112                                                    value="${fieldValue(bean:inventoryItemInstance,field:'reorderPoint')}" />
113                                     ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()}
[116]114                                </td>
[223]115                            </tr>
116
[116]117                            <tr class="prop">
118                                <td valign="top" class="name">
[223]119                                    <label for="recommendedReorderPoint">Recommended Reorder Point:</label>
[116]120                                </td>
[223]121                                <td valign="top">
122                                    <input class="medium ${hasErrors(bean:inventoryItemInstance,field:'recommendedReorderPoint','errors')}"
123                                                type="text" id="recommendedReorderPoint" name="recommendedReorderPoint"
124                                                value="${fieldValue(bean:inventoryItemInstance,field:'recommendedReorderPoint')}" />
125                                     ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()}
[116]126                                </td>
[223]127                            </tr>
128
[116]129                            <tr class="prop">
130                                <td valign="top" class="name">
[610]131                                    <label for="enableReorder">Enable Reorder Listing:</label>
[116]132                                </td>
[223]133                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorder','errors')}">
134                                    <g:checkBox name="enableReorder" value="${inventoryItemInstance?.enableReorder}" ></g:checkBox>
[116]135                                </td>
[175]136                            </tr>
[223]137
[116]138                            <tr class="prop">
139                                <td valign="top" class="name">
[223]140                                    <label for="isObsolete">Obsolete:</label>
[116]141                                </td>
[223]142                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
143                                    <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
[116]144                                </td>
[175]145                            </tr>
[223]146
[116]147                            <tr class="prop">
148                                <td valign="top" class="name">
[175]149                                    <label for="averageDeliveryTime">Average Delivery Time:</label>
[116]150                                </td>
[175]151                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'averageDeliveryTime','errors')}">
152                                    <input type="text" id="averageDeliveryTime" name="averageDeliveryTime" value="${fieldValue(bean:inventoryItemInstance,field:'averageDeliveryTime')}" />
[382]153                                    <g:select optionKey="id"
154                                                        from="${Period.list()}"
155                                                        name="averageDeliveryPeriod.id"
156                                                        value="${inventoryItemInstance?.averageDeliveryPeriod?.id}"
157                                                        noSelection="['null':'--None--']">
158                                    </g:select>
[116]159                                </td>
[175]160                            </tr>
[405]161                       
162                            <tr class="prop">
163                                <td valign="top" class="name">
164                                    <label for="averageDeliveryTime">Estimated Unit Price:</label>
165                                </td>
[441]166                                <td valign="top" class="value">
[405]167                                    <input  class="medium ${hasErrors(bean:inventoryItemInstance,field:'estimatedUnitPriceAmount','errors')}"
168                                                    type="text" id="estimatedUnitPriceAmount" name="estimatedUnitPriceAmount"
169                                                    value="${inventoryItemInstance.estimatedUnitPriceAmount}" />
170                                    <g:currencySelect name="estimatedUnitPriceCurrency"
[604]171                                                                        value="${inventoryItemInstance?.estimatedUnitPriceCurrency}"
172                                                                        from="${grailsApplication.config.currencyList}">
173                                    </g:currencySelect>
[405]174                                </td>
175                            </tr>
[223]176
[116]177                            <tr class="prop">
178                                <td valign="top" class="name">
[223]179                                    <label for="suppliersPartNumber">Suppliers Part Number:</label>
[116]180                                </td>
[223]181                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
182                                    <input type="text" id="suppliersPartNumber" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
[116]183                                </td>
[175]184                            </tr>
[223]185
[116]186                            <tr class="prop">
187                                <td valign="top" class="name">
[435]188                                    <label for="preferredSupplier">Preferred Supplier:</label>
[116]189                                </td>
[435]190                                <td valign="top">
191                                    <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
[116]192
[435]193                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
[116]194                                </td>
[223]195                            </tr>
196
[116]197                            <tr class="prop">
198                                <td valign="top" class="name">
[435]199                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
200                                </td>
201                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
202                                    <g:select id="alternateSuppliers" name="alternateSuppliers"
203                                                        from="${suppliers}"
204                                                        size="5" multiple="yes" optionKey="id"
205                                                        value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
206                                </td>
207                            </tr>
208
209                            <tr class="prop">
210                                <td valign="top" class="name">
[223]211                                    <label for="manufacturersPartNumber">Manufacturers Part Number:</label>
[116]212                                </td>
[223]213                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturersPartNumber','errors')}">
214                                    <input type="text" id="manufacturersPartNumber" name="manufacturersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'manufacturersPartNumber')}"/>
215                                </td>
216                            </tr>
[116]217
218                            <tr class="prop">
219                                <td valign="top" class="name">
[435]220                                    <label for="preferredManufacturer">Preferred Manufacturer:</label>
[116]221                                </td>
[435]222                                <td valign="top">
223                                    <g:select optionKey="id" from="${manufacturers}" name="preferredManufacturer.id" value="${inventoryItemInstance.preferredManufacturer?.id}" noSelection="['null':'--None--']"></g:select>
[382]224
[410]225                                    <p><g:link controller="manufacturerDetailed" action="create">+Add Manufacturer</g:link></p>
[223]226                                </td>
227                            </tr>
[116]228
229                            <tr class="prop">
230                                <td valign="top" class="name">
[435]231                                    <label for="manufacturers">Alternate Manufacturers:</label>
232                                </td>
233                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateManufacturers','errors')}">
234                                    <g:select id="alternateManufacturers" name="alternateManufacturers"
235                                                        from="${manufacturers}"
236                                                        size="5" multiple="yes" optionKey="id"
237                                                        value="${inventoryItemInstance.alternateManufacturers?.id}" noSelection="['':'--None--']" />
238                                </td>
239                            </tr>
240
241                            <tr class="prop">
242                                <td valign="top" class="name">
[116]243                                    <label for="spareFor">Spare For:</label>
244                                </td>
245                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}">
246                                    <g:select name="spareFor"
[382]247                                                        from="${ Asset.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
[223]248                                                        size="5" multiple="yes" optionKey="id"
[382]249                                                        value="${inventoryItemInstance?.spareFor.id}" noSelection="['':'--None--']"/>
[116]250
251                                </td>
[175]252                            </tr>
[223]253
[116]254                            <tr class="prop">
255                                <td valign="top" class="name">
[223]256                                    <label for="alternateItems">Alternate Items:</label>
[116]257                                </td>
[223]258                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateItems','errors')}">
259                                    <g:select name="alternateItems"
[425]260                                                        from="${possibleAlternateItems}"
[223]261                                                        size="5" multiple="yes" optionKey="id"
[382]262                                                        value="${inventoryItemInstance?.alternateItems.id}" noSelection="['':'--None--']"/>
[223]263
[116]264                                </td>
[175]265                            </tr>
[223]266
[116]267                            <tr class="prop">
268                                <td valign="top" class="name">
[223]269                                    <label for="inventoryGroup">Inventory Group:</label>
[116]270                                </td>
[223]271                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
272                                    <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></g:select>
273                                </td>
274                            </tr>
[116]275
[223]276                            <tr class="prop">
277                                <td valign="top" class="name">
278                                    <label for="inventoryType">Inventory Type:</label>
[116]279                                </td>
[223]280                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
281                                    <g:select optionKey="id" from="${InventoryType.list()}" name="inventoryType.id" value="${inventoryItemInstance?.inventoryType?.id}" ></g:select>
282                                </td>
[175]283                            </tr>
[223]284
[116]285                        </tbody>
286                    </table>
287                </div>
288                <div class="buttons">
289                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
[223]290                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
[116]291                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
292                </div>
293            </g:form>
294        </div>
295    </body>
296</html>
Note: See TracBrowser for help on using the repository browser.