Move Inventory

> doITQ("nTrans={$_REQUEST['transNum']}&opCode=TRS", $_REQUEST['addItem']); sqlUpdate("inventory", "transfer='{$_REQUEST['transNum']}'", "tid='{$_REQUEST['addItem']}'"); } if (!empty($_REQUEST['newLocation'])) { debugDump($_REQUEST['tranInc'], "tranInc"); if (count($_REQUEST['tranInc'])) { if ($_REQUEST['newLocation'] == "STOCK" and $_SESSION['instance']['STOCKROOM_IS_BLACKHOLE']) $sof = "RTS"; else $sof = ""; foreach($_REQUEST['tranInc'] as $tid) { //=>> $r = doITQ("nLocation={$_REQUEST['newLocation']}&opCode=TRF&nTrans=", $tid); sqlUpdate("inventory", "iloc='{$_REQUEST['newLocation']}', transfer='', sof='$sof'", "tid='$tid'"); echo "\n"; } } // remove all the rest of the transfer reserved (that weren't actually moved) from the transfer $transList = mysql_query("select * from inventory where transfer='{$_REQUEST['transNum']}'", $mLink); while ($trans = mysql_fetch_assoc($transList)) { //=>> doITQ("opCode=TUR&nTrans=", $trans['tid']); sqlUpdate("inventory", "transfer=''", "tid='{$trans['tid']}'"); } sqlUpdate("itrans", "status='1'", "tid='{$_REQUEST['transNum']}'"); unset($_REQUEST['newLocation']); unset($_REQUEST['transNum']); } if ($_REQUEST['transNum'] == "NEW") { $r = sqlInsert("itrans", "status=''"); $_REQUEST['transNum'] = $r['t']; } // get a list of all open transfers - include option to create a new one $transList = sqlSelect("itrans", "status=''"); echo "Transfer
\n"; if (!empty($_REQUEST['transNum'])) { $q = "select inventory.*,idesc.vend, idesc.vsn,idesc.description,iloc.description as ldesc from inventory, idesc,iloc where inventory.item=idesc.tid and inventory.iloc=iloc.shortname and transfer='{$_REQUEST['transNum']}' order by item,iloc"; echo "\n"; $transItems = mysql_query($q, $mLink); $hasItems = mysql_num_rows($transItems); echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; while ($tItem = mysql_fetch_assoc($transItems)) { echo " \n"; echo " \n"; } if ($hasItems) { $locList = sqlSelect("iloc", "", "", "description"); echo " \n"; } echo "
MFGVSNDESCRIPTIONWORKORDERLocation
\n"; echo " {$tItem['vend']}\n"; echo " {$tItem['vsn']}\n"; echo " {$tItem['description']}\n"; echo " {$tItem['workorder']}\n"; echo " {$tItem['ldesc']}\n"; echo "
\n"; echo "
\n"; echo "

\n"; $avalList = mysql_query("select inventory.*,idesc.vend, idesc.vsn,idesc.description from inventory,idesc where inventory.item=idesc.tid and iloc!='' and transfer='' and sof='' group by item,iloc,workorder order by category,vend,vsn", $mLink); if (mysql_num_rows($avalList)) { echo "
Items available to move

\n"; echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; while ($availItem = mysql_fetch_assoc($avalList)) { //echo "\n"; //echo "\n"; //echo "\n"; echo " \n"; echo " \n"; //echo "\n"; } echo "
MFGVSNDESCRIPTIONWORKORDERLocation
{$availItem['vend']}\n"; echo " {$availItem['vsn']}\n"; echo " {$availItem['description']}\n"; echo " {$availItem['workorder']}\n"; echo " {$availItem['iloc']}\n"; echo "
\n"; echo "\n"; } else echo "No stock available for transfer
\n"; } debug(2); ?>