1 (edited by bharatthakkar 04/26/2009 06:24:28 am)

Topic: Item Code - StockID - Generate Online

I want to generate Stock ID / Item Code Automatically based on Category Id, and Item Name (description Field) entered by user instantly, probably with Ajax implementation or with Javascript. Can anybody help ? I am also working on it.

Can anyone have Ajax or Javascript implementation to online update of any field in FrontAccounting ? 

Thanks

Re: Item Code - StockID - Generate Online

I'm not sure what do you exactly want, but FA has category/item description ajax search already implemented. If you want to use ajax search feature check 'Search Item List' in company setup. Then when you enter part of description/item name in item code box on slaes order page, the item list is filled with result of search on items table.
Janusz

3 (edited by bharatthakkar 04/27/2009 03:08:34 pm)

Re: Item Code - StockID - Generate Online

Hi,

What I want is not search facility, but Item code Generation when I enter New Item. I want Item Code Generation Based on Category ID and Item Name, So I want some Javascript Code attached to Item Code Field which at the time of New Item entry Generates Item Code based on Category ID and Item Name as stated above.

-----------
Suppose I want to generate Item Code as follow

    NNNN ANNNN NNN


NNNN : First set of 4 Characters Sub-Category ID / Category ID (Numerals with leading zero i.e for 1 it is 0001)

ANNNN : Second set is having first Character Alphabet (Usually first character of Item Name), next 4 characters are Item ID (Numerals with leading zero as above)

NNN : Third set of 3 Characters Customer ID (Numerals with leading zero as above)

e.g.

category 1, Sub-Category 2, Candle with Item Code 9 No Customer specific

0002C0009000
----------


Regards

bharatthakkar

Re: Item Code - StockID - Generate Online

Look into items.php code. Here you can find how to update some elements of items page on different events. For example in line 36-41 you will find update of details and control areas after stock_id selector change. All available ajax functions you will find in Ajax class in file ajax.inc. You can call them in any place on the page accessing global $Ajax object. See into another php files to learn how it is can be used.
Janusz

Re: Item Code - StockID - Generate Online

Hi,

Thanks a lot, I implemented it successfully. Thanks for your valuable hints.

I email you two files having changes.

Regards

bharatthakkar

Re: Item Code - StockID - Generate Online

Thank you, bharatthakkar . This extension is very specific, so we will not include it in core source for now, but I'll store it in case somebody else would be interested in this.
What FA version was choosen as a base for your changes?

Janusz

Re: Item Code - StockID - Generate Online

Hi, Janusz, yes this extension is very specific. but this useful for those who require rule based SKU.
I used version 2.0, I am now converting it for version 2.2.

bharatthakkar

Re: Item Code - StockID - Generate Online

hi Janusz & bharatthakkar,
This is Ram from indonesia. I am having the same requirement regarding stockid. would you mind mailing those files to me. Thanks in advance.

My email id is tyrram@gmail.com

With best Regards,
Ram

Re: Item Code - StockID - Generate Online

hi Janusz & bharatthakkar, can u sent me the extension plz.

nucreativa@gmail.com

Ary Wibowo