Calculating Inventory Items to increase or decrease stock

Comments

3 comments

  • Rainer Grabowski

    Hi Ashley,

    this should work in the calculation field Inventory:

    var cat = @All of Enter Action;
    var q = @All of Quantity;
    var sum = 0;
    for(var i = 0; i < cat.length; i++){
    var num = cat[i] == "Outgoing Stock" ? q[i] * -1 : q[i];
    sum += q[i] || 0;
    };
    sum 

    Rainer

    0
    Comment actions Permalink
  • Samuel Santosh Wesley

    Hi Rainer Grabowski,

    Thank you for the formula. I tried this formula for a book store stock room. It seems to only add new stock but not deduct "Outgoing Stock". I may be doing something wrong. Could you please help?

    Thanks,

    Samuel

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Samuel,
    can you please paste your calculation code here and also add a screenshot where I can see the Quantity field and the category field?
    Rainer

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk