What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

πŸ‘‹ morning, from what I understand Spryker never updates the stock level, and depends on the ERP

UKGT7RC7P
UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
edited June 2020 in Help

πŸ‘‹ morning, from what I understand Spryker never updates the stock level, and depends on the ERP. But does this mean there is a window where the item is no longer reserved but the stock level remains the same until the next ERP update?

Β«13

Comments

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    I think in this case we should update the stock level accordingly until the level is "normalized" by the ERP ?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited June 2020

    Product should remain in reserved state until the stock update from the ERP.

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    so when we process the stock update we should check to see if there are any reserved items that have a specific state and unreserve them?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    sounds easier to just decrement the stock when we remove the reserved flag?

  • Unknown
    edited June 2020

    conceptually the stock should actually be decremented then

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    I'm not a developer but heard that this should be processed by a State machine. Until the stock update all steps should have reserved flag.

  • ☝

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    but the stock update isn't part of the SM

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    so how would the stock update unreserve items?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    (it's possible to do this, but seems easier to just decrement the stock)

  • there should be a command somewhere, i would agree

  • the unreserve comes from the next state simply missing the flag

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    it's an implciit action?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    or the stock update condition would be triggered by the ERP? (guessing this is an example state machine?)

  • no, the stock reduction should happen during the state transition between the last reserved and the first unreserved state in the screenshot above

  • there should always be a reduction

  • Unknown
    edited June 2020

    from the erp should be mere corrections that we should not rely on here

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    yeah, that's my expectation

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    i guess it is then implicit when the flag is removed

  • β€˜it’ being the un-reservation or the stock reduction?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    the stock reduction

  • No, it's just missing a command iirc

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok, then I'll investigate, thanks πŸ™‚

  • I'll try to have a look later as well

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    As I know and the Feedback I got from you some month ago was, that spryker never touches the stock since this is the job of the erp. Spryker only calculates the availability from stock and product reservations

  • UKU1E0ENB
    UKU1E0ENB Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    You keep the reserved flag even when the order was already exported. This ensures that you don’t oversell any products. You may decreased them twice for a short amount of time but that’s acceptable.

    Some time later you a stock update from WMS which usually contains SKU - QTY Then you trigger the event for those sales-order-items which belong the these SKUs and are exported to WMS already.

  • UKU1E0ENB
    UKU1E0ENB Posts: 34 πŸ§‘πŸ»β€πŸš€ - Cadet

    And yes, you never change the spy_stock table directly by some custom logic. Only stock importer is doing the that, everything else is handled by oms reservations.

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    hm, so the event would remove the reserved flag for all items that are ... ?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    not sure i see the downside of simply decrementing the stock though once the order has been placed / exported

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    (depends on how complicated it is to react on a stock change event)