class PurchaseOrderNumber {

    PurchaseOrder purchaseOrder

    String value

    static transients = ['description']

    static constraints = {
        purchaseOrder(nullable:true)
    }

    String getDescription() {
        if (!purchaseOrder)
            return "${value} - new"
        else
            return "${value} for ${purchaseOrder.supplier}"
    }
}
