diff --git a/ICSSoft.FromERP/SK/YERP_004.cs b/ICSSoft.FromERP/SK/YERP_004.cs index f33a88e..8b95358 100644 --- a/ICSSoft.FromERP/SK/YERP_004.cs +++ b/ICSSoft.FromERP/SK/YERP_004.cs @@ -161,7 +161,10 @@ GROUP BY SPTDOC,imonth,iday - select YYYY as Created_Year,MM as Created_Month,YYYY,MM,DD,A.SPTDOC,SMR,DBTO_AMT DBTO,CRDTO_AMT CRDTO,INVT,BLNC,WH_CST,TRNSF_CST,XBT_CST,NLD_CST,SMPL_CST,TRNSF_AGNC_CST,ADTV,NCLSN_CST,SVC_CST from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday + select YYYY as Created_Year,MM as Created_Month,YYYY,MM,DD,A.SPTDOC,SMR,DBTO_AMT DBTO,CRDTO_AMT CRDTO,INVT, + BLNC,WH_CST,TRNSF_CST,XBT_CST,NLD_CST,SMPL_CST,TRNSF_AGNC_CST,ADTV,NCLSN_CST,SVC_CST + from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday + where A.SPTDOC not in ('记-0253','记-0254') rollback transaction "; diff --git a/ICSSoft.FromERP/SK/YERP_006.cs b/ICSSoft.FromERP/SK/YERP_006.cs index 8fd2e43..aa1b97c 100644 --- a/ICSSoft.FromERP/SK/YERP_006.cs +++ b/ICSSoft.FromERP/SK/YERP_006.cs @@ -200,7 +200,7 @@ namespace ICSSoft.FromERP insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name - where a.iYear=2024 and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null + where a.iYear={2} and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null set @i=@i +1 end @@ -231,7 +231,7 @@ namespace ICSSoft.FromERP rollback transaction "; - sql04s = string.Format(sql04s, beginPeriod, endPeriod); + sql04s = string.Format(sql04s, beginPeriod, endPeriod, Date); log.Info("YERP_006_004查询 sql:" + sql04s); DataTable vbs04dt = ICSHelper.ExecuteTable(conStr, sql04s); log.Info("YERP_006_004查询 sql结果数量" + vbs04dt.Rows.Count); @@ -368,22 +368,22 @@ GROUP BY --where SMR ='本月合计' --order by MM -if exists(select 1 from tempdb..sysobjects with(nolock) where name='tmpuf_63Code' and xtype='u') -drop table tempdb..tmpuf_63Code -select bbank,bcash,bCashItem,bcDefine1,bcDefine10,bcDefine11,bcDefine12,bcDefine13,bcDefine14,bcDefine15 -,bcDefine16,bcDefine2,bcDefine3,bcDefine4,bcDefine5,bcDefine6,bcDefine7,bcDefine8,bcDefine9,bclose,bcus -,bd_c,bdept,be,bend,bexchange,bGCJS,bitem,bparacc,bpardiff,bperson,bproperty,br,bReport,bsup,bused -,cass_item,cbook_type,cbook_type_engl,cclass,cclass_engl,cclassany,cclassany_engl,ccode,ccode_engl -,ccode_name,cexch_name,cgather,chelp,cmeasure,cother,cUserDefineType,dbegin,dend,dModifyDate -,igrade,iotherused,itrans,iViewItem,iyear -into tempdb..tmpuf_63Code from code with(nolock) where 1=1 and iyear={2} - - exec GL_Ledger @tblname=N'tmpuf_63',@KmCode=N'6801',@beginPeriod={3},@endPeriod={4},@bVouch=0,@bequal=0,@sum=0,@bMJ=0,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 +--if exists(select 1 from tempdb..sysobjects with(nolock) where name='tmpuf_63Code' and xtype='u') +--drop table tempdb..tmpuf_63Code +--select bbank,bcash,bCashItem,bcDefine1,bcDefine10,bcDefine11,bcDefine12,bcDefine13,bcDefine14,bcDefine15 +--,bcDefine16,bcDefine2,bcDefine3,bcDefine4,bcDefine5,bcDefine6,bcDefine7,bcDefine8,bcDefine9,bclose,bcus +--,bd_c,bdept,be,bend,bexchange,bGCJS,bitem,bparacc,bpardiff,bperson,bproperty,br,bReport,bsup,bused +--,cass_item,cbook_type,cbook_type_engl,cclass,cclass_engl,cclassany,cclassany_engl,ccode,ccode_engl +--,ccode_name,cexch_name,cgather,chelp,cmeasure,cother,cUserDefineType,dbegin,dend,dModifyDate +--,igrade,iotherused,itrans,iViewItem,iyear +--into tempdb..tmpuf_63Code from code with(nolock) where 1=1 and iyear={2} + +-- exec GL_Ledger @tblname=N'tmpuf_63',@KmCode=N'6801',@beginPeriod={3},@endPeriod={4},@bVouch=0,@bequal=0,@sum=0,@bMJ=0,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 - select A.SPTDOC as SPTDOC_NO,YYYY as Created_Year,MM as Created_Month,YYYY,MM,SMR,DBTO_AMT DBTO,c.tmpme as INCOME_TAX + select A.SPTDOC as SPTDOC_NO,YYYY as Created_Year,MM as Created_Month,YYYY,MM,SMR,DBTO_AMT DBTO -- + ISNULL(c.tmpme,0) from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday - left join tempdb..tmpuf_63 c on a.YYYY = c.iyear and a.MM = c.imonth and c.cdcode = '应交税费(2221)' + --left join tempdb..tmpuf_63 c on a.YYYY = c.iyear and a.MM = c.imonth and c.cdcode = '应交税费(2221)' where SMR ='本月合计' order by MM @@ -456,7 +456,7 @@ rollback transaction insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name - where a.iYear=2024 and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null + where a.iYear={2} and ( bclose=0 and ( ccode like N'5601%' or ccode_name like N'5601%' or ccode_engl like N'5601%' or chelp like N'5601%' )) and ccode <>'5601' and b.SPTDOC is null set @i=@i +1 end @@ -467,15 +467,15 @@ rollback transaction SELECT SPTDOC,imonth,iday, - SUM(CASE WHEN SBJ_CD = '660101' THEN DBTO_AMT ELSE 0 END) WH_CST, - SUM(CASE WHEN SBJ_CD = '660102' THEN DBTO_AMT ELSE 0 END) TRNSF_CST, - SUM(CASE WHEN SBJ_CD = '660103' THEN DBTO_AMT ELSE 0 END) XBT_CST, - SUM(CASE WHEN SBJ_CD = '660104' THEN DBTO_AMT ELSE 0 END) NLD_CST, - SUM(CASE WHEN SBJ_CD = '660105' THEN DBTO_AMT ELSE 0 END) SMPL_CST, - SUM(CASE WHEN SBJ_CD = '660106' THEN DBTO_AMT ELSE 0 END) TRNSF_AGNC_CST, - SUM(CASE WHEN SBJ_CD = '660107' THEN DBTO_AMT ELSE 0 END) ADTV, - SUM(CASE WHEN SBJ_CD = '660108' THEN DBTO_AMT ELSE 0 END) NCLSN_CST, - SUM(CASE WHEN SBJ_CD = '660109' THEN DBTO_AMT ELSE 0 END) SVC_CST + SUM(CASE WHEN SBJ_CD = '560101' THEN DBTO_AMT ELSE 0 END) WH_CST, + SUM(CASE WHEN SBJ_CD = '560102' THEN DBTO_AMT ELSE 0 END) TRNSF_CST, + SUM(CASE WHEN SBJ_CD = '560103' THEN DBTO_AMT ELSE 0 END) XBT_CST, + SUM(CASE WHEN SBJ_CD = '560104' THEN DBTO_AMT ELSE 0 END) NLD_CST, + SUM(CASE WHEN SBJ_CD = '560105' THEN DBTO_AMT ELSE 0 END) SMPL_CST, + SUM(CASE WHEN SBJ_CD = '560106' THEN DBTO_AMT ELSE 0 END) TRNSF_AGNC_CST, + SUM(CASE WHEN SBJ_CD = '560107' THEN DBTO_AMT ELSE 0 END) ADTV, + SUM(CASE WHEN SBJ_CD = '560108' THEN DBTO_AMT ELSE 0 END) NCLSN_CST, + SUM(CASE WHEN SBJ_CD = '560109' THEN DBTO_AMT ELSE 0 END) SVC_CST into #test9 FROM #test6 @@ -487,7 +487,7 @@ rollback transaction rollback transaction "; - sqlsgz04 = string.Format(sqlsgz04, beginPeriod, endPeriod); + sqlsgz04 = string.Format(sqlsgz04, beginPeriod, endPeriod, Date); log.Info("YERP_006_004查询 sql:" + sqlsgz04); DataTable vbsgz04dt = ICSHelper.ExecuteTable(conStr, sqlsgz04); log.Info("YERP_006_004查询 sql结果数量" + vbsgz04dt.Rows.Count); @@ -606,22 +606,22 @@ GROUP BY --where SMR ='本月合计' --order by MM -if exists(select 1 from tempdb..sysobjects with(nolock) where name='tmpuf_63Code' and xtype='u') -drop table tempdb..tmpuf_63Code -select bbank,bcash,bCashItem,bcDefine1,bcDefine10,bcDefine11,bcDefine12,bcDefine13,bcDefine14,bcDefine15 -,bcDefine16,bcDefine2,bcDefine3,bcDefine4,bcDefine5,bcDefine6,bcDefine7,bcDefine8,bcDefine9,bclose,bcus -,bd_c,bdept,be,bend,bexchange,bGCJS,bitem,bparacc,bpardiff,bperson,bproperty,br,bReport,bsup,bused -,cass_item,cbook_type,cbook_type_engl,cclass,cclass_engl,cclassany,cclassany_engl,ccode,ccode_engl -,ccode_name,cexch_name,cgather,chelp,cmeasure,cother,cUserDefineType,dbegin,dend,dModifyDate -,igrade,iotherused,itrans,iViewItem,iyear -into tempdb..tmpuf_63Code from code with(nolock) where 1=1 and iyear={2} - - exec GL_Ledger @tblname=N'tmpuf_63',@KmCode=N'5801',@beginPeriod={3},@endPeriod={4},@bVouch=0,@bequal=0,@sum=0,@bMJ=0,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 +--if exists(select 1 from tempdb..sysobjects with(nolock) where name='tmpuf_63Code' and xtype='u') +--drop table tempdb..tmpuf_63Code +--select bbank,bcash,bCashItem,bcDefine1,bcDefine10,bcDefine11,bcDefine12,bcDefine13,bcDefine14,bcDefine15 +--,bcDefine16,bcDefine2,bcDefine3,bcDefine4,bcDefine5,bcDefine6,bcDefine7,bcDefine8,bcDefine9,bclose,bcus +--,bd_c,bdept,be,bend,bexchange,bGCJS,bitem,bparacc,bpardiff,bperson,bproperty,br,bReport,bsup,bused +--,cass_item,cbook_type,cbook_type_engl,cclass,cclass_engl,cclassany,cclassany_engl,ccode,ccode_engl +--,ccode_name,cexch_name,cgather,chelp,cmeasure,cother,cUserDefineType,dbegin,dend,dModifyDate +--,igrade,iotherused,itrans,iViewItem,iyear +--into tempdb..tmpuf_63Code from code with(nolock) where 1=1 and iyear={2} + +-- exec GL_Ledger @tblname=N'tmpuf_63',@KmCode=N'5801',@beginPeriod={3},@endPeriod={4},@bVouch=0,@bequal=0,@sum=0,@bMJ=0,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 - select A.SPTDOC as SPTDOC_NO,YYYY as Created_Year,MM as Created_Month,YYYY,MM,SMR,DBTO_AMT DBTO,c.tmpme as INCOME_TAX + select A.SPTDOC as SPTDOC_NO,YYYY as Created_Year,MM as Created_Month,YYYY,MM,SMR,DBTO_AMT DBTO -- + ISNULL(c.tmpme,0) from #test5 a left join #test9 b on a.SPTDOC=b.SPTDOC and a.MM=b.imonth and a.DD=b.iday - left join tempdb..tmpuf_63 c on a.YYYY = c.iyear and a.MM = c.imonth and c.cdcode = '应交税费(2221)' + --left join tempdb..tmpuf_63 c on a.YYYY = c.iyear and a.MM = c.imonth and c.cdcode = '应交税费(2221)' where SMR ='本月合计' order by MM @@ -656,7 +656,7 @@ rollback transaction //soapRequestData.Append(itemRow["SPTDOC_NO"] != null ? "" + itemRow["SPTDOC_NO"].ToString() + "" : "" + ""); soapRequestData.Append(itemRow["SMR"] != null ? "" + 100 + "" : "" + ""); soapRequestData.Append(itemRow["DBTO"] != null ? "" + itemRow["DBTO"].ToString() + "" : "" + ""); - soapRequestData.Append(itemRow["INCOME_TAX"] != null ? "" + itemRow["INCOME_TAX"].ToString() + "" : "" + ""); + //soapRequestData.Append(itemRow["INCOME_TAX"] != null ? "" + itemRow["INCOME_TAX"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["CRDTO"] != null ? "" + itemRow["CRDTO"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["DBTO_CRDTO_DVSN"] != null ? "" + itemRow["DBTO_CRDTO_DVSN"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["BLNC"] != null ? "" + itemRow["BLNC"].ToString() + "" : "" + ""); @@ -729,10 +729,10 @@ rollback transaction if (!exists) { soapRequestData.Append(""); - soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); - soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); - soapRequestData.Append(item["DD"] != null ? "
" + item["DD"].ToString() + "
" : "
" + "
"); - soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); + soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); + soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); + //soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); + soapRequestData.Append("" + 100 + ""); soapRequestData.Append(item["SMPL_CST"] != null ? "" + item["SMPL_CST"].ToString() + "" : "" + ""); soapRequestData.Append("
"); } @@ -740,10 +740,10 @@ rollback transaction else { soapRequestData.Append(""); - soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); - soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); - soapRequestData.Append(item["DD"] != null ? "
" + item["DD"].ToString() + "
" : "
" + "
"); - soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); + soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); + soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); + soapRequestData.Append("" + 100 + ""); + //soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); soapRequestData.Append(item["SMPL_CST"] != null ? "" + item["SMPL_CST"].ToString() + "" : "" + ""); soapRequestData.Append("
"); } @@ -766,7 +766,7 @@ rollback transaction //soapRequestData.Append(itemRow["SPTDOC_NO"] != null ? "" + itemRow["SPTDOC_NO"].ToString() + "" : "" + ""); soapRequestData.Append(itemRow["SMR"] != null ? "" + 200 + "" : "" + ""); soapRequestData.Append(itemRow["DBTO"] != null ? "" + itemRow["DBTO"].ToString() + "" : "" + ""); - soapRequestData.Append(itemRow["INCOME_TAX"] != null ? "" + itemRow["INCOME_TAX"].ToString() + "" : "" + ""); + //soapRequestData.Append(itemRow["INCOME_TAX"] != null ? "" + itemRow["INCOME_TAX"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["CRDTO"] != null ? "" + itemRow["CRDTO"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["DBTO_CRDTO_DVSN"] != null ? "" + itemRow["DBTO_CRDTO_DVSN"].ToString() + "" : "" + ""); //soapRequestData.Append(itemRow["BLNC"] != null ? "" + itemRow["BLNC"].ToString() + "" : "" + ""); @@ -839,10 +839,10 @@ rollback transaction if (!exists) { soapRequestData.Append(""); - soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); - soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); - soapRequestData.Append(item["DD"] != null ? "
" + item["DD"].ToString() + "
" : "
" + "
"); - soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); + soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); + soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); + soapRequestData.Append("" + 200 + ""); + //soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); soapRequestData.Append(item["SMPL_CST"] != null ? "" + item["SMPL_CST"].ToString() + "" : "" + ""); soapRequestData.Append("
"); } @@ -850,10 +850,10 @@ rollback transaction else { soapRequestData.Append(""); - soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); - soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); - soapRequestData.Append(item["DD"] != null ? "
" + item["DD"].ToString() + "
" : "
" + "
"); - soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); + soapRequestData.Append(item["YYYY"] != null ? "" + item["YYYY"].ToString() + "" : "" + ""); + soapRequestData.Append(item["MM"] != null ? "" + item["MM"].ToString() + "" : "" + ""); + soapRequestData.Append("" + 200 + ""); + //soapRequestData.Append(item["SPTDOC_NO"] != null ? "" + item["SPTDOC_NO"].ToString() + "" : "" + ""); soapRequestData.Append(item["SMPL_CST"] != null ? "" + item["SMPL_CST"].ToString() + "" : "" + ""); soapRequestData.Append("
"); } diff --git a/ICSSoft.FromERP/SK/YERP_007.cs b/ICSSoft.FromERP/SK/YERP_007.cs index d237961..810c84b 100644 --- a/ICSSoft.FromERP/SK/YERP_007.cs +++ b/ICSSoft.FromERP/SK/YERP_007.cs @@ -95,8 +95,8 @@ namespace ICSSoft.FromERP string Date = Dates.ToString("yyyy"); string beginMuoth = Dates.AddMonths(-1).ToString("MM"); string endMuoth = Dates.AddMonths(-1).ToString("MM"); - var beginPeriod = Date + beginMuoth; //"202407";//Date + beginMuoth; - var endPeriod = Date + endMuoth;// "202407";// Date + endMuoth; + var beginPeriod = Date + beginMuoth; //"202409"; + var endPeriod = Date + endMuoth; //"202409"; string sqls = @" begin transaction @@ -420,7 +420,7 @@ namespace ICSSoft.FromERP string sqlsgz = @" begin transaction - exec GL_Ledger @tblname=N'cwfymxz',@KmCode=N'6603',@beginPeriod='{0}',@endPeriod='{1}',@bVouch=0,@bequal=1,@sum=0,@bMJ=1,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 + exec GL_Ledger @tblname=N'cwfymxz',@KmCode=N'5603',@beginPeriod='{0}',@endPeriod='{1}',@bVouch=0,@bequal=1,@sum=0,@bMJ=1,@swhere=N'',@sAuth=N'',@ReportID=N'GL13',@ReportType=0,@iUnite=0 --select * from tempdb..cwfymxz @@ -872,7 +872,7 @@ namespace ICSSoft.FromERP var datatemp = new TempDatas { YYYY = itemRow["Created_Year"].ToString(), - MM = itemRow["MM"].ToString(), + MM = itemRow["Created_Month"].ToString(), }; datasrrows_gz.Add(datatemp); } @@ -888,7 +888,7 @@ namespace ICSSoft.FromERP var datatemp = new TempDatas { YYYY = itemRow["Created_Year"].ToString(), - MM = itemRow["MM"].ToString(), + MM = itemRow["Created_Month"].ToString(), }; datazcrows_gz.Add(datatemp); }