Ignore:
Timestamp:
Jun 22, 2010, 5:55:31 PM (15 years ago)
Author:
gav
Message:

Prevent reordering of obsolete or inactive inventory items.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/InventoryPurchaseService.groovy

    r605 r610  
    264264            result.inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure
    265265
     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
    266272            if(result.inventoryItemPurchaseInstance.hasErrors() || !result.inventoryItemPurchaseInstance.save())
    267273                return fail(code:"default.create.failure")
Note: See TracChangeset for help on using the changeset viewer.