{echo:JS::import("form")}
<div style="overflow: auto;width:900px;height: 420px;">
	{query:name=doc_refund as dr fields=dr.*,us.name as uname, ma.name as mname join=left join user as us on dr.user_id eq us.id left join manager as ma on dr.admin_id eq ma.id where=dr.id eq $id /}
	{set:$item = $items[0];}
		<h3 class="lineD ">退款单详情：</h3>

		<table class="default no_lr_border">
		<tr><th width="100">订单编号：</th><td>{$item['order_no']|'-'}</td><th width="100">申请人：</th><td>{$item['uname']}</td></tr>
		<tr><th>申请退款至：</th><td>{echo:$item['refund_type']!=0?($item['refund_type']==1?'银行卡':'其它方式'):'账户余额'}</td><th>退款状态：</th><td class="golden">{echo:$item['pay_status']!=0?($item['pay_status']==1?'<b class="red">不予退款</b>':'退款成功'):'<b class="golden">申请退款</b>'}</td></tr>
		<tr><th>开户名：</th><td class="golden">{$item['account_name']|'-'}</td><th>{if:$item['refund_type']==2}支付方式{else:}开户行{/if}：</th><td class="golden">{$item['account_bank']|'-'}</td></tr>
		{if:$item['pay_status']==2}
		<tr><th width="100">账号：</th><td>{$item['refund_account']|'-'}</td><th width="100">申请时间：</th><td>{$item['create_time']}</td></tr>
		<tr><th>退款渠道：</th><td>{$item['channel']|'-'}</td><th>退款账号：</th><td>{$item['bank_account']|'-'}</td></tr>
		{/if}
		<tr><th>管理员：</th><td>{$item['mname']|'-'}</td><th>处理时间：</th><td>{$item['handling_time']|'-'}</td></tr>
		<tr><th colspan=4>申请原因：</th></tr>
		<tr><td colspan=4>{$item['content']}</td></tr>
		<tr><th colspan=4>处理意见：</th></tr>
		<tr><td colspan=4>{$item['handling_idea']}</td></tr>
		</table>

		{query:name= doc_refund as dr fields=od.*,ex.name as exname,py.pay_name as payname join= left join order as od on dr.order_id eq od.id left join express as ex on od.express eq ex.express_company_id left join payment as py on od.payment eq py.id where=dr.id eq $id}
		{set:$amount = $item['order_amount'];}
		<h3 class="lineD mt10">订单信息：</h3>
		<table class="default">
		<tr><th width="100">订单编号：</th><td><i class="icon-order-{$item['type']}"></i>{$item['order_no']}</td><th width="100">下单时间：</th><td>{$item['create_time']}</td></tr>
		<tr><th>支付方式：</th><td>{$item['payname']}</td><th>支付手续费：</th><td class="golden">{$item['handling_fee']}</td></tr>
		<tr><th>订单状态：</th><td colspan="3">{echo:$this->parseOrderStatus($item)}</td></tr>
		<tr><th>配送方式：</th><td>{$item['exname']}</td><th>配送费用：</th><td class="golden">{$item['payable_freight']}</td></tr>
		<tr><th>实际配送费用：</th><td class="golden">{$item['real_freight']}</td><th>代金券：</th><td class="golden">{if:$item['voucher_id']}{set:$voucher=unserialize($item['voucher'])}{$voucher['value']}{else:}-{/if}</td></tr>
		<tr><th>应付商品总金额：</th><td class="golden">{$item['payable_amount']}</td><th>实付商品总金额：</th><td class="golden">{$item['real_amount']}</td></tr>
		<tr><th>发票税金：</th><td class="golden">{$item['taxes']}</td><th>活动优惠金额：</th><td class="golden">{$item['discount_amount']}</td></tr>
		<tr><th>原订单总金额：</th><td colspan=3  class="golden">{echo:sprintf("%.2f",$amount)} 注：记订单在未调价之前的总金额</td></tr>
		<tr><th>订单折扣或涨价：</th><td colspan=3 >{$item['adjust_amount']|0}</td></tr>
		<tr><th>调整后订单总金额：</th><td colspan=3   ><span style="display: inline-block;width: 100px" class="golden" id="order_amount">{$item['order_amount']} </span> 注：总金额不会小于0元</td></tr>
		<tr><th>调价原因：</th><td colspan=3>{$item['adjust_note']}</td></tr>
		</table>
		{/query}

		<h3 class="lineD mt10">所购商品详情：</h3>
	<table class="default" id="attr_values">
		<tr><td style="width:120px;">货号</td><td>商品名</td><td style="width:60px;">规格</td><td style="width:60px;">价格</td><td style="width:40px;">数量</td><td style="width:60px;">小计</td></tr>
		{query:name=doc_refund as dr fields=go.name,pr.pro_no,od.spec,od.goods_price,od.goods_nums,dr.id join= left join order_goods as od on dr.order_id eq od.order_id left join products as pr on od.product_id eq pr.id  left join goods as go on od.goods_id eq go.id where=dr.id eq $id}
		{set:$spec = unserialize($item['spec']);}
		<tr><td>{$item['pro_no']}</td><td>{$item['name']}</td><td>
			{if:is_array($spec)}
			{list:items=$spec item=$ite }
				{$ite['name']}:{$ite['value'][2]}
			{/list}
			{/if}
		</td><td>{$item['goods_price']}</td><td>{$item['goods_nums']}</td><td class="golden">{echo:sprintf("%.2f",($item['goods_price']*$item['goods_nums']))}</td></tr>
		{/query}
	</table>
</div>