Ignore:
Timestamp:
Oct 29, 2009, 8:30:58 PM (15 years ago)
Author:
gav
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/InventoryMovement.groovy

    r146 r175  
     1import java.text.SimpleDateFormat
     2
    13class InventoryMovement {
    24    InventoryItem inventoryItem
    35    InventoryMovementType inventoryMovementType
    46    Task task
    5     String quantity
     7    Integer quantity
    68    Date date = new Date()
    79
    8     static belongsTo = [InventoryItem]
     10//     static belongsTo = [inventoryItem]
    911
    1012    static constraints = {
    1113        inventoryItem()
    12         quantity()
     14        quantity(min:1)
    1315        inventoryMovementType()
    1416        task(nullable:true)
     
    1618    }
    1719
    18     String toString() {"${this.quantity}"}
     20    String toString() {
     21        def date = new SimpleDateFormat("EEE, dd-MMM-yyyy").format(this.date)
     22        "${this.quantity} ${inventoryMovementType.name} on ${date}"
     23    }
    1924}
Note: See TracChangeset for help on using the changeset viewer.