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

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

Change InventoryItem to have a preferred and many alternate suppliers and manufacturers.
Controllers and views updated.

File size: 18.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>Edit InventoryItem</title>
8        <nav:resources override="true"/>
9        <g:render template="/shared/pictureHead" />
10    </head>
11    <body>
12        <div class="nav">
13            <nav:renderSubItems group="nav"/>
14        </div>
15        <div class="body">
16            <g:render template="/shared/messages" />
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>
28
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>
43
44                            <tr class="prop">
45                                <td valign="top" class="name">
46                                    <label for="name">Name:</label>
47                                </td>
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')}"/>
52                                </td>
53                            </tr>
54
55                            <tr class="prop">
56                                <td valign="top" class="name">
57                                    <label for="description">Description:</label>
58                                </td>
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>
61                                </td>
62                            </tr>
63
64                            <tr class="prop">
65                                <td valign="top" class="name">
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">
75                                    <label for="unitsInStock">In Stock:</label>
76                                </td>
77                                <td valign="top" class="value">
78                                    ${inventoryItemInstance.unitsInStock} ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()}
79                                </td>
80                            </tr>
81
82                            <tr class="prop">
83                                <td valign="top" class="name">
84                                    <label for="inventoryLocation">Location:</label>
85                                </td>
86                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
87                                    <g:select optionKey="id"
88                                                        from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
89                                                        name="inventoryLocation.id"
90                                                        value="${inventoryItemInstance?.inventoryLocation?.id}"
91                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}">
92                                    </g:select>
93                                </td>
94                            </tr>
95
96                            <tr class="prop">
97                                <td valign="top" class="name">
98                                    <label for="isActive">Active:</label>
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>
103                            </tr>
104
105                            <tr class="prop">
106                                <td valign="top" class="name">
107                                    <label for="reorderPoint">Reorder Point:</label>
108                                </td>
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()}
114                                </td>
115                            </tr>
116
117                            <tr class="prop">
118                                <td valign="top" class="name">
119                                    <label for="recommendedReorderPoint">Recommended Reorder Point:</label>
120                                </td>
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()}
126                                </td>
127                            </tr>
128
129                            <tr class="prop">
130                                <td valign="top" class="name">
131                                    <label for="enableReorder">Enable Reorder:</label>
132                                </td>
133                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorder','errors')}">
134                                    <g:checkBox name="enableReorder" value="${inventoryItemInstance?.enableReorder}" ></g:checkBox>
135                                </td>
136                            </tr>
137
138                            <tr class="prop">
139                                <td valign="top" class="name">
140                                    <label for="isObsolete">Obsolete:</label>
141                                </td>
142                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
143                                    <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
144                                </td>
145                            </tr>
146
147                            <tr class="prop">
148                                <td valign="top" class="name">
149                                    <label for="averageDeliveryTime">Average Delivery Time:</label>
150                                </td>
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')}" />
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>
159                                </td>
160                            </tr>
161                       
162                            <tr class="prop">
163                                <td valign="top" class="name">
164                                    <label for="averageDeliveryTime">Estimated Unit Price:</label>
165                                </td>
166                                <td valign="top">
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"
171                                                                        value="${inventoryItemInstance.estimatedUnitPriceCurrency}" />
172                                </td>
173                            </tr>
174
175                            <tr class="prop">
176                                <td valign="top" class="name">
177                                    <label for="suppliersPartNumber">Suppliers Part Number:</label>
178                                </td>
179                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
180                                    <input type="text" id="suppliersPartNumber" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
181                                </td>
182                            </tr>
183
184                            <tr class="prop">
185                                <td valign="top" class="name">
186                                    <label for="preferredSupplier">Preferred Supplier:</label>
187                                </td>
188                                <td valign="top">
189                                    <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
190
191                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
192                                </td>
193                            </tr>
194
195                            <tr class="prop">
196                                <td valign="top" class="name">
197                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
198                                </td>
199                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
200                                    <g:select id="alternateSuppliers" name="alternateSuppliers"
201                                                        from="${suppliers}"
202                                                        size="5" multiple="yes" optionKey="id"
203                                                        value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
204                                </td>
205                            </tr>
206
207                            <tr class="prop">
208                                <td valign="top" class="name">
209                                    <label for="manufacturersPartNumber">Manufacturers Part Number:</label>
210                                </td>
211                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'manufacturersPartNumber','errors')}">
212                                    <input type="text" id="manufacturersPartNumber" name="manufacturersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'manufacturersPartNumber')}"/>
213                                </td>
214                            </tr>
215
216                            <tr class="prop">
217                                <td valign="top" class="name">
218                                    <label for="preferredManufacturer">Preferred Manufacturer:</label>
219                                </td>
220                                <td valign="top">
221                                    <g:select optionKey="id" from="${manufacturers}" name="preferredManufacturer.id" value="${inventoryItemInstance.preferredManufacturer?.id}" noSelection="['null':'--None--']"></g:select>
222
223                                    <p><g:link controller="manufacturerDetailed" action="create">+Add Manufacturer</g:link></p>
224                                </td>
225                            </tr>
226
227                            <tr class="prop">
228                                <td valign="top" class="name">
229                                    <label for="manufacturers">Alternate Manufacturers:</label>
230                                </td>
231                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateManufacturers','errors')}">
232                                    <g:select id="alternateManufacturers" name="alternateManufacturers"
233                                                        from="${manufacturers}"
234                                                        size="5" multiple="yes" optionKey="id"
235                                                        value="${inventoryItemInstance.alternateManufacturers?.id}" noSelection="['':'--None--']" />
236                                </td>
237                            </tr>
238
239                            <tr class="prop">
240                                <td valign="top" class="name">
241                                    <label for="spareFor">Spare For:</label>
242                                </td>
243                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}">
244                                    <g:select name="spareFor"
245                                                        from="${ Asset.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
246                                                        size="5" multiple="yes" optionKey="id"
247                                                        value="${inventoryItemInstance?.spareFor.id}" noSelection="['':'--None--']"/>
248
249                                </td>
250                            </tr>
251
252                            <tr class="prop">
253                                <td valign="top" class="name">
254                                    <label for="alternateItems">Alternate Items:</label>
255                                </td>
256                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateItems','errors')}">
257                                    <g:select name="alternateItems"
258                                                        from="${possibleAlternateItems}"
259                                                        size="5" multiple="yes" optionKey="id"
260                                                        value="${inventoryItemInstance?.alternateItems.id}" noSelection="['':'--None--']"/>
261
262                                </td>
263                            </tr>
264
265                            <tr class="prop">
266                                <td valign="top" class="name">
267                                    <label for="inventoryGroup">Inventory Group:</label>
268                                </td>
269                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
270                                    <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></g:select>
271                                </td>
272                            </tr>
273
274                            <tr class="prop">
275                                <td valign="top" class="name">
276                                    <label for="inventoryType">Inventory Type:</label>
277                                </td>
278                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
279                                    <g:select optionKey="id" from="${InventoryType.list()}" name="inventoryType.id" value="${inventoryItemInstance?.inventoryType?.id}" ></g:select>
280                                </td>
281                            </tr>
282
283                        </tbody>
284                    </table>
285                </div>
286                <div class="buttons">
287                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
288                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
289                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
290                </div>
291            </g:form>
292        </div>
293    </body>
294</html>
Note: See TracBrowser for help on using the repository browser.