Improved: no functional changes, simply formatting
* under the License.
*/
-import java.math.BigDecimal
-import java.util.*
import java.sql.Timestamp
+
+import org.apache.ofbiz.accounting.payment.PaymentWorker
+import org.apache.ofbiz.base.util.UtilMisc
import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.condition.EntityCondition
import org.apache.ofbiz.entity.condition.EntityOperator
import org.apache.ofbiz.entity.util.EntityUtil
-import org.apache.ofbiz.base.util.UtilMisc
-import org.apache.ofbiz.base.util.UtilValidate
import org.apache.ofbiz.order.order.OrderReadHelper
-import org.apache.ofbiz.party.contact.ContactMechWorker
import org.apache.ofbiz.party.contact.ContactHelper
-import org.apache.ofbiz.product.inventory.InventoryWorker
+import org.apache.ofbiz.party.contact.ContactMechWorker
import org.apache.ofbiz.product.catalog.CatalogWorker
+import org.apache.ofbiz.product.inventory.InventoryWorker
import org.apache.ofbiz.product.store.ProductStoreWorker
-import org.apache.ofbiz.accounting.payment.PaymentWorker
orderId = parameters.orderId
context.orderId = orderId
@@ -60,7 +58,11 @@ comments = null
if (orderId) {
orderHeader = from('OrderHeader').where('orderId', orderId).queryOne()
- comments = select("orderItemSeqId", "changeComments", "changeDatetime", "changeUserLogin").from("OrderItemChange").where(UtilMisc.toList(EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId))).orderBy("-changeDatetime").queryList()
+ comments = select("orderItemSeqId", "changeComments", "changeDatetime", "changeUserLogin")
+ .from("OrderItemChange")
+ .where(UtilMisc.toList(EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId)))
+ .orderBy("-changeDatetime")
+ .queryList()
}
if (orderHeader) {
@@ -152,7 +154,10 @@ if (orderHeader) {
allShipmentsMap[primaryShipment.shipmentId] = primaryShipment
}
itemIssuancesPerItem = [:]
- itemIssuances = orderHeader.getRelated("ItemIssuance", null, ["shipmentId", "shipmentItemSeqId"], false)
+ itemIssuances = orderHeader.getRelated("ItemIssuance", null, [
+ "shipmentId",
+ "shipmentItemSeqId"
+ ], false)
itemIssuances.each { itemIssuance ->
if (!allShipmentsMap.containsKey(itemIssuance.shipmentId)) {
iiShipment = itemIssuance.getRelatedOne("Shipment", false)
@@ -177,7 +182,8 @@ if (orderHeader) {
ecl = EntityCondition.makeCondition([
EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId),
- EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")],
+ EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")
+ ],
EntityOperator.AND)
orderPaymentPreferences = from("OrderPaymentPreference").where(ecl).queryList()
context.orderPaymentPreferences = orderPaymentPreferences
