The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

maintaining stocklevels on website

my brain is a bit fried at the moment, so i thought i would try here for some inspiration

my client would like to receive all orders from their website and generate invoices from their offline accounting packages (quickbooks/myob)

they sell a lot of trade stuff as well, which doesn't happen via the website

now to manage stock levels, i was going to write something that gets the data from the offline accounts and updates the website.

so now to the point

if the accounts package says 1000 items instock, and the website says 1000 items instock, and someone on the web purchases an item, the web will now say 999

they haven't entered that sale into their accounts yet, but my app is polling the accounts package and updates the website with the incorrect stock level back to 1000

what is a good strategy/db design that could keep both systems in sync ?

thanks in advance

alex
bumperbox Send private email
Tuesday, June 10, 2008
 
 
How about keeping a "pending" order list?  That way the "pending" + "web" equals the account package?

As long as your counts match then you don't have a problem.
Brian Shipe Send private email
Tuesday, June 10, 2008
 
 
>> what is a good strategy/db design that could keep both systems in sync ? <<

Decide which of the two represents the correct inventory count, and do all updates thru it. 

Unless the inventory is partitioned in some fashion, trying to have both systems manage it is an exercise in futility -- it will *never* be right.
xampl
Tuesday, June 10, 2008
 
 
Do it like the credit card companies do it: "Inventory" (acc'tg package # / available balance) - "Pending" (un-invoiced sales / preauthorisations) = "Available" (current available balance). 

Pretty much what Brian suggested but a different logical order.

On issuance of an invoice or other adjustment (the non-Web activity), update the "Inventory" number and "Available" will follow naturally.  Validate new orders against "Available".

Putting an order on hold or changing the order of fulfillment means minor tweaks to the "Pending" staus handling and should keep your "Available" number reasonably accurate.  My personal preference would be to calculate it always, but depending on activity, storing it in a field updated by *any and all* other order activity might be OK.
a former big-fiver Send private email
Tuesday, June 10, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz