webERP Forum
Z_ChangeStockCode.php deactivates Serialised - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Z_ChangeStockCode.php deactivates Serialised (/showthread.php?tid=2574)



Z_ChangeStockCode.php deactivates Serialised - R2-G - 09-17-2015 01:44 AM

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


RE: Z_ChangeStockCode.php deactivates Serialised - TurboPT - 09-20-2015 01:44 PM

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.


RE: Z_ChangeStockCode.php deactivates Serialised - falkoner - 09-20-2015 05:48 PM

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