This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/pc/tmpl/order_print_detail_ty.php
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

432 lines
19 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
//-----------------------------------------------------后台->订单打印->明细单 for 上海乔治白 2013.03.09 by yangyj
//--条件定制
//array("xh"=>"序号","price"=>"价格","title"=>"款式名","series"=>get_cate_title_no("arr_select","series"),"season"=>get_cate_title_no("arr_select","season"),"bc"=>get_cate_title_no("arr_select","bc"),"category"=>get_cate_title_no("arr_select","category"),"category1"=>get_cate_title_no("arr_select","category1"));
$arr_zd=array("title"=>"商品名称","bc"=>get_cate_title_no("arr_select","bc"));
//是否显示颜色代码
$is_show_color="n";
//是否显示金额
$is_show_je="y";
//
//查询条件定制
$s_ka="n";
$s_key=$_key;
$con=" and ka<> 'y'";
//
$con_u="";
if($s_username){
$s_username=str_replace("",",",$s_username);
//去掉最后一个逗号
if(substr($s_username,strlen($s_username)-1,1)==",")
$s_username1=substr($s_username,0,-1);
else
$s_username1=$s_username;
$arr_username=explode(",",$s_username1);
//去掉重复值
$arr_username=array_unique($arr_username);
$confirm_str=$p_title=$error="";
for($i=0;$i<count($arr_username);$i++){
//检查是否存在
$m_client=get_db_msg("select * from ".$table_pre."client where username='".$arr_username[$i]."'");
//
if($m_client["id"]){
if($m_client["face"]=="4"){
$con_u.=" (uid='".$m_client["id"]."') or ";
if($m_client["is_checked"]!="y"){
$error_confirm.=$arr_username[$i].",";
$confirm_str.="<span style=\"color:#0000ff;\">".$arr_username[$i]."(未确认)</span>,";
}else{
$confirm_str.="<span style=\"color:#ff0000;\">".$arr_username[$i]."(已确认)</span>,";
}
}else{
$con_u.=" (upath='".$m_client["path"]."-".$m_client["id"]."' or upath like '".$m_client["path"]."-".$m_client["id"]."-%') or ";
}
$p_title.=$m_client["title"]."(".$m_client["username"]."),";
}else{
$error.=$arr_username[$i].",";
}
}
}
if($con_u)
$con.=" and (".substr($con_u,0,-3).") ";
if($confirm_str)
$confirm_str=substr($confirm_str,0,-1);
//取得店铺框
$js_function=get_client_autocompelete("","n")."\n";
$js_function.="$(function() {
$('#s_username').autocomplete(clients, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 300, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
multiple:true,
multipleSeparator:',',
formatItem: function(row, i, max) {
return row.t+'('+row.u+')';
},
formatMatch: function(row, i, max) {
return row.t + row.u;
},
formatResult: function(row) {
return row.u;
}
}).result(function(event, row, formatted) {
$('#s_username').value=row.u;
});
});";
$js_function.="
function export1(){
var u=document.getElementById('s_username').value;
if(u){
url='".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=export&s_username='+u;
location.href=url;
}else{
alert('请先选择店铺!');
}
}
";
$check_md=get_db_msg("select count(*) 'num' from ".$table_pre."kh_md");
if($check_md["num"]>0)
$search_content.="<select name=\"s_md\"><option value=\"\">包含买断款</option>".get_main_op(array("n"=>"非买断款","y"=>"仅买断款"),$s_md)."</select> ";
$search_content.="店铺:<input type=text name=\"s_username\" id=\"s_username\" style=\"width:300px\" value=\"".$s_username."\">";
$search_content.=" <input type=\"hidden\" name=\"sub\" value=\"yes\"><input type=submit value=\"提 交\" class=\"button_act\"> <input type=button value=\"导出明细\" class=\"button_act\" onclick=\"export1()\"> ";
if($confirm_str)
$search_content.="<div style=\"width:100%;padding:4px;\" align=\"center\">".$confirm_str."</div>";
if($sub=="yes"){
$_title=substr($p_title,0,-1)." 明细单 ".date("Y年m月d日 H点i分");
//$search_content.="<input type=\"button\" value=\"重新设置折扣\" onclick=\"o_window('?_m=".$_m."&_cid=".$_cid."&_a=set_zk&id=".$m_client["id"]."','set_zk',400,600)\">";
//-------------------处理尺码表头
//取得合并尺码
$arr_size_merged=get_size_merged();
$num_size_total=16;
//取得尺码合计sql
$sql_sum_num="";
for($k=0;$k<$num_size_total;$k++){
$sql_sum_num.="sum(num_".$arr_size_merged[$k].") 'num_".$arr_size_merged[$k]."',";
}
/*
//取得尺码表头内容
$num_size_group=0;
$size_tr=array();
$r1=$db->query("select * from ".$table_pre."keyword where cate='size' order by ord");
while($m1=$db->fetch_array($r1)){
$size_tr[$num_size_group]="";
for($i=1;$i<=$num_size_total;$i++){
$tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m1["id"]."' and no='".$i."'");
$t=$tmp["title"]?$tmp["title"]:"&nbsp;";
$size_tr[$num_size_group].="<td bgcolor=\"#dddddd\" align=\"center\" width=\"30\">".$t."</td>";
}
$arr_size_merged[]=$m1["no"];
$num_size_group++;
}
//-------------------/处理尺码表头结束
*/
//取得所有款的最长尺码
$tmp="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16";
$num_max_size=16;
//----------------------------------------------取得订单记录
if($s_md=="y"){
//-------------------仅买断款
$_tbody="<thead style=\"display:table-header-group;\"><tr><td bgcolor=\"#dddddd\" align=\"center\">款号</td><td bgcolor=\"#dddddd\" align=\"center\">".get_cate_title_no("arr_select","category")."</td><td bgcolor=\"#dddddd\" align=\"center\">颜色</td><td align=\"center\" bgcolor=\"#dddddd\" width=\"40\">小计</td><td bgcolor=\"#dddddd\" align=\"center\" width=\"70\">买断价格</td><td rowspan=\"".$num_size_group."\" bgcolor=\"#dddddd\" align=\"center\" width=\"80\">结算金额</td></tr>";
for($i=1;$i<$num_size_group;$i++){
$_tbody.="<tr>".$size_tr[$i]."</tr>";
}
$_tbody.="</thead>";
//取得总款数
$tmp=get_db_msg("select count(distinct kh) 'num' from ".$table_pre."kh_md");
$total_ks=$tmp["num"];
$q="select * from ".$table_pre."kh_md order by kh,color";
$r=$db->query($q);
$count=0;
$total_num=$total_money=0;
while($m=$db->fetch_array($r)){
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m["kh"]."'");
$bg=($count%2)?"#ffffff":"#f0f0f0";
if(trim($m["color"])){
//有颜色
if(trim($m["size"])){
//有尺码
$arr_color=array($m["color"]);
$arr_size=explode(",",$m["size"]);
}else{
//所有尺码
$arr_color=array($m["color"]);
$arr_size=explode(",",$m["size"]);
$arr_size=array();
for($k=0;$k<$num_size_total;$k++){
$arr_size[]=$arr_size_merged[$k];
}
}
}else{
//所有颜色
$arr_color=explode(",",$m_kh["color"]);
$arr_size=array();
for($k=0;$k<$num_size_total;$k++){
$arr_size[]=$arr_size_merged[$k];
}
}
for($j=0;$j<count($arr_color);$j++){
$xj_money=$xj_num=0;
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$q2="select ".get_size_sql("sum1")." from ".$table_pre."order where iid='".$m_kh["id"]."' and color='".$arr_color[$j]."' ".$con;
//echo $q2."<br>";
$m2=get_db_msg($q2);
if(in_array($arr_size_merged[$k],$arr_size)){
$tmp_num=$m2["num_".$arr_size_merged[$k]];
$v11="hj_num_".$k;
$$v11+=$tmp_num;
$xj_money+=$tmp_num*$m["price"];
$xj_num+=$tmp_num;
$td_size1.="<td bgcolor=\"#999900\" align=\"right\">".deel_td($tmp_num)."</td>";
}else{
$td_size1.="<td bgcolor=\"".$bg."\" align=\"right\">&nbsp;</td>";
}
}
$total_num+=$xj_num;
$total_money+=$xj_money;
$_tcontent[$count]="<tr height=\"25\"><td bgcolor=\"".$bg."\">".get_kh_xh($m_kh)."#".$m["kh"]."</td><td bgcolor=\"".$bg."\">".get_cate_title_no("category",$m_kh["category"])."</td><td bgcolor=\"".$bg."\">".$arr_color[$j]."-".get_cate_title_no("color",$arr_color[$j])."</td>".$td_size1."<td bgcolor=\"".$bg."\" align=\"right\">".$xj_num."</td><td bgcolor=\"".$bg."\" align=\"right\">".$m["price"]."</td><td bgcolor=\"".$bg."\" align=\"right\">".$xj_money."</td>";
$count++;
$total_kss++;
}
}
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$v1="hj_num_".$k;
$td_size1.="<td bgcolor=\"#dddddd\" align=\"right\">".deel_td($$v1)."</td>";
}
$price_pj=($total_num>0)?keep_float($total_money/$total_num,2):0;
$_tcontent[$count]="<tr height=\"25\"><td align=\"right\" bgcolor=\"#dddddd\" colspan=\"3\">合计</td>".$td_size1."<td bgcolor=\"#dddddd\" align=\"right\">".$total_num."</td><td bgcolor=\"#dddddd\" align=\"right\">".$price_pj."</td><td bgcolor=\"#dddddd\" align=\"right\">".$total_money."</td>";
}else{
//包含买断款,非买断款
$_tbody="<thead style=\"display:table-header-group;\"><tr><td bgcolor=\"#dddddd\" align=\"center\">款号</td><td bgcolor=\"#dddddd\" align=\"center\">商品名称</td><td bgcolor=\"#dddddd\" align=\"center\">上市期</td><td bgcolor=\"#dddddd\" align=\"center\">颜色</td><td bgcolor=\"#dddddd\" align=\"center\" colspan=\"".$num_max_size."\">尺码</td><td width=\"40\" rowspan=\"".$num_size_group."\" align=\"center\" bgcolor=\"#dddddd\">小计</td><td width=\"50\" bgcolor=\"#dddddd\" align=\"center\">吊牌金额</td><td width=\"70\" bgcolor=\"#dddddd\" align=\"center\">结算金额</td></tr></thead>";
$q="select * from ".$table_pre."order where _key='".$s_key."'".$con." group by no order by bc,no desc";
//echo $q."<br>";
$r=$db->query($q);
$total_num=$total_money=$total_money_zk=0;
$count=0;
$arr_kh=$arr_kh_color=array();
while($m=$db->fetch_array($r)){
$bg=($count%2)?"#ffffff":"#f0f0f0";
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
$price_zk=get_price_zk($m1["id"],$m["uid"]);
//取得颜色
$q2="select ".get_size_sql("sum1").",color,sum(jsje) jsje from ".$table_pre."order where _key='".$s_key."'".$con." and no='".$m["no"]."' group by no,color";
//echo $q2."<br>";
$r2=$db->query($q2);
$j=0;
$je1=$num1=0;
while($m2=$db->fetch_array($r2)){
$td_size1="";
$num_color_hj=0;
$arr_kh_size=explode(",",$m1["size"]);
for($k=0;$k<16;$k++){
if($arr_kh_size[$k]>0){
//$ck_md=check_md($m1["no"],$m2["color"],$arr_kh_size[$k]);
//echo $ck_md.":".$m1["no"].",".$m2["color"].",".$arr_size_merged[$k]."<br>";
if($s_md=="n"){
if($ck_md!="n"){
$tmp_num=0;
}else{
$tmp_num=$m2["num_".$arr_kh_size[$k]];
}
}else{
$tmp_num=$m2["num_".$arr_kh_size[$k]];
}
if($ck_md!="n"){
$price_zk1=$ck_md;
$sty1="#999900";
}else{
$sty1=$bg;
$price_zk1=$price_zk;
}
$sty1=$bg;
//$je1+=$m2["jsje"];
$num1+=$tmp_num;
$num_color_hj+=$tmp_num;
//计算尺码合计
$v11="hj_num_".$k;
$$v11+=$tmp_num;
if($tmp_num==0) $tmp_num="&nbsp;";
$td_size1.="<td bgcolor=\"".$sty1."\" align=\"right\">".$tmp_num."</td>";
}else{
$td_size1.="<td bgcolor=\"".$sty1."\" align=\"right\">&nbsp;</td>";
}
}
$je1+=$m2["jsje"];
if($num_color_hj>0){
$arr_kh_color[$count][$j]="<td bgcolor=\"".$bg."\">".$m2["color"]."-".get_cate_title_no("color",$m2["color"])."</td>".$td_size1;
$j++;
}
}
$total_num+=$num1;
$total_money+=$num1*$m1["price"];
$total_money_zk+=$je1;
//
if($num1>0){
$arr_kh[$count]["id"]=$m1["id"];
$arr_kh[$count]["no"]=$m1["no"];
$xh=get_kh_xh($m1);
$xh=$xh>0?$xh."#":"";
$arr_kh[$count]["xh"]=$xh;
$arr_kh[$count]["num"]=$num1;
$arr_kh[$count]["price"]=$m1["price"];
$arr_kh[$count]["je"]=$je1;
if($je1==0) $arr_kh[$count]["je"]="&nbsp;";
$arr_kh[$count]["xh"]=get_kh_xh($m1);
$arr_kh[$count]["title"]=$m1["title"];
$arr_kh[$count]["series"]=get_cate_title_no("series",$m1["series"]);
$arr_kh[$count]["season"]=get_cate_title_no("season",$m1["season"]);
$arr_kh[$count]["bc"]=get_cate_title_no("bc",$m1["bc"]);
$arr_kh[$count]["category"]=get_cate_title_no("category",$m1["category"]);
$arr_kh[$count]["category1"]=get_cate_title_no("category1",$m1["category1"]);
$arr_kh[$count]["size"]=$m1["size"];
$arr_kh[$count]["size_group"]=$m1["size_group"];
$count++;
}
}
//组合输出内容
$count=0;
for($i=0;$i<count($arr_kh);$i++){
$bg=($i%2)?"#ffffff":"#f0f0f0";
$num1=count($arr_kh_color[$i]);
for($j=0;$j<$num1;$j++){
if($j==0){
//尺码表头
$tmp_size_title="";
$tmp_arr_size=explode(",",$m1["size"]);
for($k=0;$k<16;$k++){
if($tmp_arr_size[$k]>0){
$t=get_db_msg("select * from ".$table_pre."size where iid='".$arr_kh[$i]["size_group"]."' and no='".$tmp_arr_size[$k]."'");
$tmp1=$t["title"];
}else{
$tmp1="&nbsp;";
}
$tmp_size_title.="<td bgcolor=\"".$bg."\">".$tmp1."</td>";
}
$_tcontent[$count]="<tr height=\"25\"><td bgcolor=\"".$bg."\" rowspan=\"".($num1+1)."\">".$arr_kh[$i]["no"]."</td><td bgcolor=\"".$bg."\" rowspan=\"".($num1+1)."\">".$arr_kh[$i]["title"]."</td><td bgcolor=\"".$bg."\" rowspan=\"".($num1+1)."\">".$arr_kh[$i]["bc"]."</td><td bgcolor=\"".$bg."\">尺码</td>".$tmp_size_title."<td bgcolor=\"".$bg."\" align=\"right\" rowspan=\"".($num1+1)."\">".$arr_kh[$i]["num"]."</td><td bgcolor=\"".$bg."\" align=\"right\" rowspan=\"".($num1+1)."\">".($arr_kh[$i]["price"]*$arr_kh[$i]["num"])."</td><td bgcolor=\"".$bg."\" rowspan=\"".($num1+1)."\" align=\"right\">".keep_float($arr_kh[$i]["je"],2)."</td></tr>";
$_tcontent[$count].="<tr height=\"25\">".$arr_kh_color[$i][$j]."</tr>";
}else{
$_tcontent[$count]="<tr height=\"25\">".$arr_kh_color[$i][$j]."</tr>";
}
$count++;
}
}
$colspan1=count($arr_zd)+2;
if($is_show_je=="y"){
$tmp_zd_je="<td bgcolor=\"#f0f0f0\" align=\"right\">".$total_money."</td>";
if(trim($zk_type) || $check_md["num"]>0){
$tmp_zd_je.="<td bgcolor=\"".$bg."\" rowspan=\"".$num1."\" align=\"right\">".keep_float($total_money_zk,2)."</td>";
}
}else{
$tmp_zd_je="";
}
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$v1="hj_num_".$k;
$td_size1.="<td bgcolor=\"".$bg."\" align=\"right\">".deel_td($$v1)."</td>";
}
if($total_money_zk==0) $total_money_zk="&nbsp;";
$_tcontent[$count]="<tr height=\"25\"><td align=\"right\" bgcolor=\"#f0f0f0\" colspan=\"4\">合计</td>".$td_size1."<td bgcolor=\"#f0f0f0\" align=\"right\">".$total_num."</td>".$tmp_zd_je."</tr>";
}
$_tcontent[$count].="</table><table width=\"100%\"><td align=\"left\">订单生效说明:
<br>备注:1.2013年冬首次订货金额为".keep_float($total_money_zk,2)."元;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.定金按下单金额的20%支付,即:____________元,订货确认单立即生效,十天内(即6月21日前)定金到位,否则视为现货!;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.定金使用时间:</td></table>
<table>
<tr height=15 style='height:15.0pt'>
<td height=15 class=xl65 width=65 style='height:15.0pt;width:65pt'></td>
<td class=xl66 width=65 style='width:65pt'>季节<ruby><font class=\"font6\"><rt class=font6></rt></font></ruby></td>
<td class=xl66 width=65 style='border-left:none;width:130pt'>首批使用时间<ruby><font
class=\"font6\"><rt class=font6></rt></font></ruby></td>
<td class=xl66 width=65 style='border-left:none;width:65pt'>使用比例<ruby><font
class=\"font6\"><rt class=font6></rt></font></ruby></td>
<td class=xl66 width=80 style='border-left:none;width:130pt'>剩余使用时间<ruby><font
class=\"font6\"><rt class=font6></rt></font></ruby></td>
<td class=xl66 width=65 style='border-left:none;width:65pt'>使用比例<ruby><font
class=\"font6\"><rt class=font6></rt></font></ruby></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td class=xl65 width=65 style='width:65pt'></td>
<td width=65 style='width:65pt'></td>
</tr>
<tr height=15 style='height:15.0pt'>
<td height=15 class=xl65 style='height:15.0pt'></td>
<td class=xl66 style='border-top:none'>春<ruby><font class=\"font6\"><rt
class=font6></rt></font></ruby></td>
<td class=xl67 style='border-top:none;border-left:none'>1月5日</td>
<td class=xl68 style='border-top:none;border-left:none'>70%</td>
<td class=xl67 style='border-top:none;border-left:none'>4月15日</td>
<td class=xl68 style='border-top:none;border-left:none'>30%</td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td></td>
</tr>
<tr height=15 style='height:15.0pt'>
<td height=15 class=xl65 style='height:15.0pt'></td>
<td class=xl66 style='border-top:none'>夏<ruby><font class=\"font6\"><rt
class=font6></rt></font></ruby></td>
<td class=xl67 style='border-top:none;border-left:none'>3月15日</td>
<td class=xl68 style='border-top:none;border-left:none'>70%</td>
<td class=xl67 style='border-top:none;border-left:none'>6月15日</td>
<td class=xl68 style='border-top:none;border-left:none'>30%</td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td></td>
</tr>
<tr height=15 style='height:15.0pt'>
<td height=15 class=xl65 style='height:15.0pt'></td>
<td class=xl66 style='border-top:none'>秋<ruby><font class=\"font6\"><rt
class=font6></rt></font></ruby></td>
<td class=xl67 style='border-top:none;border-left:none'>8月10日</td>
<td class=xl68 style='border-top:none;border-left:none'>70%</td>
<td class=xl67 style='border-top:none;border-left:none'>10月20日</td>
<td class=xl68 style='border-top:none;border-left:none'>30%</td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td></td>
</tr>
<tr height=15 style='height:15.0pt'>
<td height=15 class=xl65 style='height:15.0pt'></td>
<td class=xl66 style='border-top:none'>冬<ruby><font class=\"font6\"><rt
class=font6></rt></font></ruby></td>
<td class=xl67 style='border-top:none;border-left:none'>10月15日</td>
<td class=xl68 style='border-top:none;border-left:none'>70%</td>
<td class=xl67 style='border-top:none;border-left:none'>12月31日</td>
<td class=xl68 style='border-top:none;border-left:none'>30%</td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td class=xl65></td>
<td></td>
</tr>
</table>
<table width=\"100%\">
<tr>
<td align=\"left\">4、订货会取消款式可用替代款式补充;</td>
</tr>
<tr>
<td align=\"left\">5、鞋子订货按一口价买断,所有配件按公司期货政策买断;</td>
</tr>";
$bottom_button="<input type=\"button\" name=\"s1\" value=\"打 印\" onclick=\"start_print()\">";
}
?>