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:
Jacques Le Roux
2006-10-15 06:02:14 +00:00
parent 23c6bafe37
commit f07047ddda
2 changed files with 6 additions and 2 deletions
@@ -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);