Extend Magento inventory management

Magento inventory management is very basic – only an Inventory Qty figure. Strictly speaking, it is not an “in-stock” figure, but an “orderable”. Because orders keep coming in but you only do despatch once a day, Magento inventory quantity changes upon order is placed online, so you can not tell how many pieces of a product sitting in the warehouse.

Use only one figure to manage inventory is not enough. Imagine this scenario:
You are doing stocktake someday. At the time of last despatch, Magento inventory quantity of product X is 100. Stocktaking takes many hours, and when it finishes, Magento inventory quantity has changed to 80. If you physically count product X as 95, you can not simply update Magento inventory figure to be 95. Instead you should change it to 75 (worked out as 80 – 100 + 95). It is very easy to make such mistakes in stocktaking, but I have only Magento to blame – if stocktaking is based on a figure which is changing from time to time, it is not rock solid.

However, I am not thinking of introducing a 3rd party inventory management system to work with Magento, largely because I do not know which one can fit.

I am thinking of a simple extension to Magento – use 3 figures to show stock level from different concerts. Let’s clarify the terminology first.
Figure 1: inventory orderable, i.e. the existing Magento Inventory Qty;
Figure 2: inventory in-stock, i.e. how many pieces in the warehouse;
Figure 3: inventory coming, i.e. expected purchase.

  • When an order is placed, decrease inventory orderable
  • When an order is despatched, decrease inventory in-stock
  • When an order is cancelled before despatch, increase inventory orderable
  • When an order is cancelled after despatch, do nothing (some companies raise RMA at this point but we do not need it.)
  • When an order is returned, if goods in good condition, increase inventory orderable, and increase inventory in-stock
  • When a purchase order is placed (by us to our supplier), increase inventory coming
  • When a purchase order arrives, decrease inventory coming, increase inventory orderable, and increase inventory in-stock
  • When stocktake begins, snapshot inventory in-stock as inventory1
  • When stocktake ends, update inventory in-stock to inventory2, and add (inventory2 – inventory1) to inventory orderable

If all above events are logged, we have a kind of traceability. The log gives some clue to analyse where “inventory2 – inventory1” is from.

In case a customer asks “how many you have? I take them all”, we tell him/her inventory orderable.

In case we need find out “how many on hold (for late despatch)”, we use the balance between inventory orderable and inventory in-stock.

Inventory orderable (figure 1) is built-in with Magento. Inventory coming (figure 3) is not essential to stock control. We can introduce it after we have implemented inventory in-stock (figure 2).

负负得正

“负负得正”的英文该怎么说?Two negatives make a positive?

今天我整理供应商价格表倒发现了一个负负得正的有趣事。我们供应商的单价是随数量增加而递减的,而不知怎么搞的,数据录入时,25,000 数量那一行的单价错了,比20,000 数量那一行的单价还贵。而我们的售价是成本加成利润。理论上,错误的供应商的单价反向浮动会体现在我们的售价上。

可事实上,我们的售价一直随数量递减,并未在25,000那一行出现肉眼可见的错误。

于是,我逐行分析了程序,发现原意想让数量比较时 >= 条件成立跳出循环,却打成了 >。这样,20,000 再执行一次 + 5,000 的数量仍在循环之内,于是在 25,000 数量时,仍使用了20,000 的单价(因为两种情况下,后者总价低,程序另有各种情况下自动取最低值的算法)。也就是说,25,000 数量那一行的错误单价没有机会生效。

所以,我们的售价表未现反向浮动,但只有我心里知道,25,000 那一行的售价报高了。汗!

How to evaluate stock value

我在思考一个财务上的问题:

Euro-bags 公司每月初做一次库存盘点。1月初库存盘点,其中产品无纺布袋100箱,当时的生产成本为 £21/箱。库存盘点后,公司陆续生产了三批同型号产品无纺布袋,每批的数量和生产成本分别是

  • 200箱,£22/箱
  • 300箱,£20/箱
  • 200箱,£23/箱

1月份,公司销售了550箱,理论上库存为250箱。但2月初,库存盘点显示无纺布袋260箱(理论库存与实际库存不一致的情况经常发生,否则也没必要作库存盘点)。

问:

  • 2月初库存报告中的无纺布袋价值是多少?
  • 建议采用什么模型确定库存商品的单价?是统一单价,还是区别单价?
  • 统一单价的话,应用先进先出呢还是后进先出?
  • 区别单价的话,损益的数量该如何定价?

Argos sent me two head boards of a bed

我从 Argos 订购了一张木床,奢侈了一回。可是今天 Argos 送货来,发现其中有两块床头板,竟然没有床尾板!

床是可以装配起来的,但看起来怪怪的。当初可是看中它漂亮的床尾板才买的,于是我越想越不服气,给 Argos customer serivce 写了封信,考验一下他们的售后服务。

Hi,

I received my order today. Thank you very much.

However, it does NOT match the photo and the description of the product on your website. Your photo shows the foot board very nice, and description says “Features foot board with rail end”, but in the pack I received, there are only two head boards (no foot board). Although I can assemble one head board as foot board, the bed looks strange.

I would like to know it is an error in your fulfillment or an error of mis-describing your product on the website. Many thanks for your help.

A dishonest colleague

经济危机袭来,俺老板玩了个金蝉脱壳。公司改头换面,解雇了几个同事,缩小规模继续经营。原公司有一个paypal帐号,原来不是main payment service provider,也不经常用,里面剩有小量余额。

我的一个原同事负责日常操作这些payment service providers,被解雇后他以为没人留意这个paypal帐号,观察了2个月后终于动手把余额转到他的个人账户里去了,并把这个paypal帐号给关闭了。

其实,这并不是一个被遗忘的角落,只是新老公司交替,大家杂务缠身,没及时去处理若干小事。今天,我正准备把这点余额移交给清算公司,发现paypal帐号无法登录了,折腾了好久终于跟paypal的客户服务通上话。(BTW,paypal的电话客服系统很糟糕,它首先假设用户都是不会使用internet的新手,各道语音菜单总是提示用户去上www.paypal.co.uk。我和另一个同事挂了不下10通电话才和电话那头的活人通上话。)

当了解到原同事竟然私转余额后,我对英国人的诚信度又有了新的认识。大概老板对此也会有新的认识,以前人事交替从来没有更改系统密码的要求,不知以后在这方面得到加强。

我也该检讨一下,前段时间我注意到这个paypal一次非正常登录记录,当时我以为我记忆出错(现在看来我记性还是不错的),不过我没上心主要是认为英国人不会为这点小钱犯出性质严重的错误(这个帐号受清算公司监管,所以这个事件不再是公司内部事务)。现在还不知道这事会怎么处理。

Managing Innovation

上大学有门课,叫Managing Innovation,是University of Brighton的教授来上的。这门课太深奥,我从来没听懂过。今天凑巧看到老板也在看managing innovation的讲义(不奇怪,他是University of Brighton某小组成员),难道managing innovation能拯救危机?

英国人挺喜欢把innovation挂在口头,但我总觉得managing innovation可操作太弱,我喜欢step by step的东西。

老板不了解下属的工作量是种悲哀

金融危机袭来,公司的业务摇摇欲坠。老板收缩战线,解雇了几个人,暂时认为我比较重要,留下了。我倒没多想,先干着呗。

但是事情总要有人做啊,老板亲自上阵,做我同事原来做的事情。今天盘点库存,盘点完毕入账的时候,他花了6个小时还没完成老同事2个小时就能完成的收入工作。最后老板感慨,这输入原来要花那么多时间啊。我说,除非你投资一套条码设备,否则这时间能省下来吗?

老板无语,然后他又开始怀疑老同事是否真能这么快完成输入。我无语,其实我也干过这活,也就2个小时的工作量吧,但这是建立在我熟记产品代码和产品名称的实践经验基础上的。

我并不是建议老板们都来做做下属的工作(专业分工嘛),但老板如果以为下属的工作都那么好做的话,那是种悲哀——下属的悲哀,更是老板的悲哀。

6 sigma

闲来无事的时候我听听six sigma (6 Σ)的讲座,初听尚不能把握6 Σ精髓所在。但至少有两点感悟:

  1. 对产品质量要求越高,并不一定带来更高生产成本。看来以前我都陷入了高成本才有高质量的思维定势。
  2. 主动的和被动的,最准确的英文翻译为proactive和reactive。可在一般的英中和中英字典里都查不到这样的翻译。