Changeset 599 for trunk/grails-app/domain
- Timestamp:
- Jun 18, 2010, 3:58:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/InventoryItemPurchase.groovy
r441 r599 22 22 static constraints = { 23 23 quantity(min:0) 24 purchaseOrderNumber(blank:false, maxSize:50) 24 purchaseOrderNumber(blank:false, maxSize:50, validator: {val, obj -> 25 // For orders the purchaseOrderNumber must be unique for an inventoryItem. 26 if(obj.inventoryItemPurchaseType.id == 1L) { 27 def list = InventoryItemPurchase.withCriteria { 28 eq('inventoryItem', obj.inventoryItem) 29 eq('purchaseOrderNumber', obj.purchaseOrderNumber) 30 eq('inventoryItemPurchaseType', obj.inventoryItemPurchaseType) 31 if(obj.id) 32 notEqual('id', obj.id) 33 } 34 if(list.size() > 0) 35 return 'not.unique.for.inventory.item.order' 36 } 37 // Success. 38 return true 39 }) 25 40 invoiceNumber(maxSize:50) 26 41 orderValueAmount(max: new BigDecimal(1000000000000))
Note: See TracChangeset
for help on using the changeset viewer.