FrmReceivables.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmReceivables">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="应收帐款";
  9. GetSchema();
  10. Empty();
  11. txtSum.CValue=0.00;
  12. ]]>
  13. </Load>
  14. <Closing>
  15. ;<!--TODO-->
  16. </Closing>
  17. <Closed>
  18. ;<!--TODO-->
  19. </Closed>
  20. </Events>
  21. <Mode>
  22. <Search>
  23. <Lable name="Search" />
  24. </Search>
  25. </Mode>
  26. <Controls>
  27. <IKTextButton name="txtCustomerNo1" DataSource="UI.StartNo_Customer">
  28. <Events>
  29. <Click>
  30. @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo1.CValue);
  31. if( @temp == "" )
  32. return;
  33. txtCustomerNo1.CValue = @temp;
  34. </Click>
  35. <TextBoxButtonTextChanged>
  36. txtCustomerNo2.CValue = txtCustomerNo1.CValue;
  37. </TextBoxButtonTextChanged>
  38. </Events>
  39. </IKTextButton>
  40. <IKTextButton name="txtCustomerNo2" DataSource="UI.EndNo_Customer">
  41. <Events>
  42. <Click>
  43. @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo2.CValue);
  44. if( @temp == "" )
  45. return;
  46. txtCustomerNo2.CValue = @temp;
  47. </Click>
  48. </Events>
  49. </IKTextButton>
  50. <IKTextButton name="tbInvoiceNo1" >
  51. <Events>
  52. <Click>
  53. @temp = ShowSearchBox("InvoiceNoSearch","NODEPOT","tbInvoiceNo1",tbInvoiceNo1.CValue);
  54. if( @temp == "" )
  55. return;
  56. tbInvoiceNo1.CValue = @temp;
  57. </Click>
  58. <TextBoxButtonTextChanged>
  59. tbInvoiceNo2.CValue = tbInvoiceNo1.CValue;
  60. </TextBoxButtonTextChanged>
  61. </Events>
  62. </IKTextButton>
  63. <IKTextButton name="tbInvoiceNo2" >
  64. <Events>
  65. <Click>
  66. @temp = ShowSearchBox("InvoiceNoSearch","NODEPOT","tbInvoiceNo2", tbInvoiceNo2.CValue);
  67. if( @temp == "" )
  68. return;
  69. tbInvoiceNo2.CValue = @temp;
  70. </Click>
  71. </Events>
  72. </IKTextButton>
  73. <IKExtendGrid name="ikExtendGrid1" DataSource="Total" TableStyleIndex="0">
  74. <DataColumn Index="0" DataSource="Total.No_Customer"/>
  75. <DataColumn Index="1" DataSource="Total.ShortName_Customer"/>
  76. <DataColumn Index="2" DataSource="Total.No_SaleInvoice"/>
  77. <DataColumn Index="3" DataSource="Total.No_Invoice"/>
  78. <DataColumn Index="4" DataSource="Total.InvoiceDate_SaleInvoice"/>
  79. <DataColumn Index="5" DataSource="Total.PayDate_SaleInvoice"/>
  80. <DataColumn Index="6" DataSource="Total.Amount_SaleInvoice"/>
  81. <DataColumn Index="7" DataSource="Total.StrikedAmount_SaleInvoice"/>
  82. <DataColumn Index="8" DataSource="Total.ReceivableMoney"/>
  83. <Events>
  84. <ClickPreview>
  85. PrintReport(ikExtendGrid1.CurrentView);
  86. </ClickPreview>
  87. <ClickFilter>
  88. txtSum.CValue=SumOfCol("#Total.ReceivableMoney",ikExtendGrid1.FilterCondition,true);
  89. </ClickFilter>
  90. <ClickNOFilter>
  91. txtSum.CValue=SumOfCol("#Total.ReceivableMoney",ikExtendGrid1.FilterCondition,true);
  92. </ClickNOFilter>
  93. <ClickRefresh>
  94. Empty();
  95. @StartCustomerNo =DBNull();
  96. @EndCustomerNo =DBNull();
  97. @StartSaleInvoiceNo =DBNull();
  98. @EndSaleInvoiceNo =DBNull();
  99. @StartInvoiceDate =DBNull();
  100. @EndInvoiceDate =DBNull();
  101. @StartPayDate =DBNull();
  102. @EndPayDate =DBNull();
  103. if(!Equals(txtCustomerNo1.CValue,""))
  104. @StartCustomerNo= txtCustomerNo1.CValue;
  105. if(!Equals(txtCustomerNo2.CValue,""))
  106. @EndCustomerNo= txtCustomerNo2.CValue;
  107. if(!Equals(tbInvoiceNo1.CValue,""))
  108. @StartSaleInvoiceNo= tbInvoiceNo1.CValue;
  109. if(!Equals(tbInvoiceNo2.CValue,""))
  110. @EndSaleInvoiceNo= tbInvoiceNo2.CValue;
  111. if(dtAssessDate1.Checked)
  112. @StartInvoiceDate= dtAssessDate1.Value;
  113. if(dtAssessDate2.Checked)
  114. @EndInvoiceDate= dtAssessDate2.Value;
  115. if(dt1.Checked)
  116. @StartPayDate= dt1.Value;
  117. if(dt2.Checked)
  118. @EndPayDate= dt2.Value;
  119. Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartSaleInvoiceNo,@EndSaleInvoiceNo,
  120. @StartInvoiceDate,@EndInvoiceDate,@StartPayDate,@EndPayDate,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
  121. txtSum.CValue=SumOfCol("#Total.ReceivableMoney");
  122. </ClickRefresh>
  123. </Events>
  124. </IKExtendGrid>
  125. <IKButton name="btnSearch">
  126. <Events>
  127. <Click>
  128. Empty();
  129. @StartCustomerNo =DBNull();
  130. @EndCustomerNo =DBNull();
  131. @StartSaleInvoiceNo =DBNull();
  132. @EndSaleInvoiceNo =DBNull();
  133. @StartInvoiceDate =DBNull();
  134. @EndInvoiceDate =DBNull();
  135. @StartPayDate =DBNull();
  136. @EndPayDate =DBNull();
  137. if(!Equals(txtCustomerNo1.CValue,""))
  138. @StartCustomerNo= txtCustomerNo1.CValue;
  139. if(!Equals(txtCustomerNo2.CValue,""))
  140. @EndCustomerNo= txtCustomerNo2.CValue;
  141. if(!Equals(tbInvoiceNo1.CValue,""))
  142. @StartSaleInvoiceNo= tbInvoiceNo1.CValue;
  143. if(!Equals(tbInvoiceNo2.CValue,""))
  144. @EndSaleInvoiceNo= tbInvoiceNo2.CValue;
  145. if(dtAssessDate1.Checked)
  146. @StartInvoiceDate= dtAssessDate1.Value;
  147. if(dtAssessDate2.Checked)
  148. @EndInvoiceDate= dtAssessDate2.Value;
  149. if(dt1.Checked)
  150. @StartPayDate= dt1.Value;
  151. if(dt2.Checked)
  152. @EndPayDate= dt2.Value;
  153. Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartSaleInvoiceNo,@EndSaleInvoiceNo,
  154. @StartInvoiceDate,@EndInvoiceDate,@StartPayDate,@EndPayDate,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
  155. txtSum.CValue=SumOfCol("#Total.ReceivableMoney");
  156. </Click>
  157. </Events>
  158. </IKButton>
  159. <IKButton name="btnClear">
  160. <Events>
  161. <Click>
  162. Empty();
  163. txtCustomerNo1.CValue="";
  164. txtCustomerNo2.CValue="";
  165. tbInvoiceNo1.CValue="";
  166. tbInvoiceNo2.CValue="";
  167. dtAssessDate1.Checked=False;
  168. dtAssessDate2.Checked=False;
  169. dt1.Checked=False;
  170. dt2.Checked=False;
  171. txtSum.CValue=0.00;
  172. </Click>
  173. </Events>
  174. </IKButton>
  175. </Controls>
  176. <ChildForms>
  177. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
  178. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  179. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  180. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  181. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  182. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
  183. </ChildForm>
  184. <ChildForm name="InvoiceNoSearch" DataSource="SaleInvoice" SearchFunction="SearchAllInvoiceNo" SearchFunctionByNo="" MappingName="发票编号">
  185. <DataColumn Index="0" MappingName="#SaleInvoice.No_Invoice" HeaderText="发票编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  186. <DataColumn Index="1" MappingName="#SaleInvoice.InvoiceDate_SaleInvoice" HeaderText="发票日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  187. </ChildForm>
  188. </ChildForms>
  189. </Client>
  190. <Server>
  191. <Tables>
  192. <Table name="Total" Type="Parent">
  193. <GetSchema CmdType="Text" CmdText="
  194. Select Top 0 No_Customer,ShortName_Customer,SaleInvoice.No_SaleInvoice,No_Invoice,InvoiceDate_SaleInvoice,PayDate_SaleInvoice,Amount_SaleInvoice,StrikedAmount_SaleInvoice,(Amount_SaleInvoice-StrikedAmount_SaleInvoice) As ReceivableMoney
  195. From SaleInvoice
  196. Join Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
  197. "/>
  198. </Table>
  199. </Tables>
  200. <Search>
  201. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer FROM Customer ">
  202. <Tables>
  203. <Table name="AllCustomer" />
  204. </Tables>
  205. </SearchAllCustomer>
  206. <SearchAllInvoiceNo CmdType="Text" CmdText="SELECT No_Invoice,InvoiceDate_SaleInvoice FROM SaleInvoice">
  207. <Tables>
  208. <Table name="AllInvoiceNo" />
  209. </Tables>
  210. </SearchAllInvoiceNo>
  211. <SearchReceivales CmdType="Text" CmdText="
  212. Select No_Customer,ShortName_Customer,SaleInvoice.No_SaleInvoice,No_Invoice,InvoiceDate_SaleInvoice,PayDate_SaleInvoice,IsNull(Amount_SaleInvoice,0) as Amount_SaleInvoice,IsNull(StrikedAmount_SaleInvoice,0) as StrikedAmount_SaleInvoice,(IsNull(Amount_SaleInvoice,0)-IsNull(StrikedAmount_SaleInvoice,0)) As ReceivableMoney
  213. From SaleInvoice
  214. Join Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
  215. WHERE No_Customer BETWEEN ISNULL(@StartCustomerNo,'') AND ISNULL(@EndCustomerNo,(SELECT MAX(No_Customer) FROM Customer))
  216. And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End
  217. AND SaleInvoice.No_Invoice BETWEEN ISNULL(@StartSaleInvoiceNo,'') AND ISNULL(@EndSaleInvoiceNo,(Select MAX(No_Invoice) FROM SaleInvoice))
  218. AND InvoiceDate_SaleInvoice BETWEEN ISNULL(DATEADD(day,0,DATEDIFF(day,0,@StartInvoiceDate)),0) AND ISNULL(DATEADD(day,0,(DATEDIFF(day,0,@EndInvoiceDate)+1)),'9999-12-31')
  219. AND PayDate_SaleInvoice BETWEEN ISNULL(DATEADD(day,0,DATEDIFF(day,0,@StartPayDate)),0) AND ISNULL(DATEADD(day,0,(DATEDIFF(day,0,@EndPayDate)+1)),'9999-12-31')
  220. AND SaleInvoice.ID_Assessor IS NOT NULL AND SaleInvoice.Disable_SaleInvoice=0 AND (IsNull(Amount_SaleInvoice,0)-IsNull(StrikedAmount_SaleInvoice,0)) != 0
  221. Order By No_Customer
  222. ">
  223. <Params>
  224. <Param name="@StartCustomerNo" type="Customer.No_Customer" Index="0" />
  225. <Param name="@EndCustomerNo" type="Customer.No_Customer" Index="1" />
  226. <Param name="@StartSaleInvoiceNo" type="SaleInvoice.No_Invoice" Index="2" />
  227. <Param name="@EndSaleInvoiceNo" type="SaleInvoice.No_Invoice" Index="3" />
  228. <Param name="@StartInvoiceDate" type="SaleBill.AssessDate_SaleBill" Index="4" />
  229. <Param name="@EndInvoiceDate" type="SaleBill.AssessDate_SaleBill" Index="5" />
  230. <Param name="@StartPayDate" type="SaleBill.AssessDate_SaleBill" Index="6" />
  231. <Param name="@EndPayDate" type="SaleBill.AssessDate_SaleBill" Index="7" />
  232. <Param name="@Right" type="SaleBill.ID_Customer" Index="8" />
  233. </Params>
  234. <Tables>
  235. <Table name="Total"/>
  236. </Tables>
  237. </SearchReceivales>
  238. </Search>
  239. </Server>
  240. <Lables>
  241. <Search>
  242. </Search>
  243. </Lables>
  244. </Form>
  245. </Forms>