A patch from Chris Howe : "Allow statusDateTime to be passed to service changeOrderItemStatus" (https://issues.apache.org/jira/browse/OFBIZ-377)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@464136 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -232,6 +232,7 @@ under the License.
|
||||
<attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
|
||||
<attribute name="fromStatusId" type="String" mode="IN" optional="true"/>
|
||||
<attribute name="statusId" type="String" mode="IN" optional="false"/>
|
||||
<attribute name="statusDateTime" type="Timestamp" mode="IN" optional="true"/>
|
||||
</service>
|
||||
|
||||
<service name="cancelOrderItem" engine="java" auth="true"
|
||||
|
||||
@@ -1698,6 +1698,7 @@ public class OrderServices {
|
||||
String orderItemSeqId = (String) context.get("orderItemSeqId");
|
||||
String fromStatusId = (String) context.get("fromStatusId");
|
||||
String statusId = (String) context.get("statusId");
|
||||
Timestamp statusDateTime = (Timestamp) context.get("statusDateTime");
|
||||
Locale locale = (Locale) context.get("locale");
|
||||
|
||||
// check and make sure we have permission to change the order
|
||||
@@ -1757,14 +1758,16 @@ public class OrderServices {
|
||||
|
||||
orderItem.set("statusId", statusId);
|
||||
toBeStored.add(orderItem);
|
||||
|
||||
if (statusDateTime == null){
|
||||
statusDateTime = UtilDateTime.nowTimestamp();
|
||||
}
|
||||
// now create a status change
|
||||
Map changeFields = new HashMap();
|
||||
changeFields.put("orderStatusId", delegator.getNextSeqId("OrderStatus").toString());
|
||||
changeFields.put("statusId", statusId);
|
||||
changeFields.put("orderId", orderId);
|
||||
changeFields.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
|
||||
changeFields.put("statusDatetime", UtilDateTime.nowTimestamp());
|
||||
changeFields.put("statusDatetime", statusDateTime);
|
||||
changeFields.put("statusUserLogin", userLogin.getString("userLoginId"));
|
||||
GenericValue orderStatus = delegator.makeValue("OrderStatus", changeFields);
|
||||
toBeStored.add(orderStatus);
|
||||
|
||||
Reference in New Issue
Block a user