Changeset 726


Ignore:
Timestamp:
Nov 28, 2010, 12:19:28 PM (9 years ago)
Author:
gav
Message:

Possible domain change, due to new min (reorderQuantity no longer nullable) and max (suppliersPartNumber) values on InventoryItem.

File:
1 edited

Legend:

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

    r720 r726  
    1313    String suppliersPartNumber
    1414    Integer unitsInStock = 0
    15     Integer reorderPoint
    16     Integer reorderQuantity
     15    Integer reorderPoint = 0
     16    Integer reorderQuantity = 1
    1717    boolean isActive = true
    1818    boolean isObsolete = false
     
    3636        unitsInStock(min:0)
    3737        unitOfMeasure()
     38        inventoryLocation()
     39        inventoryGroup()
     40        inventoryType()
     41        isActive()
     42        isObsolete()
     43        enableReorderListing()
     44        reorderPoint(min:0)
     45        reorderQuantity(min:1)
    3846        estimatedUnitPriceAmount(nullable:true, max: new BigDecimal(1000000000000))
    3947        estimatedUnitPriceCurrency(nullable:true)
    40         reorderPoint()
    41         enableReorderListing()
    42         reorderQuantity(nullable:true)
    43         isActive()
    44         isObsolete()
    45         inventoryGroup()
    46         inventoryType()
    47         suppliersPartNumber(blank:true, nullable:true)
     48        suppliersPartNumber(blank:true, nullable:true, maxSize:50)
    4849        preferredSupplier(nullable:true)
    4950    }
     
    5960    }
    6061
     62    //  This additional setter is used to convert the checkBoxList string or string array
     63    //  of ids selected to the corresponding domain objects.
     64    public void setAlternateSuppliersFromCheckBoxList(ids) {
     65        def idList = []
     66        if(ids instanceof String) {
     67                if(ids.isInteger())
     68                    idList << ids.toLong()
     69        }
     70        else {
     71            ids.each() {
     72                if(it.isInteger())
     73                    idList << it.toLong()
     74            }
     75        }
     76        this.alternateSuppliers = idList.collect { Supplier.get( it ) }
     77    }
     78
     79    //  This additional setter is used to convert the checkBoxList string or string array
     80    //  of ids selected to the corresponding domain objects.
     81    public void setSpareForFromCheckBoxList(ids) {
     82        def idList = []
     83        if(ids instanceof String) {
     84                if(ids.isInteger())
     85                    idList << ids.toLong()
     86        }
     87        else {
     88            ids.each() {
     89                if(it.isInteger())
     90                    idList << it.toLong()
     91            }
     92        }
     93        this.spareFor = idList.collect { Asset.get( it ) }
     94    }
     95
    6196}
Note: See TracChangeset for help on using the changeset viewer.