Changeset 727 for trunk


Ignore:
Timestamp:
Nov 28, 2010, 12:32:07 PM (13 years ago)
Author:
gav
Message:

Improvements to InventoryItem views.

Location:
trunk/grails-app
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r720 r727  
    456456
    457457        def suppliers = Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }
    458         render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance.attach(),
     458        render(view:'edit', model:[inventoryItemInstance: result.inventoryItemInstance,
    459459                                                suppliers: suppliers])
    460460    }
  • trunk/grails-app/i18n/messages.properties

    r722 r727  
    231231inventory.item.description.help=The inventory item description as it would appear on a reorder.
    232232inventory.item.comment=Comment
    233 inventory.item.comment.help=Additional on site comments.
     233inventory.item.comment.help=Additional on site comments. Which may include additional ordering information, \
     234    search key words and other useful information.
    234235inventory.item.estimated.unit.price.amount=Unit Price
    235236inventory.item.estimated.unit.price.amount.help=Estimated reorder price of a single unit.
     
    248249    Often determined by a price break or minimum order quantity.
    249250inventory.item.is.active=Active
    250 inventory.item.is.active.help=Disable to remove from searches.
     251inventory.item.is.active.help=Disable to remove from search results.
    251252inventory.item.is.obsolete=Obsolete
    252253inventory.item.is.obsolete.help=Enabled indicates that item considered obsolete by the supplier.
     
    256257inventory.item.inventory.location.help=The location or bin where this item can be found.
    257258inventory.item.inventory.group=Group
    258 inventory.item.inventory.group.help=An easy way to group or place items in various piles for planning.
     259inventory.item.inventory.group.help=An easy way to group or place items in various piles to assit with management.
    259260inventory.item.inventory.type=Type
    260261inventory.item.inventory.type.help=The type of inventory that this item falls into.
     
    265266inventory.item.alternate.suppliers.help=List of alternate suppliers that this item may be purchased from. \
    266267    For example when the preferred supplier has no stock.
     268inventory.item.spare.for=Spare For
     269inventory.item.spare.for.help=List of assets that this item is held as a spare for.
    267270
    268271# InventoryItem Messages.
  • trunk/grails-app/services/InventoryItemService.groovy

    r720 r727  
    7070        result.showTab = [:]
    7171        switch (params.showTab) {
    72             case "showDetailTab":
    73                 result.showTab.detail =  new String("true")
    74                 break
    7572            case "showMovementTab":
    7673                result.showTab.movement =  new String("true")
     
    167164
    168165            result.inventoryItemInstance.properties = params
     166            result.inventoryItemInstance.setAlternateSuppliersFromCheckBoxList(params.alternateSuppliers)
     167            result.inventoryItemInstance.setSpareForFromCheckBoxList(params.spareFor)
     168
     169            // Fetch to prevent lazy initialization error.
     170            result.inventoryItemInstance.unitOfMeasure
    169171
    170172            if(result.inventoryItemInstance.hasErrors() || !result.inventoryItemInstance.save())
     
    204206
    205207            result.inventoryItemInstance = new InventoryItem(params)
     208            result.inventoryItemInstance.setAlternateSuppliersFromCheckBoxList(params.alternateSuppliers)
     209            result.inventoryItemInstance.setSpareForFromCheckBoxList(params.spareFor)
    206210
    207211            if(result.inventoryItemInstance.hasErrors() || !result.inventoryItemInstance.save())
  • trunk/grails-app/views/inventoryItemDetailed/create.gsp

    r719 r727  
    2525                       
    2626                            <tr class="prop">
    27                                 <td valign="top" class="name">
     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">
    2836                                    <label for="name">Name:</label>
    2937                                </td>
     
    3543                           
    3644                            <tr class="prop">
    37                                 <td valign="top" class="name">
     45                                <td valign="top" class="groupName">
    3846                                    <label for="description">Description:</label>
    3947                                </td>
     
    4553                       
    4654                            <tr class="prop">
    47                                 <td valign="top" class="name">
     55                                <td valign="top" class="groupName">
    4856                                    <label for="comment">Comment:</label>
    4957                                </td>
     
    5563                       
    5664                            <tr class="prop">
    57                                 <td valign="top" class="name">
     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">
    5880                                    <label for="inventoryLocation">Inventory Location:</label>
    5981                                </td>
    6082                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
    6183                                    <g:select optionKey="id"
    62                                                         from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
     84                                                        from="${ InventoryLocation.findAllByIsActive(true).sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
    6385                                                        name="inventoryLocation.id" value="${inventoryItemInstance?.inventoryLocation?.id}"
    64                                                         optionValue="${{it.name+ ' in ' + it.inventoryStore}}">
     86                                                        optionValue="${{it.name+ ' in ' + it.inventoryStore}}"
     87                                                        noSelection="['null':/${g.message(code:'default.please.select.text')}/]" >
    6588                                    </g:select>
    6689                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.location" />
     
    7194                       
    7295                            <tr class="prop">
    73                                 <td valign="top" class="name">
     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">
    74146                                    <label for="reorderPoint">Reorder Point:</label>
    75147                                </td>
     
    79151                                                    value="${fieldValue(bean:inventoryItemInstance,field:'reorderPoint')}" />
    80152                                    <g:helpBalloon class="helpballoon" code="inventory.item.reorder.point" />
    81                                     <g:select optionKey="id"
    82                                                         from="${UnitOfMeasure.list()}"
    83                                                         name="unitOfMeasure.id"
    84                                                         value="${inventoryItemInstance?.unitOfMeasure?.id}" >
    85                                     </g:select>
    86                                     <g:helpBalloon class="helpballoon" code="inventory.item.unit.of.measure" />
    87                                 </td>
    88                             </tr>
    89                        
    90                             <tr class="prop">
    91                                 <td valign="top" class="name">
    92                                     <label for="enableReorderListing">Enable Reorder Listing:</label>
    93                                 </td>
    94                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
    95                                     <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
    96                                     <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
    97                                 </td>
    98                             </tr>
    99                        
    100                             <tr class="prop">
    101                                 <td valign="top" class="name">
    102                                     <label for="inventoryGroup">Inventory Group:</label>
    103                                 </td>
    104                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
    105                                     <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></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="name">
    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" from="${InventoryType.list()}" name="inventoryType.id" value="${inventoryItemInstance?.inventoryType?.id}" ></g:select>
    117                                     <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
    118                                 </td>
    119                             </tr>
    120                        
    121                             <tr class="prop">
    122                                 <td valign="top" class="name">
     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">
    123170                                    <label for="estimatedUnitPriceAmount">Estimated Unit Price:</label>
    124171                                </td>
     
    136183                       
    137184                            <tr class="prop">
    138                                 <td valign="top" class="name">
     185                                <td valign="top" class="groupName">
    139186                                    <label for="suppliersPartNumber">Suppliers Part Number:</label>
    140187                                </td>
    141188                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
    142                                     <input type="text" id="suppliersPartNumber" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
     189                                    <input type="text" id="suppliersPartNumber" maxlength="50" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
    143190                                    <g:helpBalloon class="helpballoon" code="inventory.item.suppliers.part.number" />
    144191                                </td>
     
    146193                       
    147194                            <tr class="prop">
    148                                 <td valign="top" class="name">
     195                                <td valign="top" class="groupName">
    149196                                    <label for="preferredSupplier">Preferred Supplier:</label>
    150197                                </td>
    151198                                <td valign="top">
    152                                     <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
     199                                    <g:select optionKey="id"
     200                                                        from="${suppliers}"
     201                                                        name="preferredSupplier.id"
     202                                                        value="${inventoryItemInstance.preferredSupplier?.id}"
     203                                                        noSelection="['null':'--None--']">
     204                                    </g:select>
    153205                                    <g:helpBalloon class="helpballoon" code="inventory.item.preferred.supplier" />
    154206                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
    155207                                </td>
    156208                            </tr>
    157                        
    158                             <tr class="prop">
    159                                 <td valign="top" class="name">
     209
     210                            <tr class="prop">
     211                                <td valign="top" class="groupName">
    160212                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
    161213                                </td>
    162214                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
    163                                     <g:select id="alternateSuppliers" name="alternateSuppliers"
    164                                                         from="${suppliers}"
    165                                                         size="5" multiple="yes" optionKey="id"
    166                                                         value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
    167215                                    <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>
    168248                                </td>
    169249                            </tr>
  • trunk/grails-app/views/inventoryItemDetailed/edit.gsp

    r720 r727  
    2828
    2929                            <tr class="prop">
    30                                 <td valign="top" class="name">Picture:</td>
     30                                <td valign="top" class="groupHeader">
     31                                    <label>Inventory Item</label>
     32                                </td>
     33                                <td valign="top" class="value">
     34                                </td>
     35                            </tr>
     36
     37                            <tr class="prop">
     38                                <td valign="top" class="groupName">
     39                                    <label for="name">Name:</label>
     40                                </td>
     41                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'name','errors')}">
     42                                    <input type="text"
     43                                                class="description"
     44                                                maxlength="50"
     45                                                id="name"
     46                                                name="name"
     47                                                value="${fieldValue(bean:inventoryItemInstance,field:'name')}"/>
     48                                    <g:helpBalloon class="helpballoon" code="inventory.item.name" />
     49                                </td>
     50                            </tr>
     51
     52                            <tr class="prop">
     53                                <td valign="top" class="groupName">Picture:</td>
    3154                                <td valign="top" class="value">
    3255                                    <g:if test="${inventoryItemInstance.picture}" >
    3356                                        <span class='gallery'>
    34                                             <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" />
     57                                            <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Small}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" />
    3558                                        </span>
    3659                                        <br />
     
    4366
    4467                            <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                                     <g:helpBalloon class="helpballoon" code="inventory.item.name" />
    53                                 </td>
    54                             </tr>
    55 
    56                             <tr class="prop">
    57                                 <td valign="top" class="name">
     68                                <td valign="top" class="groupName">
    5869                                    <label for="description">Description:</label>
    5970                                </td>
     
    6576
    6677                            <tr class="prop">
    67                                 <td valign="top" class="name">
     78                                <td valign="top" class="groupName">
    6879                                    <label for="comment">Comment:</label>
    6980                                </td>
     
    7586
    7687                            <tr class="prop">
    77                                 <td valign="top" class="name">
     88                                <td valign="top" class="groupName">
    7889                                    <label for="unitsInStock">In Stock:</label>
    7990                                </td>
     
    8596
    8697                            <tr class="prop">
    87                                 <td valign="top" class="name">
     98                                <td valign="top" class="groupName">
    8899                                    <label for="inventoryLocation">Location:</label>
    89100                                </td>
    90101                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryLocation','errors')}">
    91102                                    <g:select optionKey="id"
    92                                                         from="${ InventoryLocation.list().sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
     103                                                        from="${ InventoryLocation.findAllByIsActive(true).sort { p1, p2 -> p1.toString().compareToIgnoreCase(p2.toString()) } }"
    93104                                                        name="inventoryLocation.id"
    94105                                                        value="${inventoryItemInstance?.inventoryLocation?.id}"
     
    100111
    101112                            <tr class="prop">
    102                                 <td valign="top" class="name">
     113                                <td valign="top" class="groupName">
     114                                    <label for="inventoryGroup">Inventory Group:</label>
     115                                </td>
     116                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
     117                                    <g:select optionKey="id"
     118                                                        from="${InventoryGroup.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
     119                                                        name="inventoryGroup.id"
     120                                                        value="${inventoryItemInstance?.inventoryGroup?.id}" >
     121                                    </g:select>
     122                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.group" />
     123                                </td>
     124                            </tr>
     125
     126                            <tr class="prop">
     127                                <td valign="top" class="groupName">
     128                                    <label for="inventoryType">Inventory Type:</label>
     129                                </td>
     130                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
     131                                    <g:select optionKey="id"
     132                                                        from="${InventoryType.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
     133                                                        name="inventoryType.id"
     134                                                        value="${inventoryItemInstance?.inventoryType?.id}" >
     135                                    </g:select>
     136                                    <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
     137                                </td>
     138                            </tr>
     139
     140                            <tr class="prop">
     141                                <td valign="top" class="groupHeader">
     142                                    <label for="name">Reorder Details</label>
     143                                </td>
     144                                <td valign="top" class="value">
     145                                </td>
     146                            </tr>
     147
     148                            <tr class="prop">
     149                                <td valign="top" class="groupName">
    103150                                    <label for="isActive">Active:</label>
    104151                                </td>
     
    110157
    111158                            <tr class="prop">
    112                                 <td valign="top" class="name">
     159                                <td valign="top" class="groupName">
     160                                    <label for="isObsolete">Obsolete:</label>
     161                                </td>
     162                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
     163                                    <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
     164                                    <g:helpBalloon class="helpballoon" code="inventory.item.is.obsolete" />
     165                                </td>
     166                            </tr>
     167
     168                            <tr class="prop">
     169                                <td valign="top" class="groupName">
     170                                    <label for="enableReorderListing">Enable Reorder Listing:</label>
     171                                </td>
     172                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
     173                                    <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
     174                                    <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
     175                                </td>
     176                            </tr>
     177
     178                            <tr class="prop">
     179                                <td valign="top" class="groupName">
    113180                                    <label for="reorderPoint">Reorder Point:</label>
    114181                                </td>
     
    123190
    124191                            <tr class="prop">
    125                                 <td valign="top" class="name">
     192                                <td valign="top" class="groupName">
    126193                                    <label for="reorderQuantity">Reorder Quantity:</label>
    127194                                </td>
     
    136203
    137204                            <tr class="prop">
    138                                 <td valign="top" class="name">
    139                                     <label for="enableReorderListing">Enable Reorder Listing:</label>
    140                                 </td>
    141                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorderListing','errors')}">
    142                                     <g:checkBox name="enableReorderListing" value="${inventoryItemInstance?.enableReorderListing}" ></g:checkBox>
    143                                     <g:helpBalloon class="helpballoon" code="inventory.item.enable.reorder.listing" />
    144                                 </td>
    145                             </tr>
    146 
    147                             <tr class="prop">
    148                                 <td valign="top" class="name">
    149                                     <label for="isObsolete">Obsolete:</label>
    150                                 </td>
    151                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'isObsolete','errors')}">
    152                                     <g:checkBox name="isObsolete" value="${inventoryItemInstance?.isObsolete}" ></g:checkBox>
    153                                     <g:helpBalloon class="helpballoon" code="inventory.item.is.obsolete" />
    154                                 </td>
    155                             </tr>
    156 
    157                             <tr class="prop">
    158                                 <td valign="top" class="name">
     205                                <td valign="top" class="groupName">
    159206                                    <label for="estimatedUnitPriceAmount">Estimated Unit Price:</label>
    160207                                </td>
     
    172219
    173220                            <tr class="prop">
    174                                 <td valign="top" class="name">
     221                                <td valign="top" class="groupName">
    175222                                    <label for="suppliersPartNumber">Suppliers Part Number:</label>
    176223                                </td>
    177224                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'suppliersPartNumber','errors')}">
    178                                     <input type="text" id="suppliersPartNumber" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
     225                                    <input type="text" id="suppliersPartNumber" maxlength="50" name="suppliersPartNumber" value="${fieldValue(bean:inventoryItemInstance,field:'suppliersPartNumber')}"/>
    179226                                    <g:helpBalloon class="helpballoon" code="inventory.item.suppliers.part.number" />
    180227                                </td>
     
    182229
    183230                            <tr class="prop">
    184                                 <td valign="top" class="name">
     231                                <td valign="top" class="groupName">
    185232                                    <label for="preferredSupplier">Preferred Supplier:</label>
    186233                                </td>
    187234                                <td valign="top">
    188                                     <g:select optionKey="id" from="${suppliers}" name="preferredSupplier.id" value="${inventoryItemInstance.preferredSupplier?.id}" noSelection="['null':'--None--']"></g:select>
     235                                    <g:select optionKey="id"
     236                                                    from="${suppliers}"
     237                                                    name="preferredSupplier.id"
     238                                                    value="${inventoryItemInstance.preferredSupplier?.id}"
     239                                                    noSelection="['null':'--None--']">
     240                                    </g:select>
    189241                                    <g:helpBalloon class="helpballoon" code="inventory.item.preferred.supplier" />
    190242                                    <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p>
     
    193245
    194246                            <tr class="prop">
    195                                 <td valign="top" class="name">
     247                                <td valign="top" class="groupName">
    196248                                    <label for="alternateSuppliers">Alternate Suppliers:</label>
    197249                                </td>
    198250                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'alternateSuppliers','errors')}">
    199                                     <g:select id="alternateSuppliers" name="alternateSuppliers"
    200                                                         from="${suppliers}"
    201                                                         size="5" multiple="yes" optionKey="id"
    202                                                         value="${inventoryItemInstance.alternateSuppliers?.id}" noSelection="['':'--None--']"/>
    203251                                    <g:helpBalloon class="helpballoon" code="inventory.item.alternate.suppliers" />
    204                                 </td>
    205                             </tr>
    206 
    207                             <tr class="prop">
    208                                 <td valign="top" class="name">
    209                                     <label for="spareFor">Spare For:</label>
     252                                    <custom:checkBoxList name="alternateSuppliers"
     253                                                                    from="${suppliers}"
     254                                                                    value="${inventoryItemInstance?.alternateSuppliers?.collect{it.id}}"
     255                                                                    optionKey="id"
     256                                                                    linkController="supplierDetailed"
     257                                                                    linkAction="show"/>
     258                                    <g:link controller="supplierDetailed" action="create">+Add Supplier</g:link>
     259                                </td>
     260                            </tr>
     261
     262                            <tr class="prop">
     263                                <td valign="top" class="groupHeader">
     264                                    <label for="name">Spare For</label>
     265                                </td>
     266                                <td valign="top" class="value">
     267                                </td>
     268                            </tr>
     269
     270                            <tr class="prop">
     271                                <td valign="top" class="groupName">
     272                                    <label for="spareFor">Assets:</label>
    210273                                </td>
    211274                                <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'spareFor','errors')}">
    212                                     <g:select name="spareFor"
    213                                                         from="${ Asset.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
    214                                                         size="5" multiple="yes" optionKey="id"
    215                                                         value="${inventoryItemInstance?.spareFor.id}" noSelection="['':'--None--']"/>
    216 
    217                                 </td>
    218                             </tr>
    219 
    220                             <tr class="prop">
    221                                 <td valign="top" class="name">
    222                                     <label for="inventoryGroup">Inventory Group:</label>
    223                                 </td>
    224                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryGroup','errors')}">
    225                                     <g:select optionKey="id" from="${InventoryGroup.list()}" name="inventoryGroup.id" value="${inventoryItemInstance?.inventoryGroup?.id}" ></g:select>
    226                                     <g:helpBalloon class="helpballoon" code="inventory.item.inventory.group" />
    227                                 </td>
    228                             </tr>
    229 
    230                             <tr class="prop">
    231                                 <td valign="top" class="name">
    232                                     <label for="inventoryType">Inventory Type:</label>
    233                                 </td>
    234                                 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'inventoryType','errors')}">
    235                                     <g:select optionKey="id" from="${InventoryType.list()}" name="inventoryType.id" value="${inventoryItemInstance?.inventoryType?.id}" ></g:select>
    236                                     <g:helpBalloon class="helpballoon" code="inventory.item.inventory.type" />
     275                                    <g:helpBalloon class="helpballoon" code="inventory.item.spare.for" />
     276                                    <custom:checkBoxList name="spareFor"
     277                                                                    from="${Asset.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}"
     278                                                                    value="${inventoryItemInstance?.spareFor?.collect{it.id}}"
     279                                                                    optionKey="id"
     280                                                                    sortBy="name"
     281                                                                    linkController="assetDetailed"
     282                                                                    linkAction="show"/>
     283                                    <g:link controller="assetDetailed" action="create">+Add Asset</g:link>
    237284                                </td>
    238285                            </tr>
  • trunk/grails-app/views/inventoryItemDetailed/show.gsp

    r720 r727  
    5858                <richui:tabLabels>
    5959                    <richui:tabLabel selected="${showTab.inventory}" title="Inventory Item" />
    60                     <richui:tabLabel selected="${showTab.detail}" title="Detail" />
    6160                    <g:if test="${!inventoryMovementList.isEmpty()}">
    6261                        <richui:tabLabel selected="${showTab.movement}" title="Movement (${inventoryMovementList.size()})" />
     
    133132
    134133                                    <tr class="prop">
    135                                         <td valign="top" class="name">Picture:</td>
     134                                        <td valign="top" class="groupName">Picture:</td>
    136135                                        <td valign="top" class="value">
    137136                                            <g:if test="${inventoryItemInstance.picture}" >
    138                                                 <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span>
     137                                                <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Small}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span>
    139138                                            </g:if>
    140139                                            <g:else>
     
    149148
    150149                                    <tr class="prop">
    151                                         <td valign="top" class="name">Comment:</td>
     150                                        <td valign="top" class="groupName">Comment:</td>
    152151
    153152                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'comment')}</td>
     
    155154
    156155                                    <tr class="prop">
    157                                         <td valign="top" class="name">In Stock:</td>
     156                                        <td valign="top" class="groupName">In Stock:</td>
    158157
    159158                                        <td valign="top" class="value">
     
    163162
    164163                                    <tr class="prop">
    165                                         <td valign="top" class="name">Location:</td>
     164                                        <td valign="top" class="groupName">Location:</td>
    166165
    167166                                        <td valign="top" class="value">
     
    174173
    175174                                    <tr class="prop">
    176                                         <td valign="top" class="name">Active:</td>
     175                                        <td valign="top" class="groupName">Inventory Group:</td>
     176                                        <td valign="top" class="value">${inventoryItemInstance.inventoryGroup?.encodeAsHTML()}</td>
     177                                    </tr>
     178
     179                                    <tr class="prop">
     180                                        <td valign="top" class="groupName">Inventory Type:</td>
     181                                        <td valign="top" class="value">${inventoryItemInstance.inventoryType?.encodeAsHTML()}</td>
     182                                    </tr>
     183
     184                                    <tr class="prop">
     185                                        <td valign="top" class="groupHeader">
     186                                            <label for="name">Reorder Details</label>
     187                                        </td>
     188                                        <td valign="top" class="value">
     189                                        </td>
     190                                    </tr>
     191
     192                                    <tr class="prop">
     193                                        <td valign="top" class="groupName">Active:</td>
    177194
    178195                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isActive')}</td>
     
    180197
    181198                                    <tr class="prop">
    182                                         <td valign="top" class="name">Spare For:</td>
     199                                        <td valign="top" class="groupName">Obsolete:</td>
     200                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isObsolete')}</td>
     201                                    </tr>
     202
     203                                    <tr class="prop">
     204                                        <td valign="top" class="groupName">Enable Reorder Listing:</td>
     205                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorderListing')}</td>
     206                                    </tr>
     207
     208                                    <tr class="prop">
     209                                        <td valign="top" class="groupName">Reorder Point:</td>
     210                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderPoint')}</td>
     211                                    </tr>
     212
     213                                    <tr class="prop">
     214                                        <td valign="top" class="groupName">Reorder Quantity:</td>
     215                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderQuantity')}</td>
     216                                    </tr>
     217
     218                                    <tr class="prop">
     219                                        <td valign="top" class="groupName">Estimated Unit Price:</td>
     220
     221                                        <td valign="top" class="value">
     222                                            <g:if test="${inventoryItemInstance.estimatedUnitPriceAmount}">
     223                                                ${inventoryItemInstance.estimatedUnitPriceAmount.encodeAsHTML()}
     224                                                ${inventoryItemInstance.estimatedUnitPriceCurrency.encodeAsHTML()}
     225                                            </g:if>
     226                                        </td>
     227                                    </tr>
     228
     229                                    <tr class="prop">
     230                                        <td valign="top" class="groupName">Suppliers Part Number:</td>
     231                                        <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'suppliersPartNumber')}</td>
     232                                    </tr>
     233
     234                                    <tr class="prop">
     235                                        <td valign="top" class="groupName">Preferred Supplier:</td>
     236
     237                                        <td  valign="top" style="text-align:left;" class="value">
     238                                            <g:link controller="supplierDetailed" action="show" id="${inventoryItemInstance.preferredSupplier?.id}">
     239                                                ${inventoryItemInstance.preferredSupplier?.encodeAsHTML()}
     240                                            </g:link>
     241                                        </td>
     242                                    </tr>
     243
     244                                    <tr class="prop">
     245                                        <td valign="top" class="groupName">Alternate Suppliers:</td>
     246
     247                                        <td  valign="top" style="text-align:left;" class="value">
     248                                            <ul>
     249                                            <g:each var="s" in="${ inventoryItemInstance.alternateSuppliers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
     250                                                <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
     251                                            </g:each>
     252                                            </ul>
     253                                        </td>
     254                                    </tr>
     255
     256                                    <tr class="prop">
     257                                        <td valign="top" class="groupHeader">
     258                                            <label for="name">Spare For</label>
     259                                        </td>
     260                                        <td valign="top" class="value">
     261                                        </td>
     262                                    </tr>
     263
     264                                    <tr class="prop">
     265                                        <td valign="top" class="groupName">Assets:</td>
    183266
    184267                                        <td  valign="top" style="text-align:left;" class="value">
     
    206289                    </richui:tabContent>
    207290<!-- End Inventory tab -->
    208 
    209 <!-- Start Detail tab -->
    210                     <richui:tabContent>
    211 
    212                         <div class="dialog">
    213                             <table>
    214                                 <tbody>
    215 
    216                                     <tr class="prop">
    217                                         <td valign="top" class="name">Id:</td>
    218                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'id')}</td>
    219                                     </tr>
    220 
    221                                     <tr class="prop">
    222                                         <td valign="top" class="name">Obsolete:</td>
    223                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isObsolete')}</td>
    224                                     </tr>
    225 
    226                                     <tr class="prop">
    227                                         <td valign="top" class="name">Inventory Group:</td>
    228                                         <td valign="top" class="value">${inventoryItemInstance.inventoryGroup?.encodeAsHTML()}</td>
    229                                     </tr>
    230 
    231                                     <tr class="prop">
    232                                         <td valign="top" class="name">Inventory Type:</td>
    233                                         <td valign="top" class="value">${inventoryItemInstance.inventoryType?.encodeAsHTML()}</td>
    234                                     </tr>
    235 
    236                                     <tr class="prop">
    237                                         <td valign="top" class="name">Reorder Point:</td>
    238                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderPoint')}</td>
    239                                     </tr>
    240 
    241                                     <tr class="prop">
    242                                         <td valign="top" class="name">Enable Reorder Listing:</td>
    243                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorderListing')}</td>
    244                                     </tr>
    245 
    246                                     <tr class="prop">
    247                                         <td valign="top" class="name">Reorder Quantity:</td>
    248                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderQuantity')}</td>
    249                                     </tr>
    250 
    251                                     <tr class="prop">
    252                                         <td valign="top" class="name">Estimated Unit Price:</td>
    253 
    254                                         <td valign="top" class="value">
    255                                             <g:if test="${inventoryItemInstance.estimatedUnitPriceAmount}">
    256                                                 ${inventoryItemInstance.estimatedUnitPriceAmount.encodeAsHTML()}
    257                                                 ${inventoryItemInstance.estimatedUnitPriceCurrency.encodeAsHTML()}
    258                                             </g:if>
    259                                         </td>
    260                                     </tr>
    261 
    262                                     <tr class="prop">
    263                                         <td valign="top" class="name">Suppliers Part Number:</td>
    264                                         <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'suppliersPartNumber')}</td>
    265                                     </tr>
    266 
    267                                     <tr class="prop">
    268                                         <td valign="top" class="name">Preferred Supplier:</td>
    269 
    270                                         <td  valign="top" style="text-align:left;" class="value">
    271                                             <g:link controller="supplierDetailed" action="show" id="${inventoryItemInstance.preferredSupplier?.id}">
    272                                                 ${inventoryItemInstance.preferredSupplier?.encodeAsHTML()}
    273                                             </g:link>
    274                                         </td>
    275                                     </tr>
    276 
    277                                     <tr class="prop">
    278                                         <td valign="top" class="name">Alternate Suppliers:</td>
    279 
    280                                         <td  valign="top" style="text-align:left;" class="value">
    281                                             <ul>
    282                                             <g:each var="s" in="${ inventoryItemInstance.alternateSuppliers.sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }">
    283                                                 <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
    284                                             </g:each>
    285                                             </ul>
    286                                         </td>
    287                                     </tr>
    288 
    289                                 </tbody>
    290                             </table>
    291                         </div>
    292                         <div class="buttons">
    293                             <g:form>
    294                                 <g:hiddenField name="id" value="${inventoryItemInstance.id}" />
    295                                 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
    296                                 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
    297                             </g:form>
    298                         </div>
    299                     </richui:tabContent>
    300 <!-- End Detail tab -->
    301291
    302292<!-- Start Movement tab -->
Note: See TracChangeset for help on using the changeset viewer.