Strange stock update

Vote:
 

Hi!


I've problem with the stock. I have  ProductA with a stock of 11.

  • If I order ProductA with quantity of 11, the stock isn't updated.
  • If I order Product A with quantity of 10, the stock got a new value of 12???

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?


Thanks Patrick

#70610
Apr 24, 2013 11:44
Vote:
 

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());

#70611
Apr 24, 2013 11:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.