source: trunk/grails-app/domain/InventoryMovement.groovy @ 964

Last change on this file since 964 was 408, checked in by gav, 15 years ago

Make a note on InventoryMovement belongsTo.
Small correction to InventoryItem controller.

File size: 605 bytes
Line 
1class InventoryMovement {
2    Person person
3    InventoryItem inventoryItem
4    InventoryMovementType inventoryMovementType
5    Task task
6    Integer quantity
7    Date date = new Date()
8
9    // We do not want deletion of inventory items to cascade.
10    //static belongsTo = [InventoryItem]
11
12    static constraints = {
13        inventoryItem()
14        quantity(min:1)
15        inventoryMovementType()
16        task(nullable:true)
17        person()
18        date()
19    }
20
21    String toString() {
22        "${this.quantity} ${inventoryMovementType.name} on ${date.format('EEE, dd-MMM-yyyy')} by ${person}."
23    }
24}
Note: See TracBrowser for help on using the repository browser.