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

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

Substantial refactor of the Inventory domain.
InventoryItems can now be added to tasks, no quantity adjustments done yet.
Removed StoredItem and with it the ability to store an inventoryItem in multiple places, just too complex right now.
Svn move StoreLocation to InventoryLocation.

File size: 581 bytes
Line 
1import java.text.SimpleDateFormat
2
3class InventoryMovement {
4    InventoryItem inventoryItem
5    InventoryMovementType inventoryMovementType
6    Task task
7    Integer quantity
8    Date date = new Date()
9
10//     static belongsTo = [inventoryItem]
11
12    static constraints = {
13        inventoryItem()
14        quantity(min:1)
15        inventoryMovementType()
16        task(nullable:true)
17        date()
18    }
19
20    String toString() {
21        def date = new SimpleDateFormat("EEE, dd-MMM-yyyy").format(this.date)
22        "${this.quantity} ${inventoryMovementType.name} on ${date}"
23    }
24}
Note: See TracBrowser for help on using the repository browser.