On 10-Aug-09, at 2:24 PM, PCS-Lists wrote:
> I'm helping to build a numeric stock ID format ...
First, let's get some terminology straight, because otherwise you'll
be very confused.
You want to change the stock number (stock_num). This field is also
known as stock code or SKU, depending on your organisation.
You do not want to touch stock ID, which is a system generated field.
> want to use some like this:
> XX.YYY.ZZZZZ where the XX is an ID for categories, YYY is an ID for
> subcategories and ZZZZZ is an ID that specify the items. The first
> part must
> to have only two digits and I only got to put three. Is there a way to
> automate a code like this?
It is possible, you'll have to make some adjustments to add in parent
category.
1. See class.so_perp_stock.inc.php, suggest_stock_number().
You'll have to look up the stock item's category, find the parent
category, and add that into the sprintf.
2. Add your new parameter into class.hook_perp_inventory.inc.php,
around line 137.
When done, you should be able to use this as a stock number format:
%2$02d.%6$03d.%1$05d
After you get it working, please send a diff and I'll add it into SVN.
Nathan Gray
nathan at goarctic dot com
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
Perp-developers mailing list
Perp-developers@...
https://lists.sourceforge.net/lists/listinfo/perp-developers