|
Last change
on this file since 191 was
177,
checked in by gav, 16 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
|
| Rev | Line | |
|---|
| [175] | 1 | import java.text.SimpleDateFormat |
|---|
| 2 | |
|---|
| [116] | 3 | class InventoryMovement { |
|---|
| 4 | InventoryItem inventoryItem |
|---|
| 5 | InventoryMovementType inventoryMovementType |
|---|
| 6 | Task task |
|---|
| [175] | 7 | Integer quantity |
|---|
| [116] | 8 | Date date = new Date() |
|---|
| 9 | |
|---|
| [177] | 10 | // static belongsTo = [] |
|---|
| [116] | 11 | |
|---|
| 12 | static constraints = { |
|---|
| 13 | inventoryItem() |
|---|
| [175] | 14 | quantity(min:1) |
|---|
| [116] | 15 | inventoryMovementType() |
|---|
| [146] | 16 | task(nullable:true) |
|---|
| [116] | 17 | date() |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| [175] | 20 | String toString() { |
|---|
| 21 | def date = new SimpleDateFormat("EEE, dd-MMM-yyyy").format(this.date) |
|---|
| 22 | "${this.quantity} ${inventoryMovementType.name} on ${date}" |
|---|
| 23 | } |
|---|
| [116] | 24 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.