FrmPurchaseNoInDepot.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Forms>
  3. <Form Name="FrmPurchaseNoInDepot">
  4. <Client>
  5. <Events>
  6. <Load>
  7. <![CDATA[
  8. @Title="采购未入库查看";
  9. GetSchema();
  10. Search("SearchProcess");
  11. @Block=#SystemSetting.StockAndInDepot_SystemSetting;
  12. ChangeMode("Search");
  13. ]]>
  14. </Load>
  15. <Closing>
  16. ;<!--TODO-->
  17. </Closing>
  18. <Closed>
  19. ;<!--TODO-->
  20. </Closed>
  21. </Events>
  22. <Mode>
  23. <Search>
  24. <Lable name="Search" />
  25. </Search>
  26. </Mode>
  27. <Controls>
  28. <IkExtendGrid name="dgProduct" DataSource="PurchaseNoInDepot" TableStyleIndex="0">
  29. <DataColumn Index="0" DataSource="PurchaseNoInDepot.No_PurchaseOrderBill"/>
  30. <DataColumn Index="1" DataSource="PurchaseNoInDepot.Date_PurchaseOrderBill"/>
  31. <DataColumn Index="2" DataSource="PurchaseNoInDepot.ArrivalDate_PurchaseOrderBill"/>
  32. <DataColumn Index="3" DataSource="PurchaseNoInDepot.No_Product"/>
  33. <DataColumn Index="4" DataSource="PurchaseNoInDepot.Name_Product"/>
  34. <DataColumn Index="5" DataSource="PurchaseNoInDepot.Quantity_PurchaseOrderBillProduct"/>
  35. <DataColumn Index="6" DataSource="PurchaseNoInDepot.Quantity_InDepot"/>
  36. <DataColumn Index="7" DataSource="PurchaseNoInDepot.Quantity_EndCase"/>
  37. <DataColumn Index="8" DataSource="PurchaseNoInDepot.Quantity_OnShip"/>
  38. <DataColumn Index="9" DataSource="PurchaseNoInDepot.NoInDepot"/>
  39. <Events>
  40. <ClickPaste>
  41. ;
  42. </ClickPaste>
  43. <ClickExcel>
  44. ;
  45. </ClickExcel>
  46. <ClickPrint>
  47. ;
  48. </ClickPrint>
  49. <ClickPreview>
  50. PrintReport(dgProduct.CurrentView);
  51. </ClickPreview>
  52. <ClickRefresh>
  53. Empty();
  54. ChangeMode("Search");
  55. </ClickRefresh>
  56. <ClickFirstPage>
  57. ;
  58. </ClickFirstPage>
  59. <ClickPrevPage>
  60. </ClickPrevPage>
  61. ;
  62. <ClickNextPage>
  63. ;
  64. </ClickNextPage>
  65. <ClickLastPage>
  66. ;
  67. </ClickLastPage>
  68. <ClickFilter>
  69. txtBillSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_PurchaseOrderBillProduct",dgProduct.FilterCondition,true);
  70. txtIndepotSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_InDepot",dgProduct.FilterCondition,true);
  71. txtEndCaseSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_EndCase",dgProduct.FilterCondition,true);
  72. txtOnshipSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_OnShip",dgProduct.FilterCondition),true;
  73. txtNotShipSum.CValue=SumOfCol("#PurchaseNoInDepot.NoInDepot",dgProduct.FilterCondition,true);
  74. </ClickFilter>
  75. <ClickNOFilter>
  76. txtBillSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_PurchaseOrderBillProduct",dgProduct.FilterCondition,true);
  77. txtIndepotSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_InDepot",dgProduct.FilterCondition,true);
  78. txtEndCaseSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_EndCase",dgProduct.FilterCondition,true);
  79. txtOnshipSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_OnShip",dgProduct.FilterCondition,true);
  80. txtNotShipSum.CValue=SumOfCol("#PurchaseNoInDepot.NoInDepot",dgProduct.FilterCondition,true);
  81. </ClickNOFilter>
  82. <ClickAdd>
  83. ;
  84. </ClickAdd>
  85. <ClickRemove>
  86. ;
  87. </ClickRemove>
  88. </Events>
  89. </IkExtendGrid>
  90. </Controls>
  91. </Client>
  92. <Server>
  93. <Tables>
  94. <Table name="PurchaseNoInDepot" Type="Parent">
  95. <GetSchema CmdType="Text" CmdText="Select Top 0 PurchaseOrderBill.No_PurchaseOrderBill,PurchaseOrderBill.Date_PurchaseOrderBill,PurchaseOrderBill.ArrivalDate_PurchaseOrderBill,Product.No_Product,Product.Name_Product,PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct,
  96. PurchaseSourceBillProduct.Quantity_InDepot,PurchaseSourceBillProduct.Quantity_EndCase,PurchaseSourceBillProduct.Quantity_OnShip,(Quantity_Order-Quantity_InDepot-Quantity_OnShip-Quantity_EndCase) As NoInDepot
  97. From PurchaseOrderBill
  98. Left Join PurchaseOrderBillProduct On PurchaseOrderBillProduct.ID_PurchaseOrderBill=PurchaseOrderBill.ID_PurchaseOrderBill
  99. Left Join PurchaseSourceBillProduct On PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct=PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct
  100. Left Join Product On Product.ID_Product=PurchaseOrderBillProduct.ID_Product"/>
  101. </Table>
  102. </Tables>
  103. <Search>
  104. <SearchNoInDepotProcess CmdType="Text" CmdText="
  105. Select ta.Quantity_PurchaseOrderBillProduct,ta.Quantity_InDepot,ta.Quantity_OnShip,ta.Quantity_EndCase,ta.NoInDepot,PurchaseOrderBill.No_PurchaseOrderBill,PurchaseOrderBill.Date_PurchaseOrderBill,PurchaseOrderBill.ArrivalDate_PurchaseOrderBill,Product.No_Product,Product.Name_Product
  106. From
  107. ( Select b.ID_PurchaseOrderBill,b.ID_Product, sum(a.Quantity_Order) As Quantity_PurchaseOrderBillProduct,sum(a.Quantity_InDepot) As Quantity_InDepot,sum(a.Quantity_OnShip) As Quantity_OnShip,sum(a.Quantity_EndCase) As Quantity_EndCase,(sum(a.Quantity_Order)-sum(a.Quantity_InDepot)-sum(a.Quantity_OnShip)-sum(a.Quantity_EndCase)) As NoInDepot
  108. From PurchaseSourceBillProduct a
  109. Join PurchaseOrderBillProduct b On a.ID_PurchaseSourceBillProduct=b.ID_PurchaseOrderBillProduct
  110. Group By b.ID_Product ,b.ID_PurchaseOrderBill
  111. Having (sum(a.Quantity_Order)-sum(a.Quantity_InDepot)-sum(a.Quantity_EndCase)) &gt; 0
  112. )ta
  113. Join Product On Product.ID_Product=ta.ID_Product
  114. Join PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=ta.ID_PurchaseOrderBill
  115. Where PurchaseOrderBill.ID_Assessor Is Not Null
  116. Order By PurchaseOrderBill.No_PurchaseOrderBill
  117. ">
  118. <Tables>
  119. <Table name="PurchaseNoInDepot"/>
  120. </Tables>
  121. </SearchNoInDepotProcess>
  122. <SearchNoInDepot CmdType="Text" CmdText="
  123. Select PurchaseOrderBill.No_PurchaseOrderBill,PurchaseOrderBill.Date_PurchaseOrderBill,PurchaseOrderBill.ArrivalDate_PurchaseOrderBill,Product.No_Product,Product.Name_Product ,
  124. a.Quantity_PurchaseOrderBillProduct,IsNull(a.Quantity_OnShip,0) As Quantity_OnShip,IsNull(b.Quantity_InDepot,0) As Quantity_InDepot,(a.Quantity_PurchaseOrderBillProduct-IsNull(a.Quantity_OnShip,0)-IsNull(b.Quantity_InDepot,0)) As NoInDepot,Quantity_EndCase=0.00
  125. From
  126. (
  127. Select PurchaseOrderBill.ID_PurchaseOrderBill,PurchaseOrderBillProduct.ID_Product,Sum(PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct) As Quantity_PurchaseOrderBillProduct,Sum(OnShipProduct.Quantity_OnShip) As Quantity_OnShip
  128. From PurchaseOrderBillProduct
  129. Join PurchaseOrderBill On PurchaseOrderBillProduct.ID_PurchaseOrderBill=PurchaseOrderBill.ID_PurchaseOrderBill
  130. Left Join OnShipProduct On OnShipProduct.ID_PurchaseSourceBillProduct=PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct
  131. Where PurchaseOrderBill.ID_Assessor Is Not Null
  132. Group By PurchaseOrderBillProduct.ID_Product,PurchaseOrderBill.ID_PurchaseOrderBill
  133. )a
  134. Left Join
  135. (
  136. Select PurchaseOrderBill.ID_PurchaseOrderBill,PurchaseInDepotBillProduct.ID_Product,Sum(PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct) As Quantity_InDepot
  137. From PurchaseInDepotBillProduct
  138. Join PurchaseInDepotBill On PurchaseInDepotBill.ID_PurchaseInDepotBill=PurchaseInDepotBillProduct.ID_PurchaseInDepotBill
  139. Join PurchaseOrderBill On PurchaseOrderBill.No_PurchaseOrderBill=PurchaseInDepotBillProduct.No_FromBill
  140. Where PurchaseInDepotBill.ID_Assessor Is Not Null
  141. Group By PurchaseInDepotBillProduct.ID_Product,PurchaseOrderBill.ID_PurchaseOrderBill
  142. )b On a.ID_PurchaseOrderBill=b.ID_PurchaseOrderBill And a.ID_Product=b.ID_Product
  143. Join Product On Product.ID_Product=a.ID_Product
  144. Join PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=a.ID_PurchaseOrderBill
  145. Where (a.Quantity_PurchaseOrderBillProduct-IsNull(b.Quantity_InDepot,0)) &gt; 0
  146. Order By PurchaseOrderBill.No_PurchaseOrderBill
  147. ">
  148. <Tables>
  149. <Table name="PurchaseNoInDepot"/>
  150. </Tables>
  151. </SearchNoInDepot>
  152. <SearchProcess CmdType="Text" CmdText="Select StockAndInDepot_SystemSetting From SystemSetting">
  153. <Tables>
  154. <Table name="SystemSetting"/>
  155. </Tables>
  156. </SearchProcess>
  157. </Search>
  158. </Server>
  159. <Lables>
  160. <Search>
  161. if(@Block==true)
  162. Search("SearchNoInDepotProcess");
  163. else
  164. Search("SearchNoInDepot");
  165. txtBillSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_PurchaseOrderBillProduct");
  166. txtIndepotSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_InDepot");
  167. txtEndCaseSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_EndCase");
  168. txtOnshipSum.CValue=SumOfCol("#PurchaseNoInDepot.Quantity_OnShip");
  169. txtNotShipSum.CValue=SumOfCol("#PurchaseNoInDepot.NoInDepot");
  170. </Search>
  171. </Lables>
  172. </Form>
  173. </Forms>