Need to build my own CheckStock

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
wilhud
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Mar 30, 2009 7:44 pm

Need to build my own CheckStock

Post by wilhud » Fri Oct 15, 2010 3:58 pm

I need to build my own custom CheckStock because the AbleCommerce CheckStock does not take into account what is currently on order. It functions as such...

CheckStock(Sku w/o Variant) = Sku's InStock #
CheckStock(Sku w/ Variant) = Variant's InStock #

Our system/database calculates and stores a separate field for Allocated, which is the quantity of an item that is already on order. We do not DeStock items prior to shipping them. DeStocking only occurs once the items have been shipped. Therefore, when we pull those CheckStock values, it returns the quantity of an item that is In Stock but does not account for those already assigned to orders. This is a big deal for us because when customers go to purchase items, they appear to be In Stock, when in reality they may not be. What I need to do is have our CheckStock work as such...

CheckStockMod(Sku w/o Variant) = Sku's InStock # - Sku's Allocated #
CheckStockMod(Sku w/ Variant) = Variant's InStock # - Variant's Allocated #

I can build the query to get the proper Allocated values, but was wondering if someone can point me in the right direction for where I should place my function so that it is accessible by all the areas needed and what other things CheckStock may take into account that I should be aware of. Is there maybe a breakdown somewhere of what CheckStock's code looks like?

Or, if I am mistaken and there is a way to have CheckStock take into account the # of items that are currently on order, then that would solve my problem 100%. If anyone knows of something like that, please let me know.

Thanks,
Wil

wilhud
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Mar 30, 2009 7:44 pm

Re: Need to build my own CheckStock

Post by wilhud » Fri Oct 15, 2010 4:23 pm

Looking through old posts, I see there was something on AbleCommerce 5 called ReserveStock. Was this the same as what I am calling Allocated? Basically a value calculating the number of units for each sku that are already assigned to orders. If that's what ReserveStock is/was, then is there an equivalent in AC7? This would help me out greatly, if so.

Thanks,
Wil

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Need to build my own CheckStock

Post by mazhar » Mon Oct 18, 2010 4:23 am

You have to do your custom function with appropriate query to accomplish this. You can either create a new Class file under Website/App_Code folder or you can simply put your custom function in App_Code/ProductHelper.cs file. You will be then able to use it within website anywhere simply by using something like

Code: Select all

ClassName.FunctionName(); 

wilhud
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Mon Mar 30, 2009 7:44 pm

Re: Need to build my own CheckStock

Post by wilhud » Fri Oct 22, 2010 10:42 am

Hi Mazhar,

Thanks for the info. I've decided to stick with AbleCommerce's inventory management setup and just modify our backend to work better with their system. As a result, I'm going to DeStock as soon as the order is placed. However, orders that we currently have in the system have not been DeStocked because our current system does not do that until the order is completed. So my questions now are...

1. If we add the DeStock option to the Order Placed status, should we then go into the system and move all current orders that have not yet shipped into Order Placed status so that it triggers the DeStocking? Then we can just move them back to whatever status they were in at the time.

2. When we add the DeStock option to the Order Placed status, should it be applied to all statuses after Order Placed as well? For example, Shipment Pending. That way, in case the order somehow skips a status, the next status has a chance of DeStocking. Or should we not do that since every order should have to go through OrderPlaced to even get into the system?

I want to make this as clean as possible, so our inventory is finally informing the customers of the proper in stock levels. We show them whether something is available or not, but right now, since InStock does not account for items that have not shipped yet, we're overstating the amount of inventory. DeStocking as soon as an order is placed should solve that, but I just want to be careful since inventory numbers need to be as accurate as possible for our upcoming heavy Holiday season.

Thanks,
Wil

Post Reply