Last change
on this file since 178 was
177,
checked in by gav, 15 years ago
|
Inventory movement quantity adjustments now done in a service.
InventoryMovementType now has an incrementsInventory flag, so not dependant on the text name.
|
File size:
568 bytes
|
Line | |
---|
1 | import java.text.SimpleDateFormat |
---|
2 | |
---|
3 | class InventoryMovement { |
---|
4 | InventoryItem inventoryItem |
---|
5 | InventoryMovementType inventoryMovementType |
---|
6 | Task task |
---|
7 | Integer quantity |
---|
8 | Date date = new Date() |
---|
9 | |
---|
10 | // static belongsTo = [] |
---|
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.