<!--
 *this file is part of nseer erp
 *Copyright (C)2006-2010 Nseer(Beijing) Technology co.LTD/http://www.nseer.com 
 *
 *This program is free software; you can redistribute it and/or
 *modify it under the terms of the GNU General Public License
 *as published by the Free Software Foundation; either
 *version 2 of the License, or (at your option) any later version.
 -->
<%@page contentType="text/html; charset=UTF-8" language="java" import="java.sql.*,include.nseer_cookie.*" import="java.util.*" import="java.io.*" import="include.nseer_cookie.exchange" import="include.nseer_db.*,include.nseerdb.*,java.text.*"%>
<%
nseer_db logistics_db=new nseer_db((String)session.getAttribute("unit_db_name"));
nseer_db logisticsdb=new nseer_db((String)session.getAttribute("unit_db_name"));
%>
<%@include file="../include/head.jsp"%>
<jsp:useBean id="getNameFromID" class="include.get_name_from_ID.getNameFromID" scope="page"/>
<jsp:useBean id="demo" class="include.tree_index.businessComment" scope="page"/>
<%
DealWithString DealWithString=new DealWithString(application);
String mod=request.getRequestURI();
demo.setPath(request);
String handbook=demo.businessComment(mod,"您正在做的业务是：","document_main","reason","value");
%>
<%@taglib uri="/WEB-INF/mytag.tld" prefix="page"%>
<jsp:useBean id="query" scope="page" class="include.query.getRecordCount"/>
<script language="javascript" src="../../javascript/winopen/winopen.js"></script>
<%
String logistics_ID=request.getParameter("logistics_ID");
String provider_ID=request.getParameter("provider_ID");
try{
String sql="select * from logistics_logistics where logistics_ID='"+logistics_ID+"'";
ResultSet rs=logisticsdb.executeQuery(sql);
if(rs.next()){
%>
<table <%=TABLE_STYLE3%> class="TABLE_STYLE3">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_HANDBOOK_STYLE1%> class="TD_HANDBOOK_STYLE1"><div class="div_handbook"><%=handbook%></div></td>
</tr>
</table>
<table <%=TABLE_STYLE6%> class="TABLE_STYLE6">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE3%> class="TD_STYLE3" class="Noprint"><div <%=DIV_STYLE1%> class="DIV_STYLE1"><OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT><input type="button" <%=BUTTON_STYLE1%> class="BUTTON_STYLE1" value=<%=demo.getLang("erp","打印")%> onclick="javascript:window.print()">&nbsp;<input type="button" <%=BUTTON_STYLE1%> class="BUTTON_STYLE1" value=<%=demo.getLang("erp","页面设置")%> onclick=document.all.WebBrowser.ExecWB(8,1)>&nbsp;<input type="button" <%=BUTTON_STYLE1%> class="BUTTON_STYLE1" value=<%=demo.getLang("erp","打印预览")%> onclick=document.all.WebBrowser.ExecWB(7,1)></div></td>
</tr>
</table>
<div id="nseerGround" class="nseerGround">
<%@include file="../include/paper_top.html"%>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE5%> class="TD_STYLE5">&nbsp;</td>
</tr>
</table>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE5%> class="TD_STYLE5"><font size="4"><b><%=demo.getLang("erp","收货登记单")%></b></font></td>
</tr>
</table>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE5%> class="TD_STYLE5">&nbsp;</td>
</tr>
</table>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4" id=theObjTable>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","配送单编号")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=logistics_ID%></td>
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","订单编号")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=rs.getString("order_ID")%>&nbsp;</td>
</tr>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","产品编号")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=rs.getString("product_ID")%>&nbsp;</td>
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","产品名称")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=exchange.toHtml(rs.getString("product_name"))%>&nbsp;</td>
</tr>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","客户档案编号")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=rs.getString("customer_ID")%></td>
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","客户名称")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=exchange.toHtml(rs.getString("customer_name"))%>&nbsp;</td>
</tr>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","地址")%>&nbsp;&nbsp;&nbsp;&nbsp;：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" colspan="3" width="87%"><%=exchange.toHtml(getNameFromID.getNameFromID((String)session.getAttribute("unit_db_name"),"crm_file","customer_ID",rs.getString("customer_ID"),"customer_address"))%></td>
</tr>
</table>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE5%> class="TD_STYLE5">&nbsp;</td>
</tr>
</table> 
<table <%=TABLE_STYLE5%> class="TABLE_STYLE5">
<tr <%=TR_STYLE2%> class="TR_STYLE2">
<td <%=TD_STYLE2%> class="TD_STYLE2" width="5%"><%=demo.getLang("erp","序号")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="13%"><%=demo.getLang("erp","物流单位名称")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="11%"><%=demo.getLang("erp","档案编号")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="8%"><%=demo.getLang("erp","收货人")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="11%"><%=demo.getLang("erp","收货人电话")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="8%"><%=demo.getLang("erp","收货数量")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="13%"><%=demo.getLang("erp","收货时间")%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="8%">&nbsp;</td>
</tr>
<%
int count=0;
String sql5="select count(*) from logistics_details_details where logistics_ID='"+logistics_ID+"' and provider_ID='"+provider_ID+"'";
ResultSet rs5=logistics_db.executeQuery(sql5);
while(rs5.next()){
count=rs5.getInt("count(*)");
}
if(count>20){
int m=1;
String sql6="select * from logistics_details_details where logistics_ID='"+logistics_ID+"' and provider_ID='"+provider_ID+"' order by receive_time";
ResultSet rs6=logistics_db.executeQuery(sql6);
while(m<=20){
rs6.next();
%>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=m%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("provider_name"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=rs6.getString("provider_ID")%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person_tel"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=demo.qformat(rs6.getDouble("receive_amount"))%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_time"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2">&nbsp;</td>
</tr>
<%
m++;
}
%>
</table>
接下页&nbsp;
<div class="PageNext"></div>
&nbsp;承上页
<table <%=TABLE_STYLE2%> class="TABLE_STYLE2">
<%
for(int j=0;j<count-20;j++){
rs6.next();
int mm=j+1;
%>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=mm%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("provider_name"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=rs6.getString("provider_ID")%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person_tel"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=demo.qformat(rs6.getDouble("receive_amount"))%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_time"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2">&nbsp;</td>
</tr>
<%}%>
</table>
<%
}else{
int mmm=1;
String sql6="select * from logistics_details_details where logistics_ID='"+logistics_ID+"' and provider_ID='"+provider_ID+"' order by receive_time";
ResultSet rs6=logistics_db.executeQuery(sql6);
while(rs6.next()){ 
%>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=mmm%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("provider_name"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=rs6.getString("provider_ID")%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_person_tel"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=demo.qformat(rs6.getDouble("receive_amount"))%></td>
<td <%=TD_STYLE2%> class="TD_STYLE2"><%=exchange.toHtml(rs6.getString("receive_time"))%>&nbsp;</td>
<td <%=TD_STYLE2%> class="TD_STYLE2">&nbsp;</td>
</tr>
<%}%>
</table>
<%}%>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE5%> class="TD_STYLE5">&nbsp;</td>
</tr>
</table>
<table <%=TABLE_STYLE4%> class="TABLE_STYLE4">
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","配送数量")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=demo.qformat(rs.getDouble("demand_amount"))%>&nbsp;</td>
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","收货数量")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=demo.qformat(rs.getDouble("receive_amount_sum"))%>&nbsp;</td>
</tr>
<tr <%=TR_STYLE1%> class="TR_STYLE1">
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","配送人")%>&nbsp;&nbsp;：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=exchange.toHtml(rs.getString("register"))%></td>
<td <%=TD_STYLE1%> class="TD_STYLE8" width="13%"><%=demo.getLang("erp","配送时间")%>：</td>
<td <%=TD_STYLE2%> class="TD_STYLE2" width="37%"><%=exchange.toHtml(rs.getString("register_time"))%></td>
</tr>
</table>
<%@include file="../include/paper_bottom.html"%>
</div>
<%
}
logistics_db.close();
logisticsdb.close();
}catch(Exception ex){
out.println("error"+ex);
}
%>