FrmSaleConsignment.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmSaleConsignment">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="销货发货跟踪";
  9. GetSchema();
  10. Empty();
  11. ]]>
  12. </Load>
  13. <Closing>
  14. ;<!--TODO-->
  15. </Closing>
  16. <Closed>
  17. ;<!--TODO-->
  18. </Closed>
  19. </Events>
  20. <Mode>
  21. <Search>
  22. <Lable name="Search" />
  23. </Search>
  24. </Mode>
  25. <Controls>
  26. <IKTextButton name="txtCustomerNo1">
  27. <Events>
  28. <Click>
  29. @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo1.CValue);
  30. if( @temp == "" )
  31. return;
  32. txtCustomerNo1.CValue = @temp;
  33. </Click>
  34. </Events>
  35. </IKTextButton>
  36. <IKTextButton name="txtCustomerNo2">
  37. <Events>
  38. <Click>
  39. @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo2.CValue);
  40. if( @temp == "" )
  41. return;
  42. txtCustomerNo2.CValue = @temp;
  43. </Click>
  44. </Events>
  45. </IKTextButton>
  46. <IKTextButton name="txtSaleBillNo1">
  47. <Events>
  48. <Click>
  49. ShowSearchBox("SaleBillSearch","HAVEDEPOT", "txtSaleBillNo1",txtSaleBillNo1.CValue);
  50. </Click>
  51. </Events>
  52. </IKTextButton>
  53. <IKTextButton name="txtSaleBillNo2">
  54. <Events>
  55. <Click>
  56. ShowSearchBox("SaleBillSearch","HAVEDEPOT", "txtSaleBillNo2",txtSaleBillNo2.CValue);
  57. </Click>
  58. </Events>
  59. </IKTextButton>
  60. <IKTextButton name="txtBillNo1">
  61. <Events>
  62. <Click>
  63. ShowSearchBox("SaleOutDepotBillSearch","HAVEDEPOT", "txtBillNo1",txtBillNo1.CValue);
  64. </Click>
  65. </Events>
  66. </IKTextButton>
  67. <IKTextButton name="txtBillNo2">
  68. <Events>
  69. <Click>
  70. ShowSearchBox("SaleOutDepotBillSearch","HAVEDEPOT", "txtBillNo2",txtBillNo2.CValue);
  71. </Click>
  72. </Events>
  73. </IKTextButton>
  74. <IKExtendGrid name="ikExtendGrid1" DataSource="Total" TableStyleIndex="0">
  75. <DataColumn Index="0" DataSource="Total.No_Customer"/>
  76. <DataColumn Index="1" DataSource="Total.ShortName_Customer"/>
  77. <DataColumn Index="2" DataSource="Total.StrTransBack_SaleBill"/>
  78. <DataColumn Index="3" DataSource="Total.GetMethod_SaleBill"/>
  79. <DataColumn Index="4" DataSource="Total.No_SaleBill"/>
  80. <DataColumn Index="5" DataSource="Total.AssessDate_SaleBill"/>
  81. <DataColumn Index="6" DataSource="Total.OutStatus_SaleBill"/>
  82. <DataColumn Index="7" DataSource="Total.No_SaleOutDepotBill"/>
  83. <DataColumn Index="8" DataSource="Total.AssessDate_SaleOutDepotBill"/>
  84. <DataColumn Index="9" DataSource="Total.No_ExpressDelivery"/>
  85. <DataColumn Index="10" DataSource="Total.Comment_ExpressDelivery"/>
  86. <DataColumn Index="11" DataSource="Total.Check_ExpressDelivery"/>
  87. <Events>
  88. <ClickPreview>
  89. PrintReport(ikExtendGrid1.CurrentView);
  90. </ClickPreview>
  91. <ClickFilter>
  92. ;
  93. </ClickFilter>
  94. <ClickNOFilter>
  95. ;
  96. </ClickNOFilter>
  97. <ClickRefresh>
  98. Empty();
  99. @StartNo_Customer=DBNull();
  100. @EndNo_Customer =DBNull();
  101. @StartNo_SaleBill=DBNull();
  102. @EndNo_SaleBill =DBNull();
  103. @StartAssessDate_SaleBill =DBNull();
  104. @EndAssessDate_SaleBill =DBNull();
  105. @StartNo_SaleOutDepotBill=DBNull();
  106. @EndNo_SaleOutDepotBill =DBNull();
  107. @StartAssessDate_SaleOutDepotBill =DBNull();
  108. @EndAssessDate_SaleOutDepotBill =DBNull();
  109. if(!Equals(txtCustomerNo1.CValue,""))
  110. @StartNo_Customer= txtCustomerNo1.CValue;
  111. if(!Equals(txtCustomerNo2.CValue,""))
  112. @EndNo_Customer= txtCustomerNo2.CValue;
  113. if(!Equals(txtSaleBillNo1.CValue,""))
  114. @StartNo_SaleBill= txtSaleBillNo1.CValue;
  115. if(!Equals(txtSaleBillNo2.CValue,""))
  116. @EndNo_SaleBill= txtSaleBillNo2.CValue;
  117. if(dtAssessDate1.Checked)
  118. @StartAssessDate_SaleBill= dtAssessDate1.Value;
  119. if(dtAssessDate2.Checked)
  120. @EndAssessDate_SaleBill= dtAssessDate2.Value;
  121. if(!Equals(txtBillNo1.CValue,""))
  122. @StartNo_SaleOutDepotBill= txtBillNo1.CValue;
  123. if(!Equals(txtBillNo2.CValue,""))
  124. @EndNo_SaleOutDepotBill= txtBillNo2.CValue;
  125. if(dt1.Checked)
  126. @StartAssessDate_SaleOutDepotBill= dt1.Value;
  127. if(dt2.Checked)
  128. @EndAssessDate_SaleOutDepotBill= dt2.Value;
  129. Search("SearchSaleConsignment",@StartNo_Customer,@EndNo_Customer,@StartNo_SaleBill,@EndNo_SaleBill,
  130. @StartAssessDate_SaleBill,@EndAssessDate_SaleBill,@StartNo_SaleOutDepotBill,@EndNo_SaleOutDepotBill,
  131. @StartAssessDate_SaleOutDepotBill,@EndAssessDate_SaleOutDepotBill);
  132. </ClickRefresh>
  133. </Events>
  134. </IKExtendGrid>
  135. <IKButton name="btnSearch">
  136. <Events>
  137. <Click>
  138. Empty();
  139. @StartNo_Customer=DBNull();
  140. @EndNo_Customer =DBNull();
  141. @StartNo_SaleBill=DBNull();
  142. @EndNo_SaleBill =DBNull();
  143. @StartAssessDate_SaleBill =DBNull();
  144. @EndAssessDate_SaleBill =DBNull();
  145. @StartNo_SaleOutDepotBill=DBNull();
  146. @EndNo_SaleOutDepotBill =DBNull();
  147. @StartAssessDate_SaleOutDepotBill =DBNull();
  148. @EndAssessDate_SaleOutDepotBill =DBNull();
  149. if(!Equals(txtCustomerNo1.CValue,""))
  150. @StartNo_Customer= txtCustomerNo1.CValue;
  151. if(!Equals(txtCustomerNo2.CValue,""))
  152. @EndNo_Customer= txtCustomerNo2.CValue;
  153. if(!Equals(txtSaleBillNo1.CValue,""))
  154. @StartNo_SaleBill= txtSaleBillNo1.CValue;
  155. if(!Equals(txtSaleBillNo2.CValue,""))
  156. @EndNo_SaleBill= txtSaleBillNo2.CValue;
  157. if(dtAssessDate1.Checked)
  158. @StartAssessDate_SaleBill= dtAssessDate1.Value;
  159. if(dtAssessDate2.Checked)
  160. @EndAssessDate_SaleBill= dtAssessDate2.Value;
  161. if(!Equals(txtBillNo1.CValue,""))
  162. @StartNo_SaleOutDepotBill= txtBillNo1.CValue;
  163. if(!Equals(txtBillNo2.CValue,""))
  164. @EndNo_SaleOutDepotBill= txtBillNo2.CValue;
  165. if(dt1.Checked)
  166. @StartAssessDate_SaleOutDepotBill= dt1.Value;
  167. if(dt2.Checked)
  168. @EndAssessDate_SaleOutDepotBill= dt2.Value;
  169. Search("SearchSaleConsignment",@StartNo_Customer,@EndNo_Customer,@StartNo_SaleBill,@EndNo_SaleBill,
  170. @StartAssessDate_SaleBill,@EndAssessDate_SaleBill,@StartNo_SaleOutDepotBill,@EndNo_SaleOutDepotBill,
  171. @StartAssessDate_SaleOutDepotBill,@EndAssessDate_SaleOutDepotBill);
  172. if(RowCount("#Total") == 0)
  173. MessageBox("不存在符合查询条件的记录!");
  174. </Click>
  175. </Events>
  176. </IKButton>
  177. <IKButton name="btnClear">
  178. <Events>
  179. <Click>
  180. Empty();
  181. txtCustomerNo1.CValue="";
  182. txtCustomerNo2.CValue="";
  183. txtSaleBillNo1.CValue="";
  184. txtSaleBillNo2.CValue="";
  185. txtBillNo1.CValue="";
  186. txtBillNo2.CValue="";
  187. dtAssessDate1.Checked=False;
  188. dtAssessDate2.Checked=False;
  189. dt1.Checked=False;
  190. dt2.Checked=False;
  191. </Click>
  192. </Events>
  193. </IKButton>
  194. </Controls>
  195. <ChildForms>
  196. <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
  197. <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  198. <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  199. <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  200. <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  201. <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
  202. </ChildForm>
  203. <ChildForm name="SaleBillSearch" DataSource="SaleBill" SearchFunction="SearchAllSaleBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="">
  204. <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" HeaderText="销售单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  205. <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
  206. <DataColumn Index="2" MappingName="#SaleBill.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  207. <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" HeaderText="客户名称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
  208. </ChildForm>
  209. <ChildForm name="SaleOutDepotBillSearch" DataSource="SaleOutDepotBill" SearchFunction="SearchAllSaleOutBill" SearchFunctionByNo="">
  210. <DataColumn Index="0" MappingName="#SaleOutDepotBill.No_SaleOutDepotBill" HeaderText="销货出库单号"
  211. Width="90" ColumnType="IKDataGridTextBoxColumn" />
  212. <DataColumn Index="1" MappingName="#SaleOutDepotBill.Date_SaleOutDepotBill" HeaderText="制单日期"
  213. Width="90" ColumnType="IKDataGridTextBoxColumn" />
  214. <DataColumn Index="2" MappingName="#SaleOutDepotBill.No_Customer" HeaderText="客户编号" Width="75"
  215. ColumnType="IKDataGridTextBoxColumn" />
  216. <DataColumn Index="3" MappingName="#SaleOutDepotBill.ShortName_Customer" HeaderText="客户简称" Width="75"
  217. ColumnType="IKDataGridTextBoxColumn" />
  218. </ChildForm>
  219. </ChildForms>
  220. </Client>
  221. <Server>
  222. <Tables>
  223. <Table name="Total" Type="Parent">
  224. <GetSchema CmdType="Text" CmdText="
  225. Select top 0 No_Customer,ShortName_Customer,convert(nvarchar(64),'') As StrTransBack_SaleBill,GetMethod_SaleBill,No_SaleBill,AssessDate_SaleBill,SaleBill.OutStatus_SaleBill,a.No_SaleOutDepotBill,a.AssessDate_SaleOutDepotBill,No_ExpressDelivery,Comment_ExpressDelivery, convert(nvarchar(64),'') As Check_ExpressDelivery
  226. From SaleBill
  227. Join Customer On Customer.ID_Customer=SaleBill.ID_Customer
  228. Left Join
  229. (
  230. Select No_FromBill,No_SaleOutDepotBill,AssessDate_SaleOutDepotBill
  231. From SaleOutDepotBill
  232. Join SaleOutDepotBillProduct On SaleOutDepotBillProduct.ID_SaleOutDepotBill=SaleOutDepotBill.ID_SaleOutDepotBill
  233. Where SaleOutDepotBill.ID_Assessor Is Not Null
  234. )a On a.No_FromBill=SaleBill.No_SaleBill
  235. Left Join ExpressDeliveryDetail On ExpressDeliveryDetail.No_FromBill=a.No_SaleOutDepotBill
  236. Left Join ExpressDelivery On ExpressDelivery.ID_ExpressDelivery=ExpressDeliveryDetail.ID_ExpressDelivery
  237. Where SaleBill.ID_Assessor Is Not Null
  238. "/>
  239. </Table>
  240. </Tables>
  241. <Search>
  242. <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer FROM Customer ">
  243. <Tables>
  244. <Table name="AllCustomer" />
  245. </Tables>
  246. </SearchAllCustomer>
  247. <SearchAllSaleBill CmdType="Text" CmdText=" SELECT SaleBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
  248. Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
  249. a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
  250. Location.No_Location, Location.Name_Location, CONVERT(decimal(18,6), 0) AS NumSum, CONVERT(decimal(18,6), 0) AS MoneySum,
  251. CONVERT(decimal(18,6), 0) AS TaxSum, Employee.No_Employee AS No_Principal ,Employee.Name_Employee as Principal_SaleBill
  252. FROM SaleBill
  253. LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
  254. LEFT JOIN AppUser a ON a.ID_User = SaleBill.ID_Creator
  255. LEFT JOIN AppUser b ON b.ID_User = SaleBill.ID_Assessor
  256. LEFT JOIN AppUser c ON c.ID_User = SaleBill.LastModUser_SaleBill
  257. LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
  258. LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal">
  259. <Tables>
  260. <Table name="AllSaleBill" />
  261. </Tables>
  262. </SearchAllSaleBill>
  263. <SearchAllSaleOutBill CmdType="Text" CmdText=" SELECT SaleOutDepotBill.*,a.Name_User,b.Name_User as Name_UserAuti,c.Name_User as Name_LastModUser,
  264. Location.Name_Location,Location.No_Location ,Customer.Name_Customer, Customer.ShortName_Customer,Customer.No_Customer
  265. FROM SaleOutDepotBill
  266. LEFT JOIN Customer ON Customer.ID_Customer = SaleOutDepotBill.ID_Customer
  267. LEFT JOIN AppUser a ON a.ID_User = SaleOutDepotBill.ID_Creator
  268. LEFT JOIN AppUser b ON b.ID_User = SaleOutDepotBill.ID_Assessor
  269. Left JOIN AppUser c ON c.ID_User = SaleOutDepotBill.LastModUser_SaleOutDepotBill
  270. LEFT JOIN Location ON Location.ID_Location = SaleOutDepotBill.ID_Location
  271. WHERE Disable_SaleOutDepotBill = 0">
  272. <Tables>
  273. <Table name="AllSaleOutBill" />
  274. </Tables>
  275. </SearchAllSaleOutBill>
  276. <SearchSaleConsignment CmdType="Text" CmdText="
  277. declare @sqlCmd nvarchar(4000)
  278. set @sqlCmd=N'
  279. Select distinct No_Customer,ShortName_Customer,case TransBack_SaleBill when 1 then '+nchar(39)+N'是'+nchar(39)+ N' else '+nchar(39)+N'否'+nchar(39)+N' end As StrTransBack_SaleBill,GetMethod_SaleBill,No_SaleBill,AssessDate_SaleBill,SaleBill.OutStatus_SaleBill ,a.No_SaleOutDepotBill,a.AssessDate_SaleOutDepotBill,No_ExpressDelivery,Comment_ExpressDelivery, case Check_ExpressDelivery when 1 then '+nchar(39)+N'是'+nchar(39)+ N' else '+nchar(39)+N'否'+nchar(39)+N' end As Check_ExpressDelivery
  280. From SaleBill
  281. Join Customer On Customer.ID_Customer=SaleBill.ID_Customer
  282. Left Join
  283. (
  284. Select No_FromBill,No_SaleOutDepotBill,AssessDate_SaleOutDepotBill
  285. From SaleOutDepotBill
  286. Join SaleOutDepotBillProduct On SaleOutDepotBillProduct.ID_SaleOutDepotBill=SaleOutDepotBill.ID_SaleOutDepotBill
  287. Where SaleOutDepotBill.ID_Assessor Is Not Null
  288. )a On a.No_FromBill=SaleBill.No_SaleBill
  289. Left Join ExpressDeliveryDetail On ExpressDeliveryDetail.No_FromBill=a.No_SaleOutDepotBill
  290. Left Join ExpressDelivery On ExpressDelivery.ID_ExpressDelivery=ExpressDeliveryDetail.ID_ExpressDelivery
  291. Where SaleBill.ID_Assessor Is Not Null '
  292. if(@StartNo_Customer Is Not Null)
  293. set @sqlCmd=@sqlCmd+' And No_Customer &gt;='+nchar(39)+@StartNo_Customer+nchar(39)
  294. if(@EndNo_Customer Is Not Null)
  295. set @sqlCmd=@sqlCmd+' And No_Customer &lt;='+nchar(39)+@EndNo_Customer+nchar(39)
  296. if(@StartNo_SaleBill Is Not Null)
  297. set @sqlCmd=@sqlCmd+' And No_SaleBill &gt;='+nchar(39)+@StartNo_SaleBill+nchar(39)
  298. if(@EndNo_SaleBill Is Not Null)
  299. set @sqlCmd=@sqlCmd+' And No_SaleBill &lt;='+nchar(39)+@EndNo_SaleBill+nchar(39)
  300. if(@StartAssessDate_SaleBill Is Not Null)
  301. set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@StartAssessDate_SaleBill)+nchar(39)+N',AssessDate_SaleBill) &gt;= 0 '
  302. if(@EndAssessDate_SaleBill Is Not Null)
  303. set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@EndAssessDate_SaleBill)+nchar(39)+N',AssessDate_SaleBill) &lt;= 0 '
  304. if(@StartNo_SaleOutDepotBill Is Not Null)
  305. set @sqlCmd=@sqlCmd+N' And No_SaleOutDepotBill &gt;='+nchar(39)+ @StartNo_SaleOutDepotBill +nchar(39)
  306. if(@EndNo_SaleOutDepotBill Is Not Null)
  307. set @sqlCmd=@sqlCmd+N' And No_SaleOutDepotBill &lt;='+nchar(39)+ @EndNo_SaleOutDepotBill+nchar(39)
  308. if(@StartAssessDate_SaleOutDepotBill Is Not Null)
  309. set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@StartAssessDate_SaleOutDepotBill)+nchar(39)+N',AssessDate_SaleOutDepotBill) &gt;= 0 '
  310. if(@EndAssessDate_SaleOutDepotBill Is Not Null)
  311. set @sqlCmd=@sqlCmd+N' And DateDiff(day,'+nchar(39)+convert(nvarchar(64),@EndAssessDate_SaleOutDepotBill)+nchar(39)+N',AssessDate_SaleOutDepotBill) &lt;= 0 '
  312. execute sp_executesql @sqlCmd
  313. ">
  314. <Params>
  315. <Param name="@StartNo_Customer" type="Customer.No_Customer" Index="0" />
  316. <Param name="@EndNo_Customer" type="Customer.No_Customer" Index="1" />
  317. <Param name="@StartNo_SaleBill" type="Customer.No_Customer" Index="2" />
  318. <Param name="@EndNo_SaleBill" type="Customer.No_Customer" Index="3" />
  319. <Param name="@StartAssessDate_SaleBill" type="SaleBill.AssessDate_SaleBill" Index="4" />
  320. <Param name="@EndAssessDate_SaleBill" type="SaleBill.AssessDate_SaleBill" Index="5" />
  321. <Param name="@StartNo_SaleOutDepotBill" type="Customer.No_Customer" Index="6" />
  322. <Param name="@EndNo_SaleOutDepotBill" type="Customer.No_Customer" Index="7" />
  323. <Param name="@StartAssessDate_SaleOutDepotBill" type="SaleBill.AssessDate_SaleBill" Index="8" />
  324. <Param name="@EndAssessDate_SaleOutDepotBill" type="SaleBill.AssessDate_SaleBill" Index="9" />
  325. </Params>
  326. <Tables>
  327. <Table name="Total"/>
  328. </Tables>
  329. </SearchSaleConsignment>
  330. </Search>
  331. </Server>
  332. <Lables>
  333. <Search>
  334. </Search>
  335. </Lables>
  336. </Form>
  337. </Forms>