[ic] notificateion to admin on low stock

Ed LaFrance interchange-users@interchange.redhat.com
Thu May 16 11:48:00 2002


At 03:38 PM 5/16/2002 +0200, you wrote:
>Hallo
>
>I need as a shop administrator to receive notifications on low stock.
>I need to know when a special item drops below a certain amount, so we can
>order that item in time.
>
>Any help or hints would be greatly apreciated !!
>
>Thank you

How would you determine low? Perhaps you add a field to the inventory table 
called 'reorder', and populate it with the reorder point for each item. The 
you could do this in etc/log_transaction:

[comment] existing code in etc/log_transaction [/comment]
[if variable DECREMENT_INVENTORY]Inventory of [item-code] now:
         [data
                 table=inventory
                 col=quantity
                 key="[item-code]"
                 increment=1
                 value="-[item-quantity]"
         ]

         [comment] new code starts here...  [/comment]

         [tmp on_hand][item-data inventory quantity][/tmp]
         [if type=scratch term=on_hand op="<=" compare="[item-data 
inventory reorder]"]
                 [email
                 to="stockmaster@yoursite.com"
                 subject="Low stock notice for item [item-code]"
                 reply="admin@yoursite.com"
                 from="webmaster@yoursite.com"
                 extra=""
                 hide=1
                 ]
                 Time to restock item [item-code].
                 Current on-hand: [item-data inventory quantity]
                 [/email]
         [/if]

         [comment] new code ends here.... [/comment]
[/if]


- Ed L.


===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================