<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<%@ Register TagPrefix="IlgharUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="IlgharUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ilghar:Get ID="Order" Object="Order" InnerID="Request.QueryString['ID']" />
<ilghar:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<base target="_self" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="Mon,1 Fab 1979 23:36:05 GMT" />
<title>生成发货单</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<ilgharUC:Ime Ime="true" Eot="true" runat="server" />
<style type="text/css">
TD TABLE{background:#FFF}
TD TABLE TH{width:100px}
#DetailTable THEAD TH,#DetailTable TBODY TD{width:auto;text-align:center}
</style>
<script type="text/javascript">
var _page = "make_delivery";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _orderID = "<%=Order[ID]%>";
var _deliveryName = "<%=Order[DeliveryName]%>";
var _isProtect = "<%=Order[DeliveryProtect]%>";
var _goodsIndex = 0;
var _goods = new Array();
var _data;
var _deliveryID;
var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_amout_incorrect = "发货量格式不正确！";
var _lang_amount_exceed = "发货量不能超过所需数量！";
var _lang_stock_not_enough = "库存不够！";
var _lang_set_file = "请输入或者选择数字文件！";
var _lang_no_goods = "没有任何商品！";
var _lang_time_incorrect = "发货时间格式不正确！";
var _lang_delivering = "正在发货...";
var _lang_making_delivery = "正在生成发货单...";
var _lang_making_delivery_detail = "正在生成发货单明细...";
</script>
</head>
<body>
<div class="Block">
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle">生成发货单</li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="发货" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="120">订单号：</th>
					<td><%=Order[Number]%></td>
				</tr>
				<tr>
					<th>发货单号：</th>
					<td><input type="text" name="Number" size="30" maxlength="50" class="Text" />如果留空，则会自动生成</td>
				</tr>
				<tr>
					<th>收货人：</th>
					<td>
						<table border="0" cellpadding="4" cellspacing="1">
							<tr>
								<th>姓名：</th>
								<td><input type="text" name="Name" value="<%=Order[ReceiverName]%>" maxlength="50" class="Text <%=ContentLang%>Font" /></td>
							</tr>
							<tr>
								<th>电话：</th>
								<td><input type="text" name="Phone" value="<%=Order[ReceiverPhone]%>" maxlength="20" class="Text" /></td>
							</tr>
							<tr>
								<th>手机：</th>
								<td><input type="text" name="Mobile" value="<%=Order[ReceiverMobile]%>" maxlength="20" class="Text" /></td>
							</tr>
							<tr>
								<th>Email：</th>
								<td><input type="text" name="Email" value="<%=Order[ReceiverEmail]%>" maxlength="50" class="Text" /></td>
							</tr>
							<tr>
								<th>QQ：</th>
								<td><input type="text" name="QQ" value="<%=Order[ReceiverQQ]%>" maxlength="20" class="Text" /></td>
							</tr>
							<tr>
								<th>WW：</th>
								<td><input type="text" name="WW" value="<%=Order[ReceiverWW]%>" maxlength="50" class="Text" /></td>
							</tr>
							<tr>
								<th>MSN：</th>
								<td><input type="text" name="MSN" value="<%=Order[ReceiverMSN]%>" maxlength="50" class="Text" /></td>
							</tr>
							<tr>
								<th>地址：</th>
								<td><input type="text" name="Address" value="<%=Order[ReceiverAddress]%>" size="50" maxlength="50" class="Text" /></td>
							</tr>
							<tr>
								<th>邮编：</th>
								<td><input type="text" name="Zip" value="<%=Order[ReceiverZip]%>" maxlength="50" class="Text" /></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<th>配送方式：</th>
					<td><%=Order[DeliveryName]%></td>
				</tr>
				<tr>
					<th>是否保价：</th>
					<td>
						<%If Convert.ToBoolean(Order[DeliveryProtect])%>
							是
						<%Else%>
							否
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>运单号：</th>
					<td><input type="text" name="DeliveryNumber" maxlength="50" class="Text" /></td>
				</tr>
				<tr>
					<th>物流公司：</th>
					<td><input type="text" name="Company" maxlength="50" class="Text" /></td>
				</tr>
				<tr>
					<th>发货时间：</th>
					<td><input type="text" name="Time" value="<%=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")%>" maxlength="20" class="Text" /></td>
				</tr>
				<tr>
					<th>备注：</th>
					<td><textarea name="Memo" cols="70" rows="6" wrap="off" class="Text <%=ContentLang%>Font"></textarea></td>
				</tr>
				<tr>
					<td colspan="2">
						<table id="DetailTable" border="0" cellpadding="4" cellspacing="1">
							<thead>
								<tr>
									<th style="width:120px">货号</th>
									<th>名称</th>
									<th style="width:60px">库存</th>
									<th style="width:60px">总数量</th>
									<th style="width:60px">已发货</th>
									<th style="width:60px">发货量</th>
									<th>其他</th>
								</tr>
							</thead>
							<tbody>
								<ilghar:List Object="Order.Detail" Condition="OrderID=Order[ID] and PartID IS NULL">
									<ilghar:Record>
										<tr id="<%=InnerID%>" kind="<%=Kind%>">
											<td><%=Number%></td>
											<td><%=Name%></td>
											<td>
												<%If Guid.Equals(GoodsSpecID, Guid.Empty)%>
													<ilghar:List Object="Goods" Condition="ID=GoodsID">
														<ilghar:Record>
															<%=Stock%>
														</ilghar:Record>
													</ilghar:List>
												<%Else%>
													<ilghar:List Object="Goods.Spec" Condition="ID=GoodsSpecID">
														<ilghar:Record>
															<%=Stock%>
														</ilghar:Record>
													</ilghar:List>
												<%EndIf%>
											</td>
											<td><%=Amount%></td>
											<td><%=DeliveredAmount%></td>
											<td>
												<%If Convert.ToInt32(Amount) > Convert.ToInt32(DeliveredAmount)%>
													<input type="text" id="Amount<%=InnerID%>" value="0" size="5" />
												<%Else%>
													0
												<%EndIf%>
											</td>
											<td>
												<%If String.Equals(Kind, "File")%>
													<input type="checkbox" id="Auto<%=InnerID%>" /><label for="Auto<%=InnerID%>">自动</label>
													<span id="FileSpan<%=InnerID%>"><input type="text" id="File<%=InnerID%>" size="10" /><input type="button" value="..." size="3" /></span>
												<%EndIf%>
											</td>
										</tr>
										<ilghar:List Object="Order.Detail" Condition="OrderID=Order[ID] and GoodsID=GoodsID and PartID IS NOT NULL">
											<ilghar:Record>
												<tr id="<%=InnerID%>" kind="<%=Kind%>">
													<td><%=Number%></td>
													<td>&nbsp;&nbsp;&nbsp;&nbsp;+<%=Name%></td>
													<td>
														<ilghar:List Object="Part" Condition="ID=PartID">
															<ilghar:Record>
																<%If Guid.Equals(SourceSpecID, Guid.Empty)%>
																	<ilghar:List Object="Goods" Condition="ID=SourceID">
																		<ilghar:Record>
																			<%=Stock%>
																		</ilghar:Record>
																	</ilghar:List>
																<%Else%>
																	<ilghar:List Object="Goods.Spec" Condition="ID=SourceSpecID">
																		<ilghar:Record>
																			<%=Stock%>
																		</ilghar:Record>
																	</ilghar:List>
																<%EndIf%>
															</ilghar:Record>
														</ilghar:List>
													</td>
													<td><%=Amount%></td>
													<td><%=DeliveredAmount%></td>
													<td>
														<%If Convert.ToInt32(Amount) > Convert.ToInt32(DeliveredAmount)%>
															<input type="text" id="Amount<%=InnerID%>" value="0" size="5" />
														<%Else%>
															0
														<%EndIf%>
													</td>
													<td>
														<%If String.Equals(Kind, "File")%>
															<input type="checkbox" id="Auto<%=InnerID%>" /><label for="Auto<%=InnerID%>">自动</label>
															<span id="FileSpan<%=InnerID%>"><input type="text" id="File<%=InnerID%>" size="10" /><input type="button" value="..." size="3" /></span>
														<%EndIf%>
													</td>
												</tr>
											</ilghar:Record>
										</ilghar:List>
									</ilghar:Record>
								</ilghar:List>
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=JsPath%>shop.js"></script>
</body>
</html>