strSql.Append(",(select showname from [user] where gid=ch_fee.Auditoperator) Auditoperatorref,LOCALCURR,MANAGER");
strSql.Append(",(select showname from [user] where gid=ch_fee.Auditoperator) Auditoperatorref,LOCALCURR,MANAGER");
strSql.Append(",(select showname from [user] where gid=ch_fee.MANAGER) MANAGERREF ");
strSql.Append(",(select showname from [user] where gid=ch_fee.MANAGER) MANAGERREF ");
strSql.Append(",(select top 1 DESCRIPTION from info_client where SHORTNAME=ch_fee.CustomerName) CustomerFullName,STATEMENTNO,SALECORP ");
strSql.Append(",(select top 1 DESCRIPTION from info_client where SHORTNAME=ch_fee.CustomerName) CustomerFullName,STATEMENTNO,SALECORP ");
strSql.Append(",(select TOP 1 VOUALLNO FROM cw_vouno_bs_gl WHERE BSGID=ch_fee.GID AND BSTABLENAME='ch_fee') VOUNO,ISNULL(ISDJY,0) ISDJY,INVLINKGID,DEBITAMOUNT ");
strSql.Append(",(select TOP 1 VOUALLNO FROM cw_vouno_bs_gl WHERE BSGID=ch_fee.GID AND BSTABLENAME='ch_fee') VOUNO,ISNULL(ISDJY,0) ISDJY,INVLINKGID,DEBITAMOUNT,BXGID ");
strSql.Append(",(select showname from [user] where gid=ch_fee.Auditoperator) Auditoperatorref,LOCALCURR,MANAGER ");
strSql.Append(",(select showname from [user] where gid=ch_fee.Auditoperator) Auditoperatorref,LOCALCURR,MANAGER ");
strSql.Append(",(select showname from [user] where gid=ch_fee.MANAGER) MANAGERREF ");
strSql.Append(",(select showname from [user] where gid=ch_fee.MANAGER) MANAGERREF ");
strSql.Append(",(select top 1 DESCRIPTION from info_client where SHORTNAME=ch_fee.CustomerName) CustomerFullName,STATEMENTNO,SALECORP ");
strSql.Append(",(select top 1 DESCRIPTION from info_client where SHORTNAME=ch_fee.CustomerName) CustomerFullName,STATEMENTNO,SALECORP ");
strSql.Append(",(select TOP 1 VOUALLNO FROM cw_vouno_bs_gl WHERE BSGID=ch_fee.GID AND BSTABLENAME='ch_fee') VOUNO,ISNULL(ISDJY,0) ISDJY,INVLINKGID,DEBITAMOUNT ");
strSql.Append(",(select TOP 1 VOUALLNO FROM cw_vouno_bs_gl WHERE BSGID=ch_fee.GID AND BSTABLENAME='ch_fee') VOUNO,ISNULL(ISDJY,0) ISDJY,INVLINKGID,DEBITAMOUNT,BXGID ");
strSql.Append(" (select top 1 showname from [user] where GID=op_other.CREATEUSER) as CREATEUSER, CREATETIME, (select top 1 showname from [user] where GID=op_other.MODIFIEDUSER) as MODIFIEDUSER, ");
strSql.Append(" (select top 1 showname from [user] where GID=op_other.CREATEUSER) as CREATEUSER, CREATETIME, (select top 1 showname from [user] where GID=op_other.MODIFIEDUSER) as MODIFIEDUSER, ");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",SALECORPID,(select [NAME] from [company] where GID=op_other.SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
strSql.Append(",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,op_other.BillFeeStatus FROM op_other");
StringstrSql="SELECT BSNO, OPLB, OPLBNAME, BSSTATUS, FEESTATUS, (CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF, (CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF, CUSTNO, MBLNO, HBLNO, CONTRACTNO, CUSTOMERNAME, CONVERT(char(10), BSDATE, 20) as BSDATE";
StringstrSql="SELECT BSNO, OPLB, OPLBNAME, BSSTATUS, FEESTATUS, (CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF, (CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF, CUSTNO, MBLNO, HBLNO, CONTRACTNO, CUSTOMERNAME, CONVERT(char(10), BSDATE, 20) as BSDATE";
strSql=strSql+", ACCDATE, BSSOURCE, BSSOURCEDETAIL, OP, CUSTSERVICE,FRCUSTSERVICE, SALE, CORPID, TRANSTYPE, VESSEL, VOYNO, CONVERT(char(10), ETD, 20) as ETD, PORTLOAD, PORTDISCHARGE, TRADETYPE, GOODSNAME, KGS, NETWEIGHT, PKGS, KINDPKGS, CBM,CTNALL,CTNNUM, ISVOU, VOUNO, REMARK, (select top 1 showname from [user] where GID=op_other.CREATEUSER) as CREATEUSER, CREATETIME, (select top 1 showname from [user] where GID=op_other.MODIFIEDUSER) as MODIFIEDUSER, MODIFIEDTIME, ORDERNO,OPERATOR,STLNAME,STLDATE,ENTERP,BOOKNO ";
strSql=strSql+", ACCDATE, BSSOURCE, BSSOURCEDETAIL, OP, CUSTSERVICE,FRCUSTSERVICE, SALE, CORPID, TRANSTYPE, VESSEL, VOYNO, CONVERT(char(10), ETD, 20) as ETD, PORTLOAD, PORTDISCHARGE, TRADETYPE, GOODSNAME, KGS, NETWEIGHT, PKGS, KINDPKGS, CBM,CTNALL,CTNNUM, ISVOU, VOUNO, REMARK, (select top 1 showname from [user] where GID=op_other.CREATEUSER) as CREATEUSER, CREATETIME, (select top 1 showname from [user] where GID=op_other.MODIFIEDUSER) as MODIFIEDUSER, MODIFIEDTIME, ORDERNO,OPERATOR,CUSTOMERNAME2,STLNAME,STLDATE,ENTERP,BOOKNO ";
strSql=strSql+",SALECORPID,(select [NAME] from [company] where GID=SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN";
strSql=strSql+",SALECORPID,(select [NAME] from [company] where GID=SALECORPID) as SALECORP,CLOSINGDATE,CLOSEDOCDATE,SALEDEPT,CUSTOMSER,WAREHOUSE,COUNTRYOFORIGIN";
strSql=strSql+",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT";
strSql=strSql+",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID = op_other.BSNO) as AMENDCOUNT";
strSql=strSql+",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,'' DRFEESTATUS,'' CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,BillFeeStatus FROM op_other";
strSql=strSql+",IsService1,IsService2,IsService3,IsService4,IsService5,IsService6,IsService7,IsService8,IsService9,IsService10,IsService11,IsService12,IsService13,IsService14,IsService15,IsService16,'' DRFEESTATUS,'' CRFEESTATUS,ISPRINTPR,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,BillFeeStatus FROM op_other";