if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {
// add an adjusting InventoryItemDetail so set ATP back to QOH: ATP = ATP + (QOH - ATP), diff = QOH - ATP
BigDecimal atp = inventoryItem.get("availableToPromiseTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("availableToPromiseTotal");
BigDecimal qoh = inventoryItem.get("quantityOnHandTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("quantityOnHandTotal");
Map<String, Object> createDetailMap = UtilMisc.toMap("availableToPromiseDiff", qoh.subtract(atp),
"inventoryItemId", inventoryItem.get("inventoryItemId"), "userLogin", userLogin);
try {
Map<String, Object> result = dctx.getDispatcher().runSync("createInventoryItemDetail", createDetailMap);
if (ServiceUtil.isError(result)) {
return ServiceUtil.returnError("Inventory Item Detail create problem in complete inventory transfer", null, null, result);