cal.add(Calendar.DAY_OF_YEAR, daysTillCancel);
Date cancelDate = cal.getTime();
Date nowDate = new Date();
//Debug.logInfo("Cancel Date : " + cancelDate, module);
//Debug.logInfo("Current Date : " + nowDate, module);
if (cancelDate.equals(nowDate) || nowDate.after(cancelDate)) {
// cancel the order item(s)
Map<String, Object> svcCtx = UtilMisc.<String, Object>toMap("orderId", orderId, "statusId", "ITEM_CANCELLED", "userLogin", userLogin);
try {
// TODO: looks like result is ignored here, but we should be looking for errors
dispatcher.runSync("changeOrderItemStatus", svcCtx);