source: trunk/grails-app/views/inventoryItemDetailed/create.gsp @ 727

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

Improvements to InventoryItem views.

File size: 17.2 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>Create InventoryItem</title>   
8        <nav:resources override="true"/>     
9    </head>
10    <body>
11        <div class="nav">
12            <nav:renderSubItems group="nav"/>
13        </div>
14        <div class="body">
15            <g:render template="/shared/messages" />
16            <g:hasErrors bean="${inventoryItemInstance}">
17            <div class="errors">
18                <g:renderErrors bean="${inventoryItemInstance}" as="list" />
19            </div>
20            </g:hasErrors>
21            <g:form action="save" method="post" >
22                <div class="dialog">
23                    <table>
24                        <tbody>
25                       
26                            <tr class="prop">
27                                <td valign="top" class="groupHeader">
28                                    <label for="name">Inventory Item</label>
29                                </td>
30                                <td valign="top" class="value">
31                                </td>
32                            </tr>
33                           
34                            <tr class="prop">
35                                <td valign="top" class="groupName">
36                                    <label for="name">Name:</label>
37                                </td>
38                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'name','errors')}">
39                                    <input type="text" class="description" maxlength="50" id="name" name="name" value="${fieldValue(bean:inventoryItemInstance,field:'name')}"/>
40                                    <g:helpBalloon class="helpballoon" code="inventory.item.name" />
41                                </td>
42                            </tr>
43                           
44                            <tr class="prop">
45                                <td valign="top" class="groupName">
46                                    <label for="description">Description:</label>
47                                </td>
48                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'description','errors')}">
49                                    <textarea rows="5" cols="40" name="description">${fieldValue(bean:inventoryItemInstance, field:'description')}</textarea>
50                                    <g:helpBalloon class="helpballoon" code="inventory.item.description" />
51                                </td>
52                            </tr>
53                       
54                            <tr class="prop">
55                                <td valign="top" class="groupName">
56                                    <label for="comment">Comment:</label>
57                                </td>
58                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'comment','errors')}">
59                                    <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemInstance, field:'comment')}</textarea>
60                                    <g:helpBalloon class="helpballoon" code="inventory.item.comment" />
61                                </td>
62                            </tr>
63                       
64                            <tr class="prop">
65                                <td valign="top" class="groupName">
66                                    <label for="unitOfMeasure">Unit Of Measure:</label>
67                                </td>
68                                <td valign="top">
69                                    <g:select optionKey="id"
70                                                        from="${UnitOfMeasure.findAllByIsActive(true)}"
71                                                        name="unitOfMeasure.id"
72                                                        value="${inventoryItemInstance?.unitOfMeasure?.id}" >
73                                    </g:select>
74                                    <g:helpBalloon class="helpballoon" code="inventory.item.unit.of.measure" />
75                                </td>
76                            </tr>
77                       
78                            <tr class="prop">
79                                <td valign="top" class="groupName">
80                                    <label for="inventoryLocation">Inventory Location:</label>
81                                </td>
82                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
83                                    <g:select optionKey="id"
84                                                        from="${ InventoryLocation.findAllByIsActive(true).sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
85                                                        name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}"
86                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}"
87                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
88                                    </g:select>
89                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.location" />
90
91                                <p><g:link controller="inventoryLocationDetailed" action="create">+Add Location</g:link></p>
92                                </td>
93                            </tr>
94                       
95                            <tr class="prop">
96                                <td valign="top" class="groupName">
97                                    <label for="inventoryGroup">Inventory Group:</label>
98                                </td>
99                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
100                                    <g:select optionKey="id"
101                                                        from="${InventoryGroup.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
102                                                        name="inventoryGroup.id"
103                                                        value="${inventoryItemInstance?.inventoryGroup?.id}"
104                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
105                                    </g:select>
106                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.group" />
107                                <p><g:link controller="inventoryGroupDetailed" action="create">+Add Group</g:link></p>
108                                </td>
109                            </tr>
110                       
111                            <tr class="prop">
112                                <td valign="top" class="groupName">
113                                    <label for="inventoryType">Inventory Type:</label>
114                                </td>
115                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
116                                    <g:select optionKey="id"
117                                                        from="${InventoryType.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
118                                                        name="inventoryType.id"
119                                                        value="${inventoryItemInstance?.inventoryType?.id}"
120                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
121                                    </g:select>
122                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
123                                </td>
124                            </tr>
125                           
126                            <tr class="prop">
127                                <td valign="top" class="groupHeader">
128                                    <label for="name">Reorder Details</label>
129                                </td>
130                                <td valign="top" class="value">
131                                </td>
132                            </tr>
133                       
134                            <tr class="prop">
135                                <td valign="top" class="groupName">
136                                    <label for="enableReorderListing">Enable Reorder Listing:</label>
137                                </td>
138                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
139                                    <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
140                                    <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
141                                </td>
142                            </tr>
143                       
144                            <tr class="prop">
145                                <td valign="top" class="groupName">
146                                    <label for="reorderPoint">Reorder Point:</label>
147                                </td>
148                                <td valign="top">
149                                    <input class="medium ${hasErrors(bean:inventoryItemInstance,field:'reorderPoint','errors')}"
150                                                    type="text" id="reorderPoint" name="reorderPoint"
151                                                    value="${fieldValue(bean:inventoryItemInstance,field:'reorderPoint')}" />
152                                    <g:helpBalloon class="helpballoon" code="inventory.item.reorder.point" />
153                                </td>
154                            </tr>
155                           
156                            <tr class="prop">
157                                <td valign="top" class="groupName">
158                                    <label for="reorderQuantity">Reorder Quantity:</label>
159                                </td>
160                                <td valign="top">
161                                    <input class="medium ${hasErrors(bean:inventoryItemInstance,field:'reorderQuantity','errors')}"
162                                                type="text" id="reorderQuantity" name="reorderQuantity"
163                                                value="${fieldValue(bean:inventoryItemInstance,field:'reorderQuantity')}" />
164                                    <g:helpBalloon class="helpballoon" code="inventory.item.reorder.quantity" />
165                                </td>
166                            </tr>
167                       
168                            <tr class="prop">
169                                <td valign="top" class="groupName">
170                                    <label for="estimatedUnitPriceAmount">Estimated Unit Price:</label>
171                                </td>
172                                <td valign="top">
173                                    <input  class="medium ${hasErrors(bean:inventoryItemInstance,field:'estimatedUnitPriceAmount','errors')}"
174                                                    type="text" id="estimatedUnitPriceAmount" name="estimatedUnitPriceAmount"
175                                                    value="${fieldValue(bean:inventoryItemInstance,field:'estimatedUnitPriceAmount')}" />
176                                    <g:currencySelect name="estimatedUnitPriceCurrency"
177                                                                        value="${inventoryItemInstance?.estimatedUnitPriceCurrency}"
178                                                                        from="${grailsApplication.config.currencyList}">
179                                    </g:currencySelect>
180                                    <g:helpBalloon class="helpballoon" code="inventory.item.estimated.unit.price.amount" />
181                                </td>
182                            </tr>
183                       
184                            <tr class="prop">
185                                <td valign="top" class="groupName">
186                                    <label for="suppliersPartNumber">Suppliers Part Number:</label>
187                                </td>
188                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
189                                    <input type="text" id="suppliersPartNumber" maxlength="50" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
190                                    <g:helpBalloon class="helpballoon" code="inventory.item.suppliers.part.number" />
191                                </td>
192                            </tr>
193                       
194                            <tr class="prop">
195                                <td valign="top" class="groupName">
196                                    <label for="preferredSupplier">Preferred Supplier:</label>
197                                </td>
198                                <td valign="top">
199                                    <g:select optionKey="id"
200                                                        from="${suppliers}"
201                                                        name="preferredSupplier.id"
202                                                        value="${inventoryItemInstance.preferredSupplier?.id}"
203                                                        noSelection="['null':'--None--']">
204                                    </g:select>
205                                    <g:helpBalloon class="helpballoon" code="inventory.item.preferred.supplier" />
206                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
207                                </td>
208                            </tr>
209
210                            <tr class="prop">
211                                <td valign="top" class="groupName">
212                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
213                                </td>
214                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
215                                    <g:helpBalloon class="helpballoon" code="inventory.item.alternate.suppliers" />
216                                    <custom:checkBoxList name="alternateSuppliers"
217                                                                    from="${suppliers}"
218                                                                    value="${inventoryItemInstance?.alternateSuppliers?.collect{it.id}}"
219                                                                    optionKey="id"
220                                                                    linkController="supplierDetailed"
221                                                                    linkAction="show"/>
222                                    <g:link controller="supplierDetailed" action="create">+Add Supplier</g:link>
223                                </td>
224                            </tr>
225                           
226                            <tr class="prop">
227                                <td valign="top" class="groupHeader">
228                                    <label for="name">Spare For</label>
229                                </td>
230                                <td valign="top" class="value">
231                                </td>
232                            </tr>
233                           
234                            <tr class="prop">
235                                <td valign="top" class="groupName">
236                                    <label for="spareFor">Assets:</label>
237                                </td>
238                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}">
239                                    <g:helpBalloon class="helpballoon" code="inventory.item.spare.for" />
240                                    <custom:checkBoxList name="spareFor"
241                                                                    from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
242                                                                    value="${inventoryItemInstance?.spareFor?.collect{it.id}}"
243                                                                    optionKey="id"
244                                                                    sortBy="name"
245                                                                    linkController="assetDetailed"
246                                                                    linkAction="show"/>
247                                    <g:link controller="assetDetailed" action="create">+Add Asset</g:link>
248                                </td>
249                            </tr>
250                       
251                        </tbody>
252                    </table>
253                </div>
254                <div class="buttons">
255                    <span class="button"><input class="save" type="submit" value="Create" /></span>
256                </div>
257            </g:form>
258        </div>
259    </body>
260</html>
Note: See TracBrowser for help on using the repository browser.