I've problem with the stock. I have ProductA with a stock of 11.
I already debug the AdjustInventoryActivity and the following sum is executed:
inventoryRow1.InStockQuantity = inventoryRow1.InStockQuantity - (lineItemAdjustedQuantity - inventory.ReservedQuantity);
inventoryRow1.InStockQuantity = 11 - (0 - 0);
Why is this happening?
The method GetLineItemAdjustedQuantity does the sum:
num = lineItem.OldQuantity - lineItem.Quantity;
num = 11 - 11;
Is that correct?
Can somebody help me with this problem?
Another problem what I was facing that I couldn't rerun the workflow: OrderGroupWorkflowManager.RunWorkflow(purchaseOrder, OrderGroupWorkflowManager.CartCheckOutWorkflowName);
The first time I run this workflow my custom Payment Provider is redirecting to the payment website. When I'm getting back I want to rerun the workflow, because of two activities (one is the AdjustInventory) aren't excuted, but I'm getting an error that already an instance of the workflow is running. To fix this I created my own workflow with the last two activities:
Dictionary<string, object> strs = new Dictionary<string, object>();strs.Add("OrderGroup", order);WorkflowManager.ExecuteWorkflow("AfterPaymentCheckoutWorkflow", strs, Guid.NewGuid());