Topic: Bug in Inventory Item Cost Update

When setting a new cost, all items updates to the new cost.

Also, not all items show in the drop-list.
Seems to list with 1 in offset.

Using latest cvs update from this afternoon.

/Rikard

Re: Bug in Inventory Item Cost Update

Hi Rikard,

rini wrote:

When setting a new cost, all items updates to the new cost.

This is not a bug, this is a feature. On the cost update page you have ability to adjust current stock items value, normally calculated as weighted average for qoh and received quantity on every purchase.

rini wrote:

Also, not all items show in the drop-list.
Seems to list with 1 in offset.

Yes, dummy items as services are not physical items and therefore are not included in selector list. You cannot adjust inventory value for dummy items because they have no inventory quantities.

Janusz

3 (edited by rini 04/09/2008 03:20:00 pm)

Re: Bug in Inventory Item Cost Update

Hi

I wasn't aware about the update-thingie but it's clear now.

For the droplist however, view the sql-dump below:

+------------+-------------+------------------------+-------+
| stock_id   | category_id | description            | units |
+------------+-------------+------------------------+-------+
| DPD16_10   |           5 | Företagspaket 16 10kg | st    |
| DPD16_3    |           5 | Företagspaket 16 3kg  | st    |
| DPD16_35   |           5 | Företagspaket 16 35kg | st    |
| DPD16_5    |           5 | Företagspaket 16 5kg  | st    |
| DPD16_7    |           5 | Företagspaket 16 7kg  | st    |
| IX67PH2    |           6 | Intertex 67 PH2        | st    |
| IX67PH2AIR |           6 | Intertex 67 PH2 Air    | st    |
| PP10       |           5 | Postpaket 10kg         | st    |
| PP20       |           5 | Postpaket 20kg         | st    |
| PP3        |           5 | Postpaket 3kg          | st    |
| PP5        |           5 | Postpaket 5kg          | st    |
| PP7        |           5 | Postpaket 7kg          | st    |
+------------+-------------+------------------------+-------+

with the source from the droplist:

<option value='IX67PH2'>Hårdvara&nbsp;-&nbsp;Intertex 67 PH2</option>
<option value='IX67PH2AIR'>Hårdvara&nbsp;-&nbsp;Intertex 67 PH2 Air</option>
<option value='DPD16_10'>Frakt&nbsp;-&nbsp;Företagspaket 16 10kg</option>
<option value='DPD16_3'>Frakt&nbsp;-&nbsp;Företagspaket 16 3kg</option>
<option value='DPD16_35'>Frakt&nbsp;-&nbsp;Företagspaket 16 35kg</option>
<option value='DPD16_5'>Frakt&nbsp;-&nbsp;Företagspaket 16 5kg</option>
<option value='DPD16_7'>Frakt&nbsp;-&nbsp;Företagspaket 16 7kg</option>
<option value='PP10'>Frakt&nbsp;-&nbsp;Postpaket 10kg</option>
<option value='PP20'>Frakt&nbsp;-&nbsp;Postpaket 20kg</option>
<option value='PP5'>Frakt&nbsp;-&nbsp;Postpaket 5kg</option>
<option selected value='PP7'>Frakt&nbsp;-&nbsp;Postpaket 7kg</option>

As you can see i don't get the PP3 in the drop-list, while it's in the DB.

It seems it skips one row when creating the drop-list.
PP3 was the first new item to be added.

EDIT: Perhaps freight is a service ans not something purcharged. I got it as purcharged in this setup tho.

/EDIT

Re: Bug in Inventory Item Cost Update

Well, I cannot reply the issue on my own data set, so only way to track it is to make some test with your kind support.

If you have some time and really want to found the bug we can go this way:

The item droplist is created in function stock_costable_items_list() in file /include/ui/ui_lists.php. When you put into line 996 the following call:

  echo $sql;

you will notice something like:

SELECT stock_id, 0_stock_master.description, 0_stock_category.description
 FROM 0_stock_master,0_stock_category 
WHERE 0_stock_master.category_id=0_stock_category.category_id 
AND mb_flag !='D'

on the screen.

This is exactly the sql phrase which is used to create the item list. Now you can copy-paste this from FA  page into PhpMyAdmin SQL box and execute.
If sql query result would differ from the the selector content we would have to dig deeper to find source of troubles.

Janusz

Re: Bug in Inventory Item Cost Update

Hi and thanks,

SQL echoed is

SELECT stock_id, 0_stock_master.description, 0_stock_category.description FROM 0_stock_master,0_stock_category WHERE 0_stock_master.category_id=0_stock_category.category_id AND mb_flag !='D'

And the resultset from phpmyadmin is:

stock_id description description
IX67PH2 Intertex 67 PH2 HÃ¥rdvara
IX67PH2AIR Intertex 67 PH2 Air HÃ¥rdvara
DPD16_10 Företagspaket 16 10kg Frakt
DPD16_3 Företagspaket 16 3kg Frakt
DPD16_35 Företagspaket 16 35kg Frakt
DPD16_5 Företagspaket 16 5kg Frakt
DPD16_7 Företagspaket 16 7kg Frakt
PP10 Postpaket 10kg Frakt
PP20 Postpaket 20kg Frakt
PP5 Postpaket 5kg Frakt
PP7 Postpaket 7kg Frakt

What i did to the inventory is a deleted everything from the webgui, and then inputed my own stuff.

Is there anything else i can post or extract to make debugging easier?

I'm running latest cvs version.

/Rikard

Re: Bug in Inventory Item Cost Update

Hello

Hmm, the sql result is ok, the procedure creating selector from the query is straight forward and I can see nothing what can cause skipping of some options.

Are you sure that when editing PP3 in Items&Inventory/Items you have set item type for PP3 to Purchased or Manufactured and not Service ?

Janusz

Re: Bug in Inventory Item Cost Update

I think so.

I sent you pm with url and login to my setup.
There is no live data in the current setup so you can't break anything smile

/Rikard

8 (edited by rini 04/10/2008 12:13:47 pm)

Re: Bug in Inventory Item Cost Update

I seem to have found something.

The first item, the PP3, seems to have status D (service) in the db, but i'm almost sure i set it up as a purcharge.

I'll make a item-table-dump and try to add a "first" item again to see if there is in fact a bug or user error smile


EDIT:
Seems to be user error this time.
Sorry for the fuzz.
/EDIT

/Rikard

Re: Bug in Inventory Item Cost Update

No bug is no problem wink.

BTW. To avoid troubles you should have exactly one tax type definition with Tax Shipping option set to on.

Janusz