<?php
	session_start();
	
	$strret = "0";
		
	header("Content-type: text/html; charset=gb2312"); 
	
	require_once("db/db.php");	
	require_once("common/common.php");
	
	$strbillno = trim($_REQUEST["selbillno"]);
	
	//判断是否有沽清的项目					
	$sql = sprintf("SELECT COUNT(a.ListNo)AS SumCount FROM WX_Bill_Item a,WX_Bill_Inform b,TCP_Item_List d,TCP_Item_Type e
					Where a.Bill_No=b.Bill_No And b.Bill_No='%s' And e.DListNo=b.DListNo And d.TypeListNo=e.ListNo 
					And a.Item_No=d.ItemNo And d.SellClearFlag>0 And a.Item_Count>d.SellClearCount",$strbillno);
		
	$result = querySql($sql);
	$intRowCount = 0;
	if($row = fetch_array($result))
	{
		$intRowCount = $row['SumCount'];
	}				
	freeResult($result);	//释放数据库
	
	if($intRowCount>0)
	{
		$strret='1';
	}
	else
	{
		$strret='0';
	}
	echo $strret;
	closeDb();		
?>



