Skip to content

Commit

Permalink
fixed #63: Packing list import tool updates existing shipment items i…
Browse files Browse the repository at this point in the history
…n other shipments when pallet name is not provided
  • Loading branch information
jmiranda committed May 11, 2015
1 parent 75e986d commit 76933fa
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions grails-app/domain/org/pih/warehouse/shipping/Shipment.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,21 @@ class Shipment implements Comparable, Serializable {
return pallet
}

ShipmentItem findShipmentItem(InventoryItem inventoryItem, Container container) {
ShipmentItem shipmentItem = ShipmentItem.withCriteria(uniqueResult: true) {
eq('shipment', this)
if (container) {
eq('container', container)
}
else {
isNull('container')
}
eq('inventoryItem', inventoryItem)
}
return shipmentItem
}


Collection findShipmentItemsByContainer(container) {
return ShipmentItem?.findAllByShipmentAndContainer(this, container)
}
Expand Down Expand Up @@ -437,10 +452,6 @@ class Shipment implements Comparable, Serializable {
return null
}

ShipmentItem findShipmentItem(InventoryItem inventoryItem, Container container) {
return ShipmentItem.findByInventoryItemAndContainer(inventoryItem, container)
}

Date dateScheduled() {
Event event = events.find { Event event -> event?.eventType?.eventCode == EventCode.SCHEDULED }
return event?.eventDate ?: dateCreated
Expand Down

0 comments on commit 76933fa

Please sign in to comment.