$PBExportHeader$dw_rp_subid_mx_wb.srd $PBExportComments$By Kivens.Jiang(kivens@21cn.com) release 9; datawindow ( units=0 timer_interval=60000 color=16777215 processing=1 print.printername="" print.documentname="" print.orientation=0 print.margin.left=110 print.margin.right=110 print.margin.top=96 print.margin.bottom=96 print.paper.size=0 print.paper.source=0 print.canusedefaultprinter=yes grid.lines=0 selected.mouse=yes) header(height=416 color="536870912" ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=76 color="536870912" ) table(column=(type=datetime updatewhereclause=yes name=creddate dbname="cw_Balance.creddate" ) column=(type=long updatewhereclause=yes name=cmonth dbname="cw_Balance.cmonth" ) column=(type=long updatewhereclause=yes name=credno dbname="credno" ) column=(type=char(255) updatewhereclause=yes name=cw_credencemx_brief dbname="brief" ) column=(type=decimal(2) updatewhereclause=yes name=debit dbname="cw_Balance.Debit" ) column=(type=decimal(2) updatewhereclause=yes name=credit dbname="cw_Balance.Credit" ) column=(type=decimal(10) updatewhereclause=yes name=rate dbname="cw_Balance.rate" ) column=(type=decimal(2) updatewhereclause=yes name=rawdebit dbname="cw_Balance.rawdebit" ) column=(type=decimal(2) updatewhereclause=yes name=rawcredit dbname="cw_Balance.rawcredit" ) column=(type=decimal(2) updatewhereclause=yes name=balc dbname="balc" ) column=(type=decimal(2) updatewhereclause=yes name=rawbalc dbname="rawbalc" ) column=(type=long updatewhereclause=yes name=dw_sort dbname="dw_sort" ) column=(type=long updatewhereclause=yes name=fuluno dbname="fuluno" ) column=(type=long updatewhereclause=yes name=credid dbname="credid" ) retrieve=" SELECT null as creddate, cw_Balance.YearMon as cmonth, 0 as credno, '期初余额' as brief, null as Debit, null as Credit, null as rate, null as rawdebit, null as rawcredit, case isnull(cw_Balance.bDebit,0) - isnull(cw_Balance.bCredit,0) when 0 then null else isnull(cw_Balance.bDebit,0) - isnull(cw_Balance.bCredit,0) end as balc, case isnull(cw_Balance.brawDebit,0) - isnull(cw_Balance.brawCredit,0) when 0 then null else isnull(cw_Balance.brawDebit,0) - isnull(cw_Balance.brawCredit,0) end as rawbalc, 0 as dw_sort, 0 as fuluno, 0 as credid FROM cw_Balance WHERE ( cw_Balance.accsetid = :arg_accsetid ) AND ( cw_Balance.subaccsetid = :arg_subaccsetid ) AND ( cw_Balance.SubID = :arg_subid ) AND ( cw_Balance.YearMon >= :arg_firstmon or cw_Balance.YearMon is null ) AND ( cw_Balance.YearMon <= :arg_endmon or cw_Balance.YearMon is null ) union all SELECT cw_credence.creddate as creddate, cw_credence.cmonth as cmonth, cw_credence.credno as credno, case :arg_rel when 1 then ltrim(rtrim(cw_credencemx.brief)) + ' ' + case len(ltrim(rtrim(cw_credence.reldcode))) when 0 then '' else '相关号:'+ltrim(rtrim(cw_credence.reldcode)) end + ' '+ case reldate when null then '' else '相关日期:'+ convert(char(4),year(reldate))+'-'+convert(char(2),month(reldate))+'-'+ convert(char(2),day(reldate)) end else ltrim(rtrim(cw_credencemx.brief)) + ' ' + case len(ltrim(rtrim(cw_credence.reldcode))) when 0 then '' else '相关号:'+ltrim(rtrim(cw_credence.reldcode)) + ' '+ case reldate when null then '' else '相关日期:'+ convert(char(4),year(reldate))+'-'+convert(char(2),month(reldate))+'-'+ convert(char(2),day(reldate)) end end end + case when cw_credencemx.deptid = 0 then '' else '(部门:'+rtrim(cw_department.departmentname)+')' end + case when cw_credencemx.itemid = 0 then '' else '(项目:'+rtrim(cw_hsitem.hsitemname)+')' end + case when cw_credencemx.cusid = 0 then '' else '(客户:'+rtrim(u_cust.name)+')' end + case when cw_credencemx.sptid = 0 then '' else '(供应商:'+rtrim(u_spt.name)+')'end as brief, case cw_credencemx.debit when 0 then null else cw_credencemx.debit end as debit, case cw_credencemx.credit when 0 then null else cw_credencemx.credit end as credit , case cw_credencemx.rate when 0 then null else cw_credencemx.rate end as rate, case cw_credencemx.rawdebit when 0 then null else cw_credencemx.rawdebit end as rawdebit, case cw_credencemx.rawcredit when 0 then null else cw_credencemx.rawcredit end as rawcredit , 0.00 as balc, 0.00 as rawbalc, 1 as dw_sort, cw_credencemx.fuluno as fuluno , cw_credence.credid as credid FROM cw_credence, cw_credencemx left outer join cw_department on cw_credencemx.deptid = cw_department.departmentid left outer join cw_hsitem on cw_credencemx.itemid = cw_hsitem.hsitemid left outer join u_cust on cw_credencemx.cusid = u_cust.cusid left outer join u_spt on cw_credencemx.sptid = u_spt.sptid WHERE ( cw_credence.accsetid = cw_credencemx.accsetid ) and ( cw_credence.subaccsetid = cw_credencemx.subaccsetid ) and ( cw_credence.credid = cw_credencemx.credid ) and ( ( cw_credence.accsetid = :arg_accsetid ) AND ( cw_credence.subaccsetid = :arg_subaccsetid or :arg_subaccsetid = -1) AND ( cw_credence.cmonth >= :arg_firstmon ) AND ( cw_credence.cmonth <= :arg_endmon ) AND ( cw_credence.postflag = :arg_if_post or :arg_if_post = -1 ) AND ( left(cw_credencemx.subid,:arg_subid_len) = :arg_subid ) ) union all SELECT null as creddate, cw_credence.cmonth as cmonth, 0 as credno, '本期合计' as brief, case sum(cw_credencemx.debit) when 0 then null else sum(cw_credencemx.debit) end as debit, case sum(cw_credencemx.Credit) when 0 then null else sum(cw_credencemx.Credit) end as Credit, null as rate, case sum(cw_credencemx.rawdebit) when 0 then null else sum(cw_credencemx.rawdebit) end as rawdebit, case sum(cw_credencemx.rawCredit) when 0 then null else sum(cw_credencemx.rawCredit) end as rawCredit, 0.00 as balc, 0.00 as rawbalc, 2 as dw_sort, 0 as fuluno, 0 as credid FROM cw_credence, cw_credencemx WHERE ( cw_credence.accsetid = cw_credencemx.accsetid ) and ( cw_credence.subaccsetid = cw_credencemx.subaccsetid ) and ( cw_credence.credid = cw_credencemx.credid ) and ( ( cw_credence.accsetid = :arg_accsetid ) AND ( cw_credence.subaccsetid = :arg_subaccsetid or :arg_subaccsetid = -1 ) AND ( cw_credence.cmonth >= :arg_firstmon ) AND ( cw_credence.cmonth <= :arg_endmon ) AND ( cw_credence.postflag = :arg_if_post or :arg_if_post = -1 ) AND ( left(cw_credencemx.subid,:arg_subid_len) = :arg_subid ) ) group by cw_credence.cmonth union SELECT null as creddate, cw_Balance.YearMon as cmonth, 0 as credno, '本年累计' as brief, case cw_Balance.yDebit when 0 then null else cw_Balance.yDebit end as debit, case cw_Balance.yCredit when 0 then null else cw_Balance.yCredit end as Credit, null as rate, case cw_Balance.yrawDebit when 0 then null else cw_Balance.yrawDebit end as yrawDebit, case cw_Balance.yrawCredit when 0 then null else cw_Balance.yrawCredit end as yrawCredit, case cw_Balance.ybDebit - cw_Balance.ybCredit + cw_Balance.yDebit - cw_Balance.yCredit when 0 then null else cw_Balance.ybDebit - cw_Balance.ybCredit + cw_Balance.yDebit - cw_Balance.yCredit end as balc, case cw_Balance.ybrawDebit - cw_Balance.ybrawCredit + cw_Balance.yrawDebit - cw_Balance.yrawCredit when 0 then null else cw_Balance.ybrawDebit - cw_Balance.ybrawCredit + cw_Balance.yrawDebit - cw_Balance.yrawCredit end as rawbalc, 3 as dw_sort, 0 as fuluno, 0 as credid FROM cw_Balance WHERE ( cw_Balance.accsetid = :arg_accsetid ) AND (cw_Balance.subaccsetid = :arg_subaccsetid ) AND cw_Balance.SubID = :arg_subid AND cw_Balance.YearMon >= :arg_firstmon and cw_Balance.YearMon <= :arg_endmon " arguments=(("arg_accsetid", number), ("arg_subaccsetid", number), ("arg_subid", string), ("arg_subid_len", number), ("arg_if_post", number), ("arg_firstmon", number), ("arg_endmon", number), ("arg_rel", number)) sort="cmonth A, dw_sort A, credno A, creddate A" ) text(name=creddate_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="9" y="360" height="56" width="320" text="凭证日期" ) text(name=cmonth_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="338" y="360" height="56" width="238" text="期间" ) text(name=credno_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="585" y="360" height="56" width="155" text="编号" ) text(name=cw_credencemx_brief_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="750" y="360" height="56" width="923" text="摘要" ) text(name=rate_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="1682" y="360" height="56" width="219" text="汇率" ) text(name=t_1 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="1911" y="360" height="56" width="393" text="原币借方" ) text(name=debit_t visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="2313" y="360" height="56" width="375" text="本位币借方" ) text(name=t_2 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="2697" y="360" height="56" width="384" text="原币贷方" ) text(name=t_3 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="3090" y="360" height="56" width="361" text="本位币贷方" ) text(name=t_4 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="3461" y="360" height="56" width="105" text="" ) text(name=t_5 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="3575" y="360" height="56" width="389" text="原币余额" ) text(name=t_6 visible="1" band=header font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="2" border="2" x="3973" y="360" height="56" width="379" text="本位币余额" ) column(name=cw_credencemx_brief visible="1" tag="摘要" band=detail id=4 x="750" y="4" height="68" width="923" color="0" border="0" alignment="0" format="[general]" edit.focusrectangle=no edit.autohscroll=yes edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=40 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=credno visible="1" band=detail id=3 x="585" y="4" height="68" width="155" color="0" border="0" alignment="2" format="[general]" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=cmonth visible="1" band=detail id=2 x="338" y="4" height="68" width="238" color="0" border="0" alignment="2" format="[general]" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=creddate visible="1" band=detail id=1 x="9" y="4" height="68" width="320" color="0" border="0" alignment="2" format="yyyy-mm-dd" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=rate visible="1" band=detail id=7 x="1682" y="4" height="68" width="219" color="0" border="0" alignment="1" format="#,###.##########" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) compute(name=compute_1 visible="1" band=detail font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" x="3461" y="4" height="68" width="105" format="[general]" expression="if( balc =0 or isnull(balc),'平',if( balc >0,'借','贷'))" alignment="2" border="0" crosstab.repeat=no ) compute(name=balc2 visible="1" band=detail font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0 if( balc2 =0,rgb(255,255,255),rgb(0,0,0))" x="3973" y="4" height="68" width="379" format="#,##0.00" expression="abs( balc )" alignment="1" border="0" crosstab.repeat=no ) compute(name=rawbalc2 visible="1" band=detail font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0 if( rawbalc2 =0,rgb(255,255,255),rgb(0,0,0))" x="3575" y="4" height="68" width="389" format="#,##0.00" expression="abs( rawbalc )" alignment="1" border="0" crosstab.repeat=no ) column(name=credit visible="1" band=detail id=6 x="3090" y="4" height="68" width="361" color="0 if( credit =0,rgb(255,255,255),rgb(0,0,0))" border="0" alignment="1" format="#,##0.00" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="2" background.color="16777215" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=rawcredit visible="1" band=detail id=9 x="2697" y="4" height="68" width="384" color="0 if( rawcredit =0,rgb(255,255,255),rgb(0,0,0))" border="0" alignment="1" format="#,##0.00" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=debit visible="1" band=detail id=5 x="2313" y="4" height="68" width="375" color="0 if( debit =0,rgb(255,255,255),rgb(0,0,0))" border="0" alignment="1" format="#,##0.00" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) column(name=rawdebit visible="1" band=detail id=8 x="1911" y="4" height="68" width="393" color="0 if( rawdebit =0,rgb(255,255,255),rgb(0,0,0))" border="0" alignment="1" format="#,##0.00" edit.autohscroll=no edit.autoselect=yes edit.autovscroll=no edit.case=any edit.codetable=no edit.displayonly=no edit.hscrollbar=no edit.imemode=0 edit.limit=0 edit.password=no edit.vscrollbar=no edit.validatecode=no edit.nilisnull=no edit.required=no criteria.required=no criteria.override_edit=no crosstab.repeat=no background.mode="1" background.color="536870912" font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" tabsequence=0 ) text(name=bar visible="1" band=foreground font.charset="0" font.face="Arial" font.family="2" font.height="-12" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" alignment="0" border="0" x="0" y="0" height="356" width="4398" text="" ) text(name=title visible="1" band=foreground font.charset="134" font.face="黑体" font.family="0" font.height="-18" font.pitch="2" font.weight="700" background.mode="2" background.color="16777215" color="0" alignment="0" border="0" x="14" y="8" height="108" width="1819" text="明细分类帐" ) compute(name=compute_2 visible="1" band=foreground font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" x="14" y="132" height="56" width="1701" format="[general]" expression="~"单位名称:~"+f_rst_Cropname()" alignment="0" border="0" crosstab.repeat=no ) text(name=subname visible="1" band=foreground font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" alignment="0" border="0" x="14" y="200" height="56" width="3017" text="" ) compute(name=compute_3 visible="1" band=foreground font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" x="14" y="268" height="56" width="3008" format="[general]" expression="'打印时间: '+string(today(),'yyyy-mm-dd hh:mm:ss')+ ' 第 ' + string(page()) + ' 页/ 共 '+string(pageCount())+' 页'" alignment="1" border="0" crosstab.repeat=no ) text(name=month visible="1" band=foreground font.charset="134" font.face="宋体" font.family="0" font.height="-9" font.pitch="2" font.weight="400" background.mode="2" background.color="16777215" color="0" alignment="0" border="0" x="1733" y="132" height="56" width="1298" text="" ) htmltable(border="1" ) htmlgen(clientComputedFields="1" clientEvents="1" clientFormatting="0" clientScriptable="0" clientValidation="1" generateJavaScript="1" netscapeLayers="0" netscapelayers="0" encodeSelfLinkArgs="1" ) export.xml(headGroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 distill.customPostScript="0" xslfop.print="0" )