strSql.Append(",(select STLNAME from [code_stlmode] where STLCODE=i.SETTLETYPE) as SETTLETYPEREF");
strSql.Append(",(select CODENAME+'_'+bankname from info_client_bank where gid=i.CUSTACCOUNTGID) CUSTBANKNAME");
strSql.Append(",(select ACCOUNT from info_client_bank where gid=i.CUSTACCOUNTGID) CUSTACCOUNT");
strSql.Append(",ISNULL((select sum(isnull(amount,0)-isnull(invoice,0)) as noinvoice from ch_fee WITH (NOLOCK) where isnull(ISINVOICE,0)<>1 and EXISTS (select 1 from ch_fee_do WITH (NOLOCK) where ch_fee_do.FEEID=ch_fee.gid and ch_fee_do.BILLNO=cm.BILLNO)),0) as NOINVOICE");
strSql.Append(",ISNULL((select sum(isnull(amount,0)-isnull(invoice,0)) as noinvoice from ch_fee WITH (NOLOCK) where isnull(ISINVOICE,0)<>1 and EXISTS (select 1 from ch_fee_do WITH (NOLOCK) where ch_fee_do.FEEID=ch_fee.gid and ch_fee_do.BILLNO=i.BILLNO)),0) as NOINVOICE");
strSql.Append(",i.BS_CUSTOMERNAME,dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'"+userid+"',wu.stepno) as IsAudit ");