Trying to add an existing item (even selected from autocomplete) results in item not being added to the list (without any error message).
Leaving "Stock Code" field empty results in adding random item to the list and "Invalid stock code" error message on form submission.
Bug occurs if "Stock Code" field value doesn't contain a colon.

CommentFileSizeAuthor
#1 erp_item.module.patch241 bytesskremiec
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

skremiec’s picture

FileSize
241 bytes

Patch fixing this issue in attachment.
No colon in $dest argument for erp_item_desc_breakup function resulted in trimming last char from $code producing invalid stock code.

singularo’s picture

Status: Active » Fixed

You should not need this patch, its an indication that something is not setup correctly.

This is probably as you have not created a "suppler", or if you have, the product is not associated with a supplier, as the colon is used to filter by supplier.

First, check what suppliers you have by visiting xxxx.com/erp/suppliers If you dont have any, use xxxx.com/node/add/erp-supplier (you will need to be admin user for this, std staff can't add users with default erp permissions).

Next, visit xxxx.com/erp/item and find your item and edit it. Ensure that the Supplier autocomplete field is filled in, even if you just use "Internal" or your own company name or something as the supplier.

A valid code when quoting/invoicing/purchase orders/goods receiving will look like this:

7:SMSWIN7-HP-R

the 7 is the supplier "id". The colon is just a seperator, and the code is the rest.

You can type

7:
or
shortname:

If the supplier has the "shortname" field setup to get a list of all items available from that particular supplier (in your case, it should probably be 1:

If you are using stock tracking, you can do things like

7:@win hp

To list all items containing the strings "win hp" from supplier id 7, regardless of stock status.

So, you can also use the shortname like that as well.

shortname:@win hp

HTH

Simon

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.