webERP Forum

Full Version: Z_ChangeStockCode.php deactivates Serialised
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

When I use Z_ChangeStockCode.php to change the item code of controlled and serialized stock items, the process seems to work fine but it de-activates the field serialized (makes it 0 instead of 1)

i.e in the old stock item the field controlled and serialized are both set to yes / yes
after running Z_ChangeStockCode.php the fields controlled and serialized are set to yes / No

The field serialized was missing in the INSERT statement of Z_ChangeStockCode.php
but even when I add it, it still does not work as expected.


Thanks in advance


Arwan
Did you add the field as 'serialized' or 'serialised' (Note the 'z' vs 's' difference in the field name), plus add the same field to the INSERT's SELECT portion too ?

I'll look at this tomorrow, but if the field is added to the insert and select, I don't see where this would have trouble, but you are right that the field is not part of the query.
The query should read:

$sql = "INSERT INTO stockmaster (stockid,
categoryid,
description,
longdescription,
units,
mbflag,
actualcost,
lastcost,
materialcost,
labourcost,
overheadcost,
lowestlevel,
discontinued,
serialised,
controlled,
eoq,
volume,
grossweight,
barcode,
discountcategory,
taxcatid,
decimalplaces,
shrinkfactor,
pansize,
netweight,
perishable,
nextserialno)
SELECT '" . $_POST['NewStockID'] . "',
categoryid,
description,
longdescription,
units,
mbflag,
actualcost,
lastcost,
materialcost,
labourcost,
overheadcost,
lowestlevel,
discontinued,
serialised,
controlled,
eoq,
volume,
grossweight,
barcode,
discountcategory,
taxcatid,
decimalplaces,
shrinkfactor,
pansize,
netweight,
perishable,
nextserialno
FROM stockmaster
WHERE stockid='" . $_POST['OldStockID'] . "'";

Tim
Reference URL's