Changeset 225
- Timestamp:
- Dec 8, 2009, 4:03:29 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemDetailedController.groovy
r178 r225 4 4 5 5 def filterService 6 def inventoryItemService 7 def inventoryMovementService 6 8 7 9 def index = { redirect(action:search, params:params) } 8 10 9 11 // the delete, save and update actions only accept POST requests 10 static allowedMethods = [delete:'POST', save:'POST', update:'POST' ]12 static allowedMethods = [delete:'POST', save:'POST', update:'POST', useInventoryItem:'POST'] 11 13 12 14 def list = { … … 29 31 } 30 32 33 /** 34 * Simply assigns a passed in task id to a session variable and redirects to search. 35 */ 36 def findInventoryItemForMovement = { 37 if(!params.task?.id) { 38 flash.message = "No task id supplied, please select a task then the inventory tab." 39 redirect(controller: "taskDetailed", action: "search") 40 return 41 } 42 43 session.inventoryMovementTaskId = params.task.id 44 flash.message = "Please find and then select the inventory item." 45 redirect(action: search) 46 } 47 31 48 def show = { 32 49 33 50 // In the case of an actionSubmit button, rewrite action name from 'index'. 34 51 if(params._action_Show) 35 52 { params.action='show' } 36 37 def inventoryItemInstance = InventoryItem.get( params.id )38 53 39 if(! inventoryItemInstance) {54 if(!InventoryItem.exists(params.id)) { 40 55 flash.message = "InventoryItem not found with id ${params.id}" 41 56 redirect(action:search) 57 return 42 58 } 43 else { return [ inventoryItemInstance : inventoryItemInstance ] } 59 60 def result = inventoryItemService.prepareShowData(params) 61 62 if(result.error) { 63 flash.message = "Could not to prepare the data to show item with id: ${params.id}." 64 redirect(action:search) 65 return 66 } 67 68 def model = [ inventoryItemInstance: result.inventoryItemInstance, 69 inventoryMovementList: result.inventoryMovementList, 70 inventoryMovementListTotal: result.inventoryMovementListTotal, 71 inventoryMovementListMax: result.inventoryMovementListMax, 72 showTab: result.showTab] 73 74 if(session.inventoryMovementTaskId) { 75 model.inventoryMovementInstance = new InventoryMovement() 76 model.inventoryMovementInstance.task = Task.get(session.inventoryMovementTaskId) 77 model.inventoryMovementInstance.quantity = 1 78 } 79 80 return model 44 81 } 45 82 … … 123 160 } 124 161 } 162 163 /** 164 * Handles the use inventory item form submit in the show view. 165 */ 166 def useInventoryItem = { 167 168 params.inventoryMovementType = InventoryMovementType.get(1) // used. 169 def result = inventoryMovementService.move(params) 170 171 if(!result.error) { 172 flash.message = "Inventory Movement for ${result.inventoryMovementInstance.inventoryItem.name.encodeAsHTML()} created." 173 redirect(controller:"taskDetailed", action:"show", id: result.taskId) 174 } 175 else { 176 if(result.inventoryMovementInstance) { 177 def p = [:] 178 p.id = result.inventoryMovementInstance.inventoryItem?.id 179 def r = inventoryItemService.prepareShowData(p) 180 181 def model = [ inventoryItemInstance: r.inventoryItemInstance, 182 inventoryMovementList: r.inventoryMovementList, 183 inventoryMovementListTotal: r.inventoryMovementListTotal, 184 inventoryMovementListMax: r.inventoryMovementListMax, 185 showTab: r.showTab] 186 187 model.inventoryMovementInstance = result.inventoryMovementInstance 188 189 render(view: 'show', model: model) 190 } 191 else { 192 flash.message = "Could not create inventory movement." 193 redirect(action:"search") 194 } 195 196 } 197 } 198 125 199 } -
trunk/grails-app/controllers/TaskDetailedController.groovy
r216 r225 154 154 { params.action='show' } 155 155 156 def showTab = [:] 157 switch (params.showTab) { 158 case "showProcedureTab": 159 showTab.procedure = new String("true") 160 break 161 case "showRecurrenceTab": 162 showTab.recurrence = new String("true") 163 break 164 case "showInventoryTab": 165 showTab.inventory = new String("true") 166 break 167 case "showSubTasksTab": 168 showTab.subTasks = new String("true") 169 break 170 default: 171 showTab.task = new String("true") 172 } 173 156 174 def taskInstance = Task.get( params.id ) 157 175 … … 177 195 def subTaskInstanceList = Task.findAllByParentTaskAndTrash(taskInstance, false, params) 178 196 def subTaskInstanceTotal = Task.countByParentTaskAndTrash(taskInstance, false) 179 def showTaskTab = new String("true")180 197 181 198 def inventoryMovementList = InventoryMovement.findAllByTask(taskInstance, [max:100, sort:"id", order:"desc", offset:0]) … … 204 221 taskProcedureInstance: taskProcedureInstance, 205 222 taskProcedureExits: taskProcedureExits, 206 showTa skTab: showTaskTab,223 showTab: showTab, 207 224 subTaskInstanceList: subTaskInstanceList, 208 225 subTaskInstanceTotal: subTaskInstanceTotal, -
trunk/grails-app/i18n/messages.properties
r213 r225 66 66 task.associatedAssets=Associated Assets 67 67 task.associatedAssets.help=These assets are to be associated with this task, but costs will not be assigned. 68 69 70 inventoryItem.notFound=Could not complete operation, inventory item not found. 68 71 69 72 inventoryMovement.quantity.insufficientItemsInStock=Could not complete operation, insufficient items in stock. -
trunk/grails-app/services/InventoryMovementService.groovy
r217 r225 10 10 result.inventoryMovementInstance = InventoryMovement.lock(params.id) 11 11 if(result.inventoryMovementInstance) { 12 13 // Used type must have a task that is not complete or in the trash 14 if(result.inventoryMovementInstance.inventoryMovementType.id == 1) { 15 16 // Unlike move, if the task does not exist at all then deletion is still allowed. 17 if(result.inventoryMovementInstance.task?.trash) { 18 status.setRollbackOnly() 19 result.inventoryMovementInstance.errors.rejectValue("task", "task.operationNotPermittedOnTaskInTrash") 20 result.error = true 21 return result 22 } 23 24 if(result.inventoryMovementInstance.task?.taskStatus?.id == 3) { 25 status.setRollbackOnly() 26 result.inventoryMovementInstance.errors.rejectValue('task', "task.operationNotPermittedOnCompleteTask") 27 result.error = true 28 return result 29 } 30 } 31 12 32 def inventoryItem = InventoryItem.lock(result.inventoryMovementInstance.inventoryItem.id) 13 result.taskId = result.inventoryMovementInstance.task .id33 result.taskId = result.inventoryMovementInstance.task?.id 14 34 15 35 if(!inventoryItem) { … … 70 90 result.inventoryMovementInstance.person = personService.currentUser 71 91 92 // Used type must have a task that is not complete or in the trash 93 if(result.inventoryMovementInstance.inventoryMovementType.id == 1) { 94 95 if(!result.inventoryMovementInstance.task) { 96 status.setRollbackOnly() 97 result.inventoryMovementInstance.errors.rejectValue('task', "task.notFound") 98 result.error = true 99 return result 100 } 101 102 if(result.inventoryMovementInstance.task.trash) { 103 status.setRollbackOnly() 104 result.inventoryMovementInstance.errors.rejectValue("task", "task.operationNotPermittedOnTaskInTrash") 105 result.error = true 106 return result 107 } 108 109 if(result.inventoryMovementInstance.task.taskStatus.id == 3) { 110 status.setRollbackOnly() 111 result.inventoryMovementInstance.errors.rejectValue('task', "task.operationNotPermittedOnCompleteTask") 112 result.error = true 113 return result 114 } 115 } 116 72 117 if(result.inventoryMovementInstance.validate()) { 73 118 def inventoryItem = InventoryItem.lock(result.inventoryMovementInstance.inventoryItem.id) … … 77 122 status.setRollbackOnly() 78 123 result.inventoryMovementInstance.errors.rejectValue('inventoryItem', "inventoryMovement.inventoryItem.notFound") 79 result.error = true80 return result81 }82 83 if(result.inventoryMovementInstance.task.taskStatus.id == 3) {84 status.setRollbackOnly()85 result.inventoryMovementInstance.errors.rejectValue('task', "task.operationNotPermittedOnCompleteTask")86 124 result.error = true 87 125 return result -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r182 r225 7 7 <title>Show InventoryItem</title> 8 8 <nav:resources override="true"/> 9 <resource:tabView skin="tabviewCustom" /> 9 10 <g:render template="/shared/pictureHead" /> 10 11 </head> … … 14 15 </div> 15 16 <div class="body"> 17 <g:hasErrors bean="${inventoryMovementInstance}"> 18 <div class="errors"> 19 <g:renderErrors bean="${inventoryMovementInstance}" as="list" /> 20 </div> 21 </g:hasErrors> 16 22 <g:if test="${flash.message}"> 17 <div class="message">${flash.message}</div>23 <div class="message">${flash.message}</div> 18 24 </g:if> 19 <div class="dialog"> 20 <table> 21 <tbody> 22 23 <tr class="prop"> 24 <td valign="top" class="name">Picture:</td> 25 <td valign="top" class="value"> 26 <g:if test="${inventoryItemInstance.picture}" > 27 <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span> 28 </g:if> 29 <g:else> 30 <g:link controller="pictureDetailed" 31 params="['inventoryItem.id':inventoryItemInstance?.id]" 32 action="create"> 33 Add Picture 34 </g:link> 35 </g:else> 36 </td> 37 </tr> 38 39 <tr class="prop"> 40 <td valign="top" class="name">Id:</td> 41 42 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'id')}</td> 43 44 </tr> 45 46 <tr class="prop"> 47 <td valign="top" class="name">Name:</td> 48 49 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'name')}</td> 50 51 </tr> 52 53 <tr class="prop"> 54 <td valign="top" class="name">Description:</td> 55 56 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'description')}</td> 57 58 </tr> 59 60 <tr class="prop"> 61 <td valign="top" class="name">Location:</td> 62 63 <td valign="top" class="value"> 64 <g:link controller="inventoryLocationDetailed" action="show" id="${inventoryItemInstance?.inventoryLocation?.id}"> 65 ${inventoryItemInstance?.inventoryLocation?.encodeAsHTML()} 66 </g:link> 67 in ${inventoryItemInstance?.inventoryLocation?.inventoryStore.encodeAsHTML()} 68 </td> 69 70 </tr> 71 72 <tr class="prop"> 73 <td valign="top" class="name">In Stock:</td> 74 75 <td valign="top" class="value"> 76 ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')} ${inventoryItemInstance?.unitOfMeasure?.encodeAsHTML()} 77 </td> 78 79 </tr> 80 81 <tr class="prop"> 82 <td valign="top" class="name">Reorder Point:</td> 83 84 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderPoint')}</td> 85 86 </tr> 87 88 <tr class="prop"> 89 <td valign="top" class="name">Enable Reorder:</td> 90 91 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorder')}</td> 92 93 </tr> 94 95 <tr class="prop"> 96 <td valign="top" class="name">Recommended Reorder Point:</td> 97 98 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'recommendedReorderPoint')}</td> 99 100 </tr> 101 102 <tr class="prop"> 103 <td valign="top" class="name">Active:</td> 104 105 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isActive')}</td> 106 107 </tr> 108 109 <tr class="prop"> 110 <td valign="top" class="name">Obsolete:</td> 111 112 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isObsolete')}</td> 113 114 </tr> 115 116 <tr class="prop"> 117 <td valign="top" class="name">Inventory Group:</td> 118 119 <td valign="top" class="value">${inventoryItemInstance?.inventoryGroup?.encodeAsHTML()}</td> 120 121 </tr> 122 123 124 <tr class="prop"> 125 <td valign="top" class="name">Inventory Type:</td> 126 127 <td valign="top" class="value">${inventoryItemInstance?.inventoryType?.encodeAsHTML()}</td> 128 129 </tr> 130 131 <tr class="prop"> 132 <td valign="top" class="name">Manufacturers Part Number:</td> 133 134 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'manufacturersPartNumber')}</td> 135 136 </tr> 137 138 <tr class="prop"> 139 <td valign="top" class="name">Suppliers Part Number:</td> 140 141 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'suppliersPartNumber')}</td> 142 143 </tr> 144 145 <tr class="prop"> 146 <td valign="top" class="name">Recommended Reorder Point:</td> 147 148 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'recommendedReorderPoint')}</td> 149 150 </tr> 151 152 <tr class="prop"> 153 <td valign="top" class="name">Average Delivery Time:</td> 154 155 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'averageDeliveryTime')}</td> 156 157 </tr> 158 159 <tr class="prop"> 160 <td valign="top" class="name">Alternate Items:</td> 161 162 <td valign="top" style="text-align:left;" class="value"> 163 <ul> 164 <g:each var="a" in="${inventoryItemInstance.alternateItems}"> 165 <li><g:link controller="inventoryItemDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li> 166 </g:each> 167 </ul> 168 </td> 169 170 </tr> 171 172 <tr class="prop"> 173 <td valign="top" class="name">Inventory Movements:</td> 174 175 <td valign="top" style="text-align:left;" class="value"> 176 <ul> 177 <g:each var="i" in="${inventoryItemInstance.inventoryMovements}"> 178 <li><g:link controller="inventoryMovementDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li> 179 </g:each> 180 </ul> 181 </td> 182 183 </tr> 184 185 <tr class="prop"> 186 <td valign="top" class="name">Manufacturers:</td> 187 188 <td valign="top" style="text-align:left;" class="value"> 189 <ul> 190 <g:each var="m" in="${inventoryItemInstance.manufacturers}"> 191 <li><g:link controller="manufacturerDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li> 192 </g:each> 193 </ul> 194 </td> 195 196 </tr> 197 198 <tr class="prop"> 199 <td valign="top" class="name">Spare For:</td> 200 201 <td valign="top" style="text-align:left;" class="value"> 202 <ul> 203 <g:each var="s" in="${inventoryItemInstance.spareFor}"> 204 <li><g:link controller="assetDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 205 </g:each> 206 </ul> 207 </td> 208 209 </tr> 210 211 <tr class="prop"> 212 <td valign="top" class="name">Suppliers:</td> 213 214 <td valign="top" style="text-align:left;" class="value"> 215 <ul> 216 <g:each var="s" in="${inventoryItemInstance.suppliers}"> 217 <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 218 </g:each> 219 </ul> 220 </td> 221 222 </tr> 223 224 </tbody> 225 </table> 25 26 <g:hasErrors bean="${inventoryItemInstance}"> 27 <div class="errors"> 28 <g:renderErrors bean="${inventoryItemInstance}" as="list" /> 226 29 </div> 227 <div class="buttons"> 228 <g:form> 229 <input type="hidden" name="id" value="${inventoryItemInstance?.id}" /> 230 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 231 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 232 </g:form> 233 </div> 30 </g:hasErrors> 31 32 <richui:tabView id="tabView"> 33 34 <richui:tabLabels> 35 <richui:tabLabel selected="${showTab.inventory}" title="Inventory Item" /> 36 <richui:tabLabel selected="${showTab.detail}" title="Detail" /> 37 <richui:tabLabel selected="${showTab.movement}" title="Movement" /> 38 </richui:tabLabels> 39 40 <richui:tabContents> 41 42 <!-- Start Inventory tab --> 43 <richui:tabContent> 44 45 <g:if test="${inventoryMovementInstance}" > 46 47 <g:form controller="inventoryItemDetailed" method="post" > 48 <div class="dialog"> 49 <table> 50 <tbody> 51 <g:hiddenField name="task.id" value="${inventoryMovementInstance.task.id}"/> 52 <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}"/> 53 <tr class="prop"> 54 <td valign="top" class="name">Use on task:</td> 55 <td valign="top" class="value"> 56 <g:link controller="taskDetailed" action="show" id="${inventoryMovementInstance.task.id}" > 57 ${Task.get(inventoryMovementInstance.task.id).encodeAsHTML()} 58 </g:link> 59 </td> 60 </tr> 61 62 <tr class="prop"> 63 <td valign="top" class="name"> 64 <label for="quantity">Quantity:</label> 65 </td> 66 <td valign="top"> 67 <input class="medium ${hasErrors(bean:inventoryMovementInstance,field:'quantity','errors')}" 68 type="text" id="quantity" name="quantity" 69 value="${fieldValue(bean:inventoryMovementInstance,field:'quantity')}"/> 70 ${inventoryItemInstance.unitOfMeasure?.encodeAsHTML()} 71 72 <span class="buttons"> 73 <g:actionSubmit action="useInventoryItem" class="save" value="${InventoryMovementType.get(1)}" /> 74 </span> 75 76 </td> 77 </tr> 78 79 </tbody> 80 </table> 81 </div> 82 </g:form> 83 84 <br /> 85 86 </g:if> 87 88 <div class="dialog"> 89 <table> 90 <tbody> 91 92 <tr class="prop"> 93 <td valign="top" class="name">Picture:</td> 94 <td valign="top" class="value"> 95 <g:if test="${inventoryItemInstance.picture}" > 96 <span class='gallery'><wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}" size="${Image.Medium}" lightboxSize="${Image.Large}" target="_blank" title="Show Original" /></span> 97 </g:if> 98 <g:else> 99 <g:link controller="pictureDetailed" 100 params="['inventoryItem.id':inventoryItemInstance.id]" 101 action="create"> 102 Add Picture 103 </g:link> 104 </g:else> 105 </td> 106 </tr> 107 108 <tr class="prop"> 109 <td valign="top" class="name">Name:</td> 110 111 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'name')}</td> 112 </tr> 113 114 <tr class="prop"> 115 <td valign="top" class="name">Description:</td> 116 117 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'description')}</td> 118 </tr> 119 120 <tr class="prop"> 121 <td valign="top" class="name">In Stock:</td> 122 123 <td valign="top" class="value"> 124 ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')} ${inventoryItemInstance.unitOfMeasure.encodeAsHTML()} 125 </td> 126 </tr> 127 128 <tr class="prop"> 129 <td valign="top" class="name">Location:</td> 130 131 <td valign="top" class="value"> 132 <g:link controller="inventoryLocationDetailed" action="show" id="${inventoryItemInstance.inventoryLocation?.id}"> 133 ${inventoryItemInstance.inventoryLocation?.encodeAsHTML()} 134 </g:link> 135 in ${inventoryItemInstance.inventoryLocation?.inventoryStore.encodeAsHTML()} 136 </td> 137 </tr> 138 139 <tr class="prop"> 140 <td valign="top" class="name">Active:</td> 141 142 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isActive')}</td> 143 </tr> 144 145 <tr class="prop"> 146 <td valign="top" class="name">Alternate Items:</td> 147 148 <td valign="top" style="text-align:left;" class="value"> 149 <ul> 150 <g:each var="a" in="${inventoryItemInstance.alternateItems}"> 151 <li><g:link controller="inventoryItemDetailed" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li> 152 </g:each> 153 </ul> 154 </td> 155 </tr> 156 157 <tr class="prop"> 158 <td valign="top" class="name">Spare For:</td> 159 160 <td valign="top" style="text-align:left;" class="value"> 161 <ul> 162 <g:each var="s" in="${inventoryItemInstance.spareFor}"> 163 <li><g:link controller="assetDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 164 </g:each> 165 </ul> 166 </td> 167 </tr> 168 169 </tbody> 170 </table> 171 </div> 172 <div class="buttons"> 173 <g:form> 174 <g:hiddenField name="id" value="${inventoryItemInstance.id}" /> 175 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 176 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 177 </g:form> 178 </div> 179 180 <br /> 181 182 </richui:tabContent> 183 <!-- End Inventory tab --> 184 185 <!-- Start Detail tab --> 186 <richui:tabContent> 187 188 <div class="dialog"> 189 <table> 190 <tbody> 191 192 <tr class="prop"> 193 <td valign="top" class="name">Id:</td> 194 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'id')}</td> 195 </tr> 196 197 <tr class="prop"> 198 <td valign="top" class="name">Obsolete:</td> 199 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'isObsolete')}</td> 200 </tr> 201 202 <tr class="prop"> 203 <td valign="top" class="name">Inventory Group:</td> 204 <td valign="top" class="value">${inventoryItemInstance.inventoryGroup?.encodeAsHTML()}</td> 205 </tr> 206 207 <tr class="prop"> 208 <td valign="top" class="name">Inventory Type:</td> 209 <td valign="top" class="value">${inventoryItemInstance.inventoryType?.encodeAsHTML()}</td> 210 </tr> 211 212 <tr class="prop"> 213 <td valign="top" class="name">Reorder Point:</td> 214 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'reorderPoint')}</td> 215 </tr> 216 217 <tr class="prop"> 218 <td valign="top" class="name">Enable Reorder:</td> 219 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorder')}</td> 220 </tr> 221 222 <tr class="prop"> 223 <td valign="top" class="name">Recommended Reorder Point:</td> 224 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'recommendedReorderPoint')}</td> 225 </tr> 226 227 <tr class="prop"> 228 <td valign="top" class="name">Suppliers Part Number:</td> 229 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'suppliersPartNumber')}</td> 230 </tr> 231 232 <tr class="prop"> 233 <td valign="top" class="name">Suppliers:</td> 234 235 <td valign="top" style="text-align:left;" class="value"> 236 <ul> 237 <g:each var="s" in="${inventoryItemInstance.suppliers}"> 238 <li><g:link controller="supplierDetailed" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li> 239 </g:each> 240 </ul> 241 </td> 242 </tr> 243 244 <tr class="prop"> 245 <td valign="top" class="name">Average Delivery Time:</td> 246 <td valign="top" class="value"> 247 ${fieldValue(bean:inventoryItemInstance, field:'averageDeliveryTime')} 248 ${fieldValue(bean:inventoryItemInstance, field:'averageDeliveryPeriod')} 249 </td> 250 </tr> 251 252 <tr class="prop"> 253 <td valign="top" class="name">Manufacturers Part Number:</td> 254 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'manufacturersPartNumber')}</td> 255 </tr> 256 257 <tr class="prop"> 258 <td valign="top" class="name">Manufacturers:</td> 259 260 <td valign="top" style="text-align:left;" class="value"> 261 <ul> 262 <g:each var="m" in="${inventoryItemInstance.manufacturers}"> 263 <li><g:link controller="manufacturerDetailed" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li> 264 </g:each> 265 </ul> 266 </td> 267 </tr> 268 269 270 </tbody> 271 </table> 272 </div> 273 <div class="buttons"> 274 <g:form> 275 <g:hiddenField name="id" value="${inventoryItemInstance.id}" /> 276 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 277 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 278 </g:form> 279 </div> 280 </richui:tabContent> 281 <!-- End Detail tab --> 282 283 <!-- Start Movement tab --> 284 <richui:tabContent> 285 286 <g:if test="${inventoryMovementList.isEmpty()}"> 287 <br /> 288 No Inventory Movements. 289 <br /> 290 <br /> 291 292 <div class="buttons"> 293 <g:form controller="inventoryMovementDetailed"> 294 <g:hiddenField name="id" value="${inventoryItemInstance?.id}" /> 295 <span class="button"><g:actionSubmit action="create" class="add" value="Create" /></span> 296 </g:form> 297 </div> 298 299 </g:if> 300 <g:else> 301 302 <div class="list"> 303 <table> 304 <thead> 305 <tr> 306 <th>Quantity</th> 307 <th>Movement Type</th> 308 <th>Date</th> 309 <th>Person</th> 310 <th></th> 311 </tr> 312 </thead> 313 <tbody> 314 <g:each in="${inventoryMovementList}" status="i" var="movements"> 315 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${movements.id}"'/> 316 317 <td>${fieldValue(bean:movements, field:'quantity')}</td> 318 <td>${fieldValue(bean:movements, field:'inventoryMovementType')}</td> 319 <td><g:formatDate date="${movements.date}" format="EEE, dd-MMM-yyyy"/></td> 320 <td>${fieldValue(bean:movements, field:'person')}</td> 321 <td> 322 <g:link controller="inventoryMovementDetailed" action="show" id="${movements.id}"> 323 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" /> 324 </g:link> 325 </td> 326 327 </tr> 328 </g:each> 329 </tbody> 330 </table> 331 </div> 332 333 <div class="buttons"> 334 <g:form controller="inventoryMovementDetailed"> 335 <g:hiddenField name="id" value="${inventoryItemInstance?.id}" /> 336 <g:if test="${inventoryMovementListTotal > inventoryMovementListMax}"> 337 Showing ${inventoryMovementListMax} of ${inventoryMovementListTotal} 338 <br /> 339 </g:if> 340 <g:else> 341 Total ${inventoryMovementListTotal} 342 <br /> 343 </g:else> 344 <span class="button"><g:actionSubmit action="listInventoryMovements" class="table" value="List" /></span> 345 <span class="button"><g:actionSubmit action="create" class="add" value="Create" /></span> 346 </g:form> 347 </div> 348 349 </g:else> 350 351 </richui:tabContent> 352 <!-- End Movement tab --> 353 354 </richui:tabContents> 355 </richui:tabView> 356 357 234 358 </div> 235 359 </body> -
trunk/grails-app/views/inventoryMovementDetailed/create.gsp
r191 r225 56 56 <tr class="prop"> 57 57 <td valign="top" class="name"> 58 <label for="taskInstance">Linking with Task:</label>58 <label for="taskInstance">Linking with task:</label> 59 59 </td> 60 60 <td valign="top" name="inventoryMovementInstance.task" class="value"> -
trunk/grails-app/views/taskDetailed/show.gsp
r213 r225 30 30 31 31 <richui:tabLabels> 32 <richui:tabLabel selected="${showTa skTab}" title="Task #${taskInstance.id}" />33 <richui:tabLabel selected="${show ProcedureTab}" title="Procedure" />34 <richui:tabLabel selected="${show RecurrenceTab}" title="Recurrence" />35 <richui:tabLabel selected="${show InventoryTab}" title="Inventory" />36 <richui:tabLabel selected="${show SubTasksTab}" title="Sub Tasks" />32 <richui:tabLabel selected="${showTab.task}" title="Task #${taskInstance.id}" /> 33 <richui:tabLabel selected="${showTab.procedure}" title="Procedure" /> 34 <richui:tabLabel selected="${showTab.recurrence}" title="Recurrence" /> 35 <richui:tabLabel selected="${showTab.inventory}" title="Inventory" /> 36 <richui:tabLabel selected="${showTab.subTasks}" title="Sub Tasks" /> 37 37 </richui:tabLabels> 38 38 … … 530 530 <g:if test="${inventoryMovementList.isEmpty()}"> 531 531 <br /> 532 No Inventory Used.532 No Inventory Movements. 533 533 <br /> 534 534 <br /> … … 567 567 </g:else> 568 568 569 <g:form controller="inventory MovementDetailed" >570 < input type="hidden"name="task.id" value="${taskInstance?.id}" />569 <g:form controller="inventoryItemDetailed" > 570 <g:hiddenField name="task.id" value="${taskInstance?.id}" /> 571 571 <div class="buttons"> 572 572 <g:if test="${!inventoryMovementList.isEmpty()}"> … … 575 575 </g:if> 576 576 <span class="button"> 577 <g:actionSubmit value="Add" action="create" class="add"/>577 <g:actionSubmit action="findInventoryItemForMovement" class="add" value="Add"/> 578 578 </span> 579 579 </div>
Note: See TracChangeset
for help on using the changeset viewer.