Ignore:
Timestamp:
Oct 29, 2009, 8:30:58 PM (14 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.

Location:
trunk/grails-app/domain
Files:
1 deleted
3 edited
1 moved

Legend:

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

    r146 r175  
    33    InventoryType inventoryType
    44    UnitOfMeasure unitOfMeasure
     5    InventoryLocation inventoryLocation
     6    Period averageDeliveryPeriod
    57    String name
    68    String description = ""
    79    String manufacturersPartNumber
    810    String suppliersPartNumber
     11    Integer unitsInStock = 0
    912    Integer reorderPoint
    1013    Integer recommendedReorderPoint
     
    1619    static hasMany = [alternateItems: InventoryItem,
    1720                                    spareFor: Asset,
    18                                     storedItems: StoredItem,
    1921                                    inventoryMovements: InventoryMovement,
    2022                                    manufacturers: Manufacturer,
     
    2426
    2527    static constraints = {
    26         name(unique:true, blank:false, maxSize:75)
     28        name(unique:true, blank:false, maxSize:50)
    2729        description()
     30        unitsInStock(min:0)
     31        unitOfMeasure()
    2832        reorderPoint()
    2933        enableReorder()
     34        recommendedReorderPoint(nullable:true)
    3035        isActive()
    3136        isObsolete()
    3237        inventoryGroup()
    3338        inventoryType()
    34         unitOfMeasure()
    3539        manufacturersPartNumber(blank:true, nullable:true)
    3640        suppliersPartNumber(blank:true, nullable:true)
    37         recommendedReorderPoint(nullable:true)
    3841        averageDeliveryTime(nullable:true)
     42        averageDeliveryPeriod(nullable:true)
    3943    }
    4044
  • trunk/grails-app/domain/InventoryLocation.groovy

    r162 r175  
    1 class StoreLocation {
     1class InventoryLocation {
    22
    33    InventoryStore inventoryStore
    4     String bin
     4    String name
    55    Boolean isActive = true
    66
    7     static hasMany = [storedItems: StoredItem]
     7    static hasMany = [inventoryItems: InventoryItem]
    88
    9     static belongsTo = [InventoryStore]
     9//     static belongsTo = [InventoryStore]
    1010
    1111    static constraints = {
    12         bin(maxSize:50)
     12        name(maxSize:50)
    1313    }
    1414
    1515    String toString() {
    16         "${this.bin}"
     16        "${this.name}"
    1717    }
    1818}
  • 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}
  • trunk/grails-app/domain/InventoryStore.groovy

    r116 r175  
    66    Boolean isActive = true
    77
    8     static hasMany = [storeLocations: StoreLocation]
     8    static hasMany = [inventoryLocations: InventoryLocation]
    99
    1010    static belongsTo = [Site]
Note: See TracChangeset for help on using the changeset viewer.