| Current Path : /var/www/html/mmishra/istore/ |
| Current File : /var/www/html/mmishra/istore/partissue.inc |
<h3>Partial Issue</h3>
<center>
<?php
/*
$sr = mysql_query("select indent_no from indents order by indent_no");
while ($q = mysql_fetch_object($sr)) {
$indentno = $q->indent_no;
$i = 0;
$j = 0;
$rs = mysql_query("select i.qty_approve,u.qty_out from indent_items i left join st_stockout u on i.indent_no=u.indent_no and i.item=u.item where i.indent_no=$indentno");
while ($o = mysql_fetch_object($rs)) {
$i++;
if ($o->qty_approve == $o->qty_out) $j++;
}
//if issued items = indented items, set status of indent to ISSUED
if ($i > 0 && $i == $j) {
//mysql_query("update indents set status='Issued' where indent_no=$indentno");
echo("i=$i, j=$j update indents set status='Issued' where indent_no=$indentno<br>");
} elseif ($i > $j && $j > 0) {
//mysql_query("update indents set status='Approved' where indent_no=$indentno");
echo("i=$i, j=$j update indents set status='Approved' where indent_no=$indentno<br>");
} elseif ($i == 0 && $j == 0) {
//mysql_query("update indents set status='Cancelled' where indent_no=$indentno");
echo("i=$i, j=$j update indents set status='Cancelled' where indent_no=$indentno<br>");
} else {
//mysql_query("update indents set status='Pending' where indent_no=$indentno");
echo("i=$i, j=$j update indents set status='Pending' where indent_no=$indentno<br>");
}
}
*/
$sr = mysql_query("select indent_no,item,qty_out from st_stockout order by indent_no,item");
while ($q = mysql_fetch_object($sr)) {
$indentno = $q->indent_no;
$item = $q->item;
$qty = $q->qty_out;
//mysql_query("update indent_items set qty_out=$qty where indent_no=$indentno and item=$item");
echo("update indent_items set qty_out=$qty where indent_no=$indentno and item=$item<br>");
}
?>
</center>