strSql.Append(",(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.CNTR10 ELSE 0 END) CNTR10,(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append(",(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.CNTR10 ELSE 0 END) CNTR10,(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.OTCNTR ELSE 0 END) OTCNTR");
strSql.Append(",(B.NETWEIGHT) NETWEIGHT,(B.KGS) KGS,(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.TEU ELSE 0 END) TEU");
strSql.Append(",(B.NETWEIGHT) NETWEIGHT,(B.KGS) KGS,(CASE WHEN (B.BLTYPE='整箱' OR B.BLTYPE='拼箱主票') THEN B.TEU ELSE 0 END) TEU");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",(SELECT TOP 1 BLSTATUS FROM op_blissue WHERE BSNO=B.BSNO) BLISSUESTATUS,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",(select showname from [user] where gid=f.Auditoperator) MSHIPPERID,dbo.trimdate(f.AUDITDATE) MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL,A.BillFeeStatus,B.SALECORPID,'' MDESCRIPTION ");
//strSql.Append(",(select showname from [user] where gid=f.Auditoperator) MSHIPPERID,dbo.trimdate(f.AUDITDATE) MCONSIGNEEID");
strSql.Append(",(select showname from [user] where gid=(select top 1 Auditoperator from ch_fee where bsno=A.BSNO and AUDITDATE is not null order by AUDITDATE desc))MSHIPPERID");
strSql.Append(",dbo.trimdate((select top 1 AUDITDATE from ch_fee where bsno=A.BSNO and AUDITDATE is not null order by AUDITDATE desc))MCONSIGNEEID");