FrmReceivableStrikeStatistics.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmReceivableStrikeStatistics">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="应收款统计";
  9. GetSchema();
  10. txtCoNo.CValue=GetCurrentCompanyNo();
  11. txtCoName.CValue=GetCurrentCompanyShortName();
  12. ComboCompany.Enabled = false;
  13. Empty();
  14. NewInstance();
  15. ]]>
  16. </Load>
  17. <Closing>
  18. ;
  19. </Closing>
  20. <Closed>
  21. ;
  22. </Closed>
  23. </Events>
  24. <Mode>
  25. <Search>
  26. <Lable name="Search"/>
  27. </Search>
  28. </Mode>
  29. <Controls>
  30. <IKComboBoxEx name="comboYear" DisplaySource="UI.Start_Year" DataSource="BillYear" DisplayMember="Bill_Year" >
  31. <Events>
  32. <Reload>
  33. UpdateForm(false, "comboYear");
  34. Search("SearchYearr");
  35. UpdateForm(true, "comboYear");
  36. </Reload>
  37. </Events>
  38. </IKComboBoxEx>
  39. <IKComboBoxEx name="comboFlag" DisplaySource="UI.Start_Month" DataSource="HalfYear" DisplayMember="Half_Year" >
  40. <Events>
  41. <Reload>
  42. UpdateForm(false, "comboFlag");
  43. Search("SearchHalfYear");
  44. UpdateForm(true, "comboFlag");
  45. </Reload>
  46. </Events>
  47. </IKComboBoxEx>
  48. <IKTextButton name="tbCustomerNo1" DataSource="UI.StartNo_Customer">
  49. <Events>
  50. <Click>
  51. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue);
  52. if( @temp == "" )
  53. return;
  54. tbCustomerNo1.CValue = @temp;
  55. </Click>
  56. <TextBoxButtonTextChanged>
  57. tbCustomerNo2.CValue = tbCustomerNo1.CValue;
  58. </TextBoxButtonTextChanged>
  59. </Events>
  60. </IKTextButton>
  61. <IKTextButton name="tbCustomerNo2" DataSource="UI.EndNo_Customer">
  62. <Events>
  63. <Click>
  64. @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue);
  65. if( @temp == "" )
  66. return;
  67. tbCustomerNo2.CValue = @temp;
  68. </Click>
  69. </Events>
  70. </IKTextButton>
  71. <IKCheckBox name="ikCheckCompany" DataSource="UI.Company_Flag">
  72. <Events>
  73. <CheckedChanged>
  74. ComboCompany.Enabled = !ComboCompany.Enabled;
  75. </CheckedChanged>
  76. </Events>
  77. </IKCheckBox>
  78. <IKComboBoxEx name="ComboCompany" DisplaySource="UI.Company_Name" DataSource="CompanyType" DisplayMember="Name_TypeDef" >
  79. <Events>
  80. <Reload>
  81. UpdateForm(false, "ComboCompany");
  82. Search("SearchCompany");
  83. UpdateForm(true, "ComboCompany");
  84. </Reload>
  85. </Events>
  86. </IKComboBoxEx>
  87. <IKButton name="btnView">
  88. <Events>
  89. <Click>
  90. UpdateForm(false,"");
  91. @Start_Year = DBNull();
  92. @Start_Month = 0;
  93. @StartNo_Customer = DBNull();
  94. @EndNo_Customer = DBNull();
  95. @Company_Name = "";
  96. if (comboYear.Text =="" )
  97. {
  98. MessageBox("清选泽起始年份!!");
  99. return;
  100. }
  101. else
  102. {
  103. @Start_Year = comboYear.Text;
  104. }
  105. if (comboFlag.Text == "" )
  106. {
  107. MessageBox("清选泽起始月份!!");
  108. return;
  109. }
  110. else
  111. {
  112. @Start_Month = comboFlag.Text;
  113. }
  114. if(tbCustomerNo1.CValue != "")
  115. @StartNo_Customer = tbCustomerNo1.CValue;
  116. if(tbCustomerNo2.CValue != "")
  117. @EndNo_Customer = tbCustomerNo2.CValue;
  118. if( ikCheckCompany.Checked ){
  119. if (ComboCompany.Text !=""){
  120. #UI.company_Name = ComboCompany.Text;
  121. @Company_Name = ComboCompany.Text;
  122. }else{
  123. MessageBox("请选泽所属公司!!");
  124. #UI.company_Name = "";
  125. @Company_Name = "";
  126. return;
  127. }
  128. } else {
  129. #UI.company_Name = "";
  130. @Company_Name = "";
  131. }
  132. Search("SearchReceivableStrikeStatistics",@Start_Year,@Start_Month,@StartNo_Customer,@EndNo_Customer,@Company_Name);
  133. if(RowCount("#FrmReceivableStrikeStatistics")==0)
  134. MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
  135. else
  136. PrintReport("UIFrmReceivableStrikeStatistics","UI","FrmReceivableStrikeStatistics");
  137. </Click>
  138. </Events>
  139. </IKButton>
  140. <IKButton name="btnExcel">
  141. <Events>
  142. <Click>
  143. UpdateForm(false,"");
  144. @Start_Year = DBNull();
  145. @Start_Month = 0;
  146. @StartNo_Customer = DBNull();
  147. @EndNo_Customer = DBNull();
  148. @Company_Name = "";
  149. if (comboYear.Text =="" )
  150. {
  151. MessageBox("清选泽起始年份!!");
  152. return;
  153. }
  154. else
  155. {
  156. @Start_Year = comboYear.Text;
  157. }
  158. if (comboFlag.Text == "" )
  159. {
  160. MessageBox("清选泽起始月份!!");
  161. return;
  162. }
  163. else
  164. {
  165. @Start_Month = comboFlag.Text;
  166. }
  167. if(tbCustomerNo1.CValue != "")
  168. @StartNo_Customer = tbCustomerNo1.CValue;
  169. if(tbCustomerNo2.CValue != "")
  170. @EndNo_Customer = tbCustomerNo2.CValue;
  171. if( ikCheckCompany.Checked ){
  172. if (ComboCompany.Text !=""){
  173. #UI.company_Name = ComboCompany.Text;
  174. @Company_Name = ComboCompany.Text;
  175. }else{
  176. MessageBox("请选泽所属公司!!");
  177. #UI.company_Name = "";
  178. @Company_Name = "";
  179. return;
  180. }
  181. } else {
  182. #UI.company_Name = "";
  183. @Company_Name = "";
  184. }
  185. Search("SearchReceivableStrikeStatistics",@Start_Year,@Start_Month,@StartNo_Customer,@EndNo_Customer,@Company_Name);
  186. if(RowCount("#FrmReceivableStrikeStatistics")==0)
  187. MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
  188. else
  189. ExportReport("Excel","UI","FrmReceivableStrikeStatistics");
  190. </Click>
  191. </Events>
  192. </IKButton>
  193. <IKButton name="btnWord">
  194. <Events>
  195. <Click>
  196. UpdateForm(false,"");
  197. @Start_Year = DBNull();
  198. @Start_Month = 0;
  199. @StartNo_Customer = DBNull();
  200. @EndNo_Customer = DBNull();
  201. @Company_Name = "";
  202. if (comboYear.Text =="" )
  203. {
  204. MessageBox("清选泽起始年份!!");
  205. return;
  206. }
  207. else
  208. {
  209. @Start_Year = comboYear.Text;
  210. }
  211. if (comboFlag.Text == "" )
  212. {
  213. MessageBox("清选泽起始月份!!");
  214. return;
  215. }
  216. else
  217. {
  218. @Start_Month = comboFlag.Text;
  219. }
  220. if(tbCustomerNo1.CValue != "")
  221. @StartNo_Customer = tbCustomerNo1.CValue;
  222. if(tbCustomerNo2.CValue != "")
  223. @EndNo_Customer = tbCustomerNo2.CValue;
  224. if( ikCheckCompany.Checked ){
  225. if (ComboCompany.Text !=""){
  226. #UI.company_Name = ComboCompany.Text;
  227. @Company_Name = ComboCompany.Text;
  228. }else{
  229. MessageBox("请选泽所属公司!!");
  230. #UI.company_Name = "";
  231. @Company_Name = "";
  232. return;
  233. }
  234. } else {
  235. #UI.company_Name = "";
  236. @Company_Name = "";
  237. }
  238. Search("SearchReceivableStrikeStatistics",@Start_Year,@Start_Month,@StartNo_Customer,@EndNo_Customer,@Company_Name);
  239. if(RowCount("#FrmReceivableStrikeStatistics")==0)
  240. MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
  241. else
  242. ExportReport("Word","UI","FrmReceivableStrikeStatistics");
  243. </Click>
  244. </Events>
  245. </IKButton>
  246. <IKButton name="btnPrint">
  247. <Events>
  248. <Click>
  249. UpdateForm(false,"");
  250. @Start_Year = DBNull();
  251. @Start_Month = 0;
  252. @StartNo_Customer = DBNull();
  253. @EndNo_Customer = DBNull();
  254. @Company_Name = "";
  255. if (comboYear.Text =="" )
  256. {
  257. MessageBox("清选泽起始年份!!");
  258. return;
  259. }
  260. else
  261. {
  262. @Start_Year = comboYear.Text;
  263. }
  264. if (comboFlag.Text == "" )
  265. {
  266. MessageBox("清选泽起始月份!!");
  267. return;
  268. }
  269. else
  270. {
  271. @Start_Month = comboFlag.Text;
  272. }
  273. if(tbCustomerNo1.CValue != "")
  274. @StartNo_Customer = tbCustomerNo1.CValue;
  275. if(tbCustomerNo2.CValue != "")
  276. @EndNo_Customer = tbCustomerNo2.CValue;
  277. if( ikCheckCompany.Checked ){
  278. if (ComboCompany.Text !=""){
  279. #UI.company_Name = ComboCompany.Text;
  280. @Company_Name = ComboCompany.Text;
  281. }else{
  282. MessageBox("请选泽所属公司!!");
  283. #UI.company_Name = "";
  284. @Company_Name = "";
  285. return;
  286. }
  287. } else {
  288. #UI.company_Name = "";
  289. @Company_Name = "";
  290. }
  291. Search("SearchReceivableStrikeStatistics",@Start_Year,@Start_Month,@StartNo_Customer,@EndNo_Customer,@Company_Name);
  292. if(RowCount("#FrmReceivableStrikeStatistics")==0)
  293. MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
  294. else
  295. ExportReport("PrintToPrinter","UIFrmReceivableStrikeStatistics","UI","FrmReceivableStrikeStatistics");
  296. </Click>
  297. </Events>
  298. </IKButton>
  299. </Controls>
  300. <ChildForms>
  301. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
  302. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  303. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  304. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  305. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  306. </ChildForm>
  307. </ChildForms>
  308. <FormatString>
  309. <Format name="SearchCustomerCondition">
  310. if(GetRight("客户基本资料","全权查看"))
  311. FormatString("");
  312. else
  313. FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
  314. </Format>
  315. </FormatString>
  316. </Client>
  317. <Server>
  318. <Tables>
  319. <Table name="UI" Type="Parent">
  320. <GetSchema CmdType="Text" CmdText="Select TOP 0 convert(nvarchar(12),'') As Start_Year
  321. ,convert(nvarchar(12),'') As Start_Month
  322. ,convert(nvarchar(64),'') As StartNo_Customer
  323. ,convert(nvarchar(64),'') As EndNo_Customer
  324. ,convert(nvarchar(64),'') As Company_Name
  325. ,convert(bit,'false') As Company_Flag"/>
  326. </Table>
  327. </Tables>
  328. <Search>
  329. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer,Customer.Note_Customer FROM Customer ">
  330. <Tables>
  331. <Table name="AllCustomer" />
  332. </Tables>
  333. </SearchAllCustomer>
  334. <SearchYearr CmdType="Text" CmdText="Select Convert(nvarchar(12),year(InvoiceDate_SaleInvoice)) as Bill_Year
  335. From SaleInvoice
  336. Group By year(InvoiceDate_SaleInvoice)
  337. order by Bill_Year
  338. ">
  339. <Tables>
  340. <Table name="BillYear"/>
  341. </Tables>
  342. </SearchYearr>
  343. <SearchHalfYear CmdType="Text" CmdText="CREATE TABLE dbo.Temp_HalfYear
  344. (
  345. Half_Year nvarchar(12) NULL
  346. ) ON [PRIMARY]
  347. Insert Into dbo.Temp_HalfYear (Half_Year)
  348. VALUES ('1')
  349. Insert Into dbo.Temp_HalfYear (Half_Year)
  350. VALUES ('2')
  351. Insert Into dbo.Temp_HalfYear (Half_Year)
  352. VALUES ('3')
  353. Insert Into dbo.Temp_HalfYear (Half_Year)
  354. VALUES ('4')
  355. Insert Into dbo.Temp_HalfYear (Half_Year)
  356. VALUES ('5')
  357. Insert Into dbo.Temp_HalfYear (Half_Year)
  358. VALUES ('6')
  359. Insert Into dbo.Temp_HalfYear (Half_Year)
  360. VALUES ('7')
  361. select * from dbo.Temp_HalfYear
  362. DROP TABLE dbo.Temp_HalfYear
  363. ">
  364. <Tables>
  365. <Table name="HalfYear"/>
  366. </Tables>
  367. </SearchHalfYear>
  368. <SearchCompany CmdType="Text" CmdText="SELECT * FROM TypeDef WHERE Type_TypeDef = 30">
  369. <Tables>
  370. <Table name="CompanyType"/>
  371. </Tables>
  372. </SearchCompany>
  373. <SearchReceivableStrikeStatistics CmdType="Text" CmdText="DECLARE @Cmd nvarchar(4000)
  374. ,@End_Month int
  375. ,@Count_Month int
  376. ,@Compare nvarchar(24)
  377. set @Cmd = ''
  378. set @End_Month = @Start_Month+5
  379. set @Count_Month = 0
  380. set @Compare = convert(nvarchar(12),@Start_Year)+'/'+convert(nvarchar(12),@Start_Month)+'/1'
  381. set @Count_Month = @Start_Month
  382. while @Count_Month &lt;= @End_Month
  383. begin
  384. set @Cmd = @Cmd+N' CREATE TABLE [dbo].[Temp_'+convert(varchar(12),@Count_Month)+N']( '
  385. +N' [No_Customer] [nvarchar](24) NULL'
  386. +N' ,[ShortName_Customer] [nvarchar](24) NULL'
  387. +N' ,[Start_Year] [nvarchar](12) NULL'
  388. +N' ,[Start_Month] [nvarchar](12) NULL'
  389. +N' ,[Company_Customer] [nvarchar](24) NULL'
  390. +N' ,[Bill_'+convert(varchar(12),@Count_Month)+N'] [decimal](18, 4) NULL'
  391. +N' ,[BillMoney_'+convert(varchar(12),@Count_Month)+N'] [decimal](18, 4) NULL'
  392. +N' ,[ToGetMoney_'+convert(varchar(12),@Count_Month)+N'] [decimal](18, 4) NULL'
  393. +N' ) ON [PRIMARY] '
  394. +N' Insert Into Temp_'+convert(varchar(12),@Count_Month)
  395. +N' select No_Customer '
  396. +N' ,ShortName_Customer '
  397. +N' ,'+convert(nvarchar(12),@Start_Year)+N' as Start_Year'
  398. +N' ,'+convert(nvarchar(12),@Start_Month)+N' as Start_Month'
  399. +N' ,'''+convert(nvarchar(64),@Company_Name)+N''' as Company_Customer'
  400. +N' ,(case when (OpeningToGetBalance_Customer - OpeningPrepayBalance_Customer + IsNull(A.Big,0) - IsNull(D.Little,0)) = 0 then 0 '
  401. +N' else (OpeningToGetBalance_Customer - OpeningPrepayBalance_Customer + IsNull(A.Big,0) - IsNull(D.Little,0)) end ) '
  402. +N' as Bill_'+convert(varchar(12),@Start_Year)
  403. +N' ,IsNull(BillMoney,0) as BillMoney_'+convert(varchar(12),@Count_Month)
  404. +N' ,IsNull(ToGetMoney,0) as ToGetMoney_'+convert(varchar(12),@Count_Month)
  405. +N' from '
  406. +N'( '
  407. +N' Select ID_Customer '
  408. +N' ,No_Customer '
  409. +N' ,ShortName_Customer '
  410. +N' ,IsCustomersCustomer_Customer '
  411. +N' ,Company_Customer'
  412. +N' ,OpeningToGetBalance_Customer'
  413. +N' , OpeningPrepayBalance_Customer'
  414. +N' From Customer '
  415. +N' Where ID_Customer Is Not Null '
  416. +N' and IsCustomersCustomer_Customer = 0 '
  417. if(@StartNo_Customer Is Not Null)
  418. set @Cmd=@Cmd+N' And No_Customer &gt;= '+nchar(39)+@StartNo_Customer+nchar(39)
  419. if(@EndNo_Customer Is Not Null)
  420. set @Cmd=@Cmd+N' And No_Customer &lt;= '+nchar(39)+@EndNo_Customer+nchar(39)
  421. if(@Company_Name Is Not Null)
  422. if (@Company_Name!='')
  423. set @Cmd=@Cmd+N' And Company_Customer = '+nchar(39)+@Company_Name+nchar(39)
  424. set @Cmd=@Cmd+N' ) Pri '
  425. +N' Left Join '
  426. +N' ( '
  427. +N' Select ID_Customer,Sum(Amount_SaleInvoice) As Big '
  428. +N' From SaleInvoice '
  429. +N' Where SaleInvoice.ID_Assessor Is Not Null '
  430. +N' And DateDiff(day,'''+convert(nvarchar(24),@Compare)+N''',InvoiceDate_SaleInvoice) &lt;0 '
  431. +N' And Disable_SaleInvoice = 0 '
  432. +N' Group By ID_Customer '
  433. +N' )A On A.ID_Customer =Pri.ID_Customer '
  434. +N' Left join '
  435. +N' ( '
  436. +N' Select ID_Customer '
  437. +N' ,sum( case when year([InvoiceDate_SaleInvoice])='+convert(nvarchar(12),@Start_Year)+N' then'
  438. +N' case when month([InvoiceDate_SaleInvoice])='+convert(varchar(12),@Count_Month)
  439. +N' then Amount_SaleInvoice '
  440. +N' else 0 end '
  441. +N' else 0 end '
  442. +N' ) '
  443. +N' as BillMoney '
  444. +N' From SaleInvoice '
  445. +N' Where SaleInvoice.ID_Assessor Is Not Null '
  446. +N' And Disable_SaleInvoice = 0 '
  447. +N' Group By ID_Customer '
  448. +N' ) B On B.ID_Customer = Pri.ID_Customer '
  449. +N' Left join '
  450. +N' ( '
  451. +N' Select ID_Customer '
  452. +N' ,sum( case when year([Date_PreGet])='+convert(nvarchar(12),@Start_Year)+N' then'
  453. +N' case when month([Date_PreGet])='+convert(varchar(12),@Count_Month)
  454. +N' then Amount_PreGet'
  455. +N' else 0 end '
  456. +N' else 0 end '
  457. +N' )'
  458. +N' as ToGetMoney '
  459. +N' From PreGet '
  460. +N' Where PreGet.ID_Assessor Is Not Null '
  461. +N' Group By ID_Customer'
  462. +N' ) C On C.ID_Customer = Pri.ID_Customer '
  463. +N' Left Join '
  464. +N' ( '
  465. +N' Select ID_Customer,Sum(Amount_Preget) As Little '
  466. +N' From Preget '
  467. +N' Where PreGet.ID_Assessor Is Not Null '
  468. +N' And DateDiff(day,'''+convert(nvarchar(24),@Compare)+N''',Date_PreGet) &lt; 0 '
  469. +N' Group By ID_Customer '
  470. +N' ) D On D.ID_Customer = Pri.ID_Customer '
  471. +N' order by No_Customer'
  472. exec (@Cmd)
  473. set @Cmd=''
  474. set @Count_Month=@Count_Month+1
  475. end
  476. set @Cmd=''
  477. set @Count_Month = @Start_Month
  478. set @Cmd = @Cmd +N'select temp_'+convert(varchar(12),@Count_Month)+N'.No_Customer'
  479. +N',temp_'+convert(varchar(12),@Count_Month)+N'.ShortName_Customer'
  480. +N',temp_'+convert(varchar(12),@Count_Month)+N'.Start_Year'
  481. +N',temp_'+convert(varchar(12),@Count_Month)+N'.Start_Month'
  482. +N',temp_'+convert(varchar(64),@Count_Month)+N'.Company_Customer'
  483. +N',Bill_'+convert(varchar(12),@Count_Month)
  484. +N',BillMoney_'+convert(varchar(12),@Count_Month)
  485. +N',ToGetMoney_'+convert(varchar(12),@Count_Month)
  486. while @Count_Month &lt;=@End_Month
  487. begin
  488. if(@Count_Month > @Start_Month)
  489. set @Cmd = @Cmd +N',BillMoney_'+convert(varchar(12),@Count_Month)
  490. +N',ToGetMoney_'+convert(varchar(12),@Count_Month)
  491. set @Count_Month=@Count_Month+1
  492. end
  493. set @Cmd = @Cmd+N' from temp_'+convert(varchar(12),@Start_Month)
  494. set @Count_Month = @Start_Month
  495. while @Count_Month &lt;= @End_Month
  496. begin
  497. if(@Count_Month &gt; @Start_Month)
  498. set @Cmd = @Cmd +N' left join temp_'+convert(varchar(12),@Count_Month)+N' on temp_'+convert(varchar(12),@Count_Month)+N'.No_Customer = temp_'+convert(varchar(12),@Start_Month)+N'.No_Customer'
  499. set @Count_Month=@Count_Month+1
  500. end
  501. exec (@Cmd)
  502. set @Count_Month = @Start_Month
  503. while @Count_Month &lt;= @End_Month
  504. begin
  505. set @Cmd = ''
  506. set @Cmd = @Cmd+N' DROP TABLE [dbo].[Temp_'+convert(varchar(12),@Count_Month)+N']'
  507. exec (@Cmd)
  508. set @Count_Month=@Count_Month+1
  509. end
  510. ">
  511. <Params>
  512. <Param name="@Start_Year" type="SaleInvoice.No_SaleInvoice" Index="0" />
  513. <Param name="@Start_Month" type="SaleInvoice.No_SaleInvoice" Index="1" />
  514. <Param name="@StartNo_Customer" type="Customer.No_Customer" Index="2" />
  515. <Param name="@EndNo_Customer" type="Customer.No_Customer" Index="3" />
  516. <Param name="@Company_Name" type="Customer.No_Customer" Index="4" />
  517. </Params>
  518. <Tables>
  519. <Table name="FrmReceivableStrikeStatistics"/>
  520. </Tables>
  521. </SearchReceivableStrikeStatistics>
  522. </Search>
  523. </Server>
  524. </Form>
  525. </Forms>