Changeset 610
- Timestamp:
- Jun 22, 2010, 5:55:31 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemPurchaseDetailedController.groovy
r605 r610 276 276 } 277 277 278 params.errorMessage = g.message(code: result.error.code, args: result.error.args) 278 279 render(view:'create', model:['inventoryItemPurchaseInstance': result.inventoryItemPurchaseInstance]) 279 280 } -
trunk/grails-app/domain/InventoryItem.groovy
r566 r610 21 21 boolean isActive = true 22 22 boolean isObsolete = false 23 boolean enableReorder = true 23 boolean enableReorder = true /// @todo: rename to enableReorderListing. 24 24 25 25 static mapping = { -
trunk/grails-app/i18n/messages.properties
r609 r610 200 200 task.associatedAssets.help=These assets are to be associated with this task, but costs will not be assigned. 201 201 202 # InventoryItem Messages. 202 203 inventory.item.is.obsolete=This item has been flagged as obsolete. 203 204 inventory.item.not.active=This item has been flagged as not active. 205 inventory.item.reorder.not.allowed=Reorder not allowed. 206 inventory.item.reorder.listing.disabled=This item has reorder listing disabled and will not appear on reorder lists. 204 207 inventory.item.already.has.picture=Inventory item already has a picture, please delete the old picture first. 205 208 inventory.item.picture.file.unrecognised=Image file [{0}]: type not recognised. … … 214 217 inventoryItemPurchase.delete.failure.received.exists=Could not delete, items have been received. 215 218 inventoryItemPurchase.delete.failure.payment.approved=Could not delete, payment has been approved. 219 inventoryItemPurchase.operation.not.permitted.on.inactive.or.obsolete.item=This operation is not permitted on an inactive or obsolete inventory item. 216 220 217 221 assignedGroup.task.not.found=Please select a task and then ''Add Assigned Group''. -
trunk/grails-app/services/InventoryPurchaseService.groovy
r605 r610 264 264 result.inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure 265 265 266 // Prevent ordering on obsolete or inactive inventoryItem. 267 def isObsolete = result.inventoryItemPurchaseInstance.inventoryItem?.isObsolete 268 def isActive = result.inventoryItemPurchaseInstance.inventoryItem?.isActive 269 if(isObsolete || !isActive) 270 return fail(code:"inventoryItemPurchase.operation.not.permitted.on.inactive.or.obsolete.item") 271 266 272 if(result.inventoryItemPurchaseInstance.hasErrors() || !result.inventoryItemPurchaseInstance.save()) 267 273 return fail(code:"default.create.failure") -
trunk/grails-app/views/inventoryItemDetailed/create.gsp
r604 r610 84 84 <tr class="prop"> 85 85 <td valign="top" class="name"> 86 <label for="enableReorder">Enable Reorder :</label>86 <label for="enableReorder">Enable Reorder Listing:</label> 87 87 </td> 88 88 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorder','errors')}"> -
trunk/grails-app/views/inventoryItemDetailed/edit.gsp
r604 r610 129 129 <tr class="prop"> 130 130 <td valign="top" class="name"> 131 <label for="enableReorder">Enable Reorder :</label>131 <label for="enableReorder">Enable Reorder Listing:</label> 132 132 </td> 133 133 <td valign="top" class="value ${hasErrors(bean:inventoryItemInstance,field:'enableReorder','errors')}"> -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r605 r610 25 25 <li><g:message code="inventory.item.not.active" /><li> 26 26 </g:if> 27 <ul> 27 </ul> 28 </div> 29 </g:if> 30 <g:if test="${!inventoryItemInstance.enableReorder}" > 31 <div class="message"> 32 <g:message code="inventory.item.reorder.listing.disabled" /> 28 33 </div> 29 34 </g:if> … … 247 252 248 253 <tr class="prop"> 249 <td valign="top" class="name">Enable Reorder :</td>254 <td valign="top" class="name">Enable Reorder Listing:</td> 250 255 <td valign="top" class="value">${fieldValue(bean:inventoryItemInstance, field:'enableReorder')}</td> 251 256 </tr> … … 433 438 434 439 <div class="buttons"> 435 <g:form controller="inventoryItemPurchaseDetailed"> 436 <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" /> 437 <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span> 438 </g:form> 440 <!--Fake button to prevent ordering disabled inventory items--> 441 <g:if test="${inventoryItemInstance.isObsolete || !inventoryItemInstance.isActive}" > 442 <g:form controller="inventoryItemDetailed"> 443 <g:hiddenField name="id" value="${inventoryItemInstance.id}" /> 444 <span class="button"><g:actionSubmit action="show" class="add" value="${g.message(code:'inventory.item.reorder.not.allowed')}" /></span> 445 </g:form> 446 </g:if> 447 <g:else><!--Real order button.--> 448 <g:form controller="inventoryItemPurchaseDetailed"> 449 <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" /> 450 <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span> 451 </g:form> 452 </g:else> 439 453 </div> 440 454 … … 551 565 552 566 <div class="buttons"> 553 <g:form controller="inventoryItemPurchaseDetailed"> 554 <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" /> 555 Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal} 556 <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span> 557 </g:form> 567 <!--Fake button to prevent ordering disabled inventory items--> 568 <g:if test="${inventoryItemInstance.isObsolete || !inventoryItemInstance.isActive}" > 569 <g:form controller="inventoryItemDetailed"> 570 <g:hiddenField name="id" value="${inventoryItemInstance.id}" /> 571 Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal} 572 <span class="button"> 573 <g:actionSubmit action="show" class="add" value="${g.message(code:'inventory.item.reorder.not.allowed')}" /> 574 </span> 575 </g:form> 576 </g:if> 577 <g:else><!--Real order button.--> 578 <g:form controller="inventoryItemPurchaseDetailed"> 579 <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" /> 580 Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal} 581 <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span> 582 </g:form> 583 </g:else> 558 584 </div> 559 585
Note: See TracChangeset
for help on using the changeset viewer.