⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rpt_stock_card2.php

📁 warehouse management system
💻 PHP
字号:
<?
include("../application.php");
$username=$SESSION["user"]["user_name"];
$unit_set=$SESSION["user"]["unit_set"];
$work_type=$SESSION["user"]["work_type"];
include("rptheader.php");
 ?>

<table width="100%"  border="0" cellspacing="0" cellpadding="1" bordercolor="#000000" bgcolor="#ffffff" >
 <tr bgcolor="#ffffff">
		<td  align ="left" class="txtThai" colspan="2">Hitachi Transport  System (Thailand ) Co.,Ltd.<br></td>
		<td  align ="right" class="txtThai" height='20'>User Print : <?echo $username;?></td>
</tr>
 <tr bgcolor="#ffffff">
		<td  align ="left"  class="txtThai" colspan="2">REPORT STOCK  CARD</td>
		<td  align ="right" class="txtThai" height='20'>Date Print : <?echo date('y-m-d');?></td>
</tr>
 <tr bgcolor="#ffffff">
		<td  align ="left" class="txtThai" colspan="2">Site   : <?echo site_info($site_id);?></td>
		<td  align ="right" class="txtThai" height='20'>Time Print : <?echo date('h:m:d');?></td>
</tr>
</table>
<br>
<?
$sql_info="SELECT  product_id,model,color FROM stock_product WHERE product_id='$product_id' ";
$qid=db_query($sql_info);
$frm=db_fetch_array($qid);
?>
<table width="100%"  border="1" cellspacing="0" cellpadding="1" bordercolor="#000000" bgcolor="#ffffff" >
  <tr bgcolor="#ffffff">
		<td  align ="left" class="txtThai" colspan="3" height="25"><b>Product ID : &nbsp;<u><?echo $product_id;?></u></b>&nbsp;(<?echo "$frm[model] $frm[color]";?>)</td>
</tr>
</table>
<DIV class="outerframe">
<table  border="1" bgcolor="#ffffff" bordercolor="#000000" cellspacing="0" cellpadding="1" width="100%">
<THEAD>
<tr>
	<td   align="center" width="5%" class="txtThaiB" rowspan="2"><b>Item</b></td> 
	<td   align="center"   class="txtThaiLB" rowspan="2"><font color="#000000" ><b>Date</b></font>&nbsp;
	</td> 
	<td   align="center"   class="txtThaiLB" rowspan="2"><font color="#000000" ><b>B/F</b></font>&nbsp;
	</td> 
	<?
$sql_head="SELECT COUNT(style_io) cnt ,style_io FROM stock_style_io WHERE work_type='$work_type' AND log_status='1' AND (style_io='+' OR  style_io='-') AND start_date<='$op_date' AND end_date>='$op_date' GROUP  BY style_io ORDER  BY style_io DESC";
	$qid = db_query($sql_head);
	$count_head=0;
	while ($x = db_fetch_object($qid)) { 
	//	$count_head++;
	//	$item[$count_head]=0;
	//	$sum_item[$count_head]=0;
	?>
	 <td   align="center"  valign="middle" class="txtThaiLB" colspan="<?echo $x->cnt;?>"><font color="#000000"><?if($x->style_io=="+")echo "IN";else echo "OUT";?></font>
	</td> 

<?}?>
	<td   align="center"   class="txtThaiLB" rowspan="2" width="5%"><font color="#000000" ><b>Balance</b></font>&nbsp;
	</td> 
	<td   align="center"   class="txtThaiLB" colspan="2"><font color="#000000" ><b>R/F DOC NUMBER</b></font></td> 
</tr>
<tr>
<?
$sql_head="SELECT style_type,style_io,style_ord FROM stock_style_io WHERE work_type='$work_type' AND log_status='1' AND (style_io='+' OR  style_io='-') AND start_date<='$op_date' AND end_date>='$op_date' ORDER BY style_ord ASC";
$qid = db_query($sql_head);
$count_head=0;
$sum_bf=0;
while ($r = db_fetch_object($qid)) { 
	if($count_head<$r->style_ord){
		$count_head=$r->style_ord;
	}
		$item[$r->style_ord]=0;
		$sum_item[$r->style_ord]=0;
	//	echo "<br>".$count_head.="::".$item[$r->style_ord];
	//	echo "<br>".$count_head.="::".$sum_item[$r->style_ord];
	
//	$my_ord[$count_head]=$r->style_ord;
?>

<td   align="center"  valign="middle" class="txtThaiLB" width="5%"  bgcolor="#ffffff"><font color="#000000"><?echo $r->style_type;?></font>&nbsp;
</td> 

<?
}?>
<td   align="center"   class="txtThaiLB" width="10%"><font color="#000000" ><b>(+)</b></font></td> 
<td   align="center"   class="txtThaiLB" width="10%"><font color="#000000" ><b>(-)</b></font></td> 
</tr>
 </THEAD>
</DIV>
<DIV class="innerframe">
<?
$last_qty=0;
$in_qty=0;
$out_qty=0;
$bf_qty=0;
$last_qty=0;
$row=1;
$ord_item=0;
$tmp_date='';
$tmp_bf=0;

$sql_list="SELECT  ".$data_style."stock_detail.type,".$data_style."stock_detail.type,SUM(".$data_style."stock_detail.qty) AS qty,stock_style_io.style_ord FROM ".$data_style."stock_detail ,stock_style_io  WHERE stock_style_io.style_type=".$data_style."stock_detail.doc_type AND stock_style_io.style_io=".$data_style."stock_detail.type AND  ".$data_style."stock_detail.product_id='$product_id' AND ".$data_style."stock_detail.log_status='1' AND ".$data_style."stock_detail.op_date<'$op_date' AND ".$data_style."stock_detail.site_id='$site_id' AND ".$data_style."stock_detail.product_id<>''  AND (style_io='+' OR  style_io='-') GROUP BY  stock_style_io.style_type ORDER BY ".$data_style."stock_detail.op_date ";
$qid = db_query($sql_list);
$row=0;
while ($d = db_fetch_object($qid)) { 
//$item[$row]+=$d->qty;
//$sum_item[$d->style_ord]+=$d->qty;  淞栲鸵峦川摇笛青丛亮液恰市柿
if($d->type=='+')$last_qty+=$d->qty;
else $last_qty-=$d->qty;
}
$tmp_bf=$last_qty;
$sql_list="SELECT ".$data_style."stock_detail.lot_number,".$data_style."stock_detail.type,".$data_style."stock_detail.head_id,".$data_style."stock_detail.op_date,".$data_style."stock_detail.product_id,".$data_style."stock_detail.type,".$data_style."stock_detail.qty,stock_style_io.style_ord FROM ".$data_style."stock_detail ,stock_style_io  WHERE stock_style_io.style_type=".$data_style."stock_detail.doc_type AND stock_style_io.style_io=".$data_style."stock_detail.type AND  ".$data_style."stock_detail.product_id='$product_id' AND ".$data_style."stock_detail.log_status='1' AND ".$data_style."stock_detail.op_date>='$op_date' AND ".$data_style."stock_detail.site_id='$site_id' AND ".$data_style."stock_detail.op_date<='$to_date' AND ".$data_style."stock_detail.product_id<>''  AND (style_io='+' OR  style_io='-') ORDER BY ".$data_style."stock_detail.op_date ";
$qid = db_query($sql_list);
while ($d = db_fetch_object($qid)) { 
if($tmp_date<>$d->op_date AND $row <>0){

	echo "<tr bgcolor='#ffffff' class='txtThai'>";
	$ord_item++;
	echo "<td  align='center' class='txtThaiB'>$ord_item</td> ";
	echo "<td  align='left' class='txtThaiLB' >&nbsp; $tmp_date</td> ";
	echo "<td  align='right' class='txtThaiLB' >&nbsp;". number_format($tmp_bf,$unit_set,'.',',')."&nbsp;";
	echo "</td> ";
	for($i=1;$i<=$count_head;$i++){
			if (isset ($item[$i])){/* 堕伊栅枰 闼榫粤眷屯×

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -