123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <?xml version="1.0" encoding="utf-8"?>
- <Forms>
- <Form Name="FrmSaleRtnNoInDepot">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="销退未入库";
- GetSchema();
- Search("SearchSystemSetting");
- @SaleBackAndInDepot = #System.SaleBackAndInDepot_SystemSetting;
- if(@SaleBackAndInDepot != 0)
- {
- if(Search("SearchSaleRtnNoInBillHaveFlow",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- Search("SearchSaleRtnNoInBillProductHaveFlow",#SaleRtnNoInBill.No_SaleRtnBill,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- else
- {
- if(Search("SearchSaleRtnNoInBillNoFlow",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- Search("SearchSaleRtnNoInBillProductNoFlow",#SaleRtnNoInBill.No_SaleRtnBill,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
-
- txtSalRtnSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_SaleRtn");
- txtIndepotSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_InDepot");
- ]]>
- </Load>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKExtendGrid name="dgSaleRtnBill" DataSource="SaleRtnNoInBill" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="SaleRtnNoInBill.No_SaleRtnBill" />
- <DataColumn Index="1" DataSource="SaleRtnNoInBill.Date_SaleRtnBill"/>
- <DataColumn Index="2" DataSource="SaleRtnNoInBill.No_Customer" />
- <DataColumn Index="3" DataSource="SaleRtnNoInBill.ShortName_Customer" />
- <DataColumn Index="4" DataSource="SaleRtnNoInBill.Reason_SaleRtnBill" />
- <Events>
- <ClickPaste>
- ;
- </ClickPaste>
- <ClickExcel>
- ;
- </ClickExcel>
- <ClickPrint>
- ;
- </ClickPrint>
- <ClickPreview>
- PrintReport(dgSaleRtnBill.CurrentView,"FrmSaleRtnNoInDepot",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- </ClickPreview>
- <ClickRefresh>
- Empty();
- if(@SaleBackAndInDepot != 0)
- {
- if(Search("SearchSaleRtnNoInBillHaveFlow",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- Search("SearchSaleRtnNoInBillProductHaveFlow",#SaleRtnNoInBill.No_SaleRtnBill,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- else
- {
- if(Search("SearchSaleRtnNoInBillNoFlow",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID()))
- Search("SearchSaleRtnNoInBillProductNoFlow",#SaleRtnNoInBill.No_SaleRtnBill,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- txtSalRtnSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_SaleRtn");
- txtIndepotSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_InDepot");
- </ClickRefresh>
- <ClickFirstPage>
- ;
- </ClickFirstPage>
- <ClickPrevPage>
- </ClickPrevPage>
- ;
- <ClickNextPage>
- ;
- </ClickNextPage>
- <ClickLastPage>
- ;
- </ClickLastPage>
- <ClickFilter>
- <![CDATA[
- Empty("#SaleRtnNoInBillProduct");
- if(RowCount("#SaleRtnNoInBill","IKExtendGrid") != 0)
- {
- if(@SaleBackAndInDepot != 0)
- Search("SearchSaleRtnNoInBillProductHaveFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- else
- Search("SearchSaleRtnNoInBillProductNoFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- txtSalRtnSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_SaleRtn");
- txtIndepotSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_InDepot");
- ]]>
- </ClickFilter>
- <ClickNOFilter>
- <![CDATA[
- Empty("#SaleRtnNoInBillProduct");
- if(RowCount("#SaleRtnNoInBill","IKExtendGrid") != 0)
- {
- if(@SaleBackAndInDepot != 0)
- Search("SearchSaleRtnNoInBillProductHaveFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- else
- Search("SearchSaleRtnNoInBillProductNoFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- txtSalRtnSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_SaleRtn");
- txtIndepotSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_InDepot");
- ]]>
- </ClickNOFilter>
- <ClickAdd>
- ;
- </ClickAdd>
- <ClickRemove>
- ;
- </ClickRemove>
- <CurrentCellChanged>
- <![CDATA[
- Empty("#SaleRtnNoInBillProduct");
- if(RowCount("#SaleRtnNoInBill","IKExtendGrid") != 0)
- {
- if(@SaleBackAndInDepot != 0)
- Search("SearchSaleRtnNoInBillProductHaveFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- else
- Search("SearchSaleRtnNoInBillProductNoFlow",dgSaleRtnBill.GetCurrentSpecifyValue("No_SaleRtnBill"),GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- }
- txtSalRtnSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_SaleRtn");
- txtIndepotSum.CValue = SumOfCol("#SaleRtnNoInBillProduct.Quantity_InDepot");
- ]]>
- </CurrentCellChanged>
- </Events>
- </IKExtendGrid>
- <IKDataGridEx name="dgProduct" DataSource="SaleRtnNoInBillProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="SaleRtnNoInBillProduct.No_Product" />
- <DataColumn Index="1" DataSource="SaleRtnNoInBillProduct.Name_Product" />
- <DataColumn Index="2" DataSource="SaleRtnNoInBillProduct.Quantity_SaleRtn" />
- <DataColumn Index="3" DataSource="SaleRtnNoInBillProduct.Quantity_InDepot"/>
- </IKDataGridEx>
- </Controls>
- </Client>
- <Server>
- <Tables>
- <Table name="SaleRtnNoInBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText="select top 0 SaleRtnBill.No_SaleRtnBill,SaleRtnBill.Date_SaleRtnBill,Customer.No_Customer,
- Customer.ShortName_Customer,SaleRtnBill.Reason_SaleRtnBill
- from SaleRtnBill
- left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer"/>
- </Table>
- <Table name="SaleRtnNoInBillProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText="select top 0 Product.No_Product,
- Product.Name_Product,SaleSourceBillProduct.Quantity_SaleRtn,SaleSourceBillProduct.Quantity_InDepot
- from SaleRtnBill
- left join SaleRtnBillProduct on SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- left join SaleSourceBillProduct on SaleSourceBillProduct.ID_SaleSourceBillProduct=SaleRtnBillProduct.ID_SaleSourceBillProduct
- left join Product on SaleRtnBillProduct.ID_Product=Product.ID_Product"/>
- </Table>
- </Tables>
- <Search>
- <SearchSaleRtnNoInBillHaveFlow CmdType="Text" CmdText="SELECT distinct F.No_SaleRtnBill, F.Date_SaleRtnBill,F.Reason_SaleRtnBill, G.No_Customer, G.ShortName_Customer
- FROM
- (
- SELECT ID_SaleRtnBill, No_SaleRtnBill, ID_Product, isnull(SUM(Quantity_SaleRtnBillProduct),0.00) AS Quantity_SaleRtn, isnull(SUM(Quantity_ModifyDepotBillProduct),0.00) AS Quantity_InDepot
- FROM
- (
- SELECT A.ID_SaleRtnBill, A.No_SaleRtnBill, B.ID_Product, B.Quantity_SaleRtnBillProduct, C.Quantity_ModifyDepotBillProduct
- FROM SaleRtnBill A
- LEFT JOIN SaleRtnBillProduct B on A.ID_SaleRtnBill=B.ID_SaleRtnBill
- left join (select Sum(Quantity_ModifyDepotBillProduct) as Quantity_ModifyDepotBillProduct,No_FromBill,No_FromBillProduct,Type_FromBill from ModifyDepotBillProduct
- left join ModifyDepotBill on ModifyDepotBill.ID_ModifyDepotBill = ModifyDepotBillProduct.ID_ModifyDepotBill
- where ModifyDepotBill.ID_Assessor is not null
- Group by No_FromBill,No_FromBillProduct,Type_FromBill
- )C on
- C.No_FromBill = A.No_SaleRtnBill and
- C.No_FromBillProduct=B.No_SaleRtnBillProduct and
- C.Type_FromBill=22
- WHERE A.ID_Assessor is not null
- ) D
- GROUP BY ID_SaleRtnBill, No_SaleRtnBill, ID_Product
- ) E
- LEFT JOIN SaleRtnBill F ON E.ID_SaleRtnBill = F.ID_SaleRtnBill
- LEFT JOIN Customer G ON F.ID_Customer = G.ID_Customer
- LEFT JOIN Product H ON E.ID_Product = H.ID_Product
- WHERE E.Quantity_SaleRtn > E.Quantity_InDepot
- And G.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then G.ID_Creator Else @Right End --added for validating right
- Order By F.No_SaleRtnBill">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="SaleRtnNoInBill"/>
- </Tables>
- </SearchSaleRtnNoInBillHaveFlow>
- <SearchSaleRtnNoInBillProductHaveFlow CmdType="Text" CmdText="SELECT H.No_Product, H.Name_Product, E.Quantity_SaleRtn, E.Quantity_InDepot
- FROM
- (
- SELECT ID_SaleRtnBill, No_SaleRtnBill, ID_Product, isnull(SUM(Quantity_SaleRtnBillProduct),0.00) AS Quantity_SaleRtn, isnull(SUM(Quantity_ModifyDepotBillProduct),0.00) AS Quantity_InDepot
- FROM
- (
- SELECT A.ID_SaleRtnBill, A.No_SaleRtnBill, B.ID_Product, B.Quantity_SaleRtnBillProduct, C.Quantity_ModifyDepotBillProduct
- FROM SaleRtnBill A
- LEFT JOIN SaleRtnBillProduct B on A.ID_SaleRtnBill=B.ID_SaleRtnBill
- left join (select Sum(Quantity_ModifyDepotBillProduct) as Quantity_ModifyDepotBillProduct,No_FromBill,No_FromBillProduct,Type_FromBill from ModifyDepotBillProduct
- left join ModifyDepotBill on ModifyDepotBill.ID_ModifyDepotBill = ModifyDepotBillProduct.ID_ModifyDepotBill
- where ModifyDepotBill.ID_Assessor is not null
- Group by No_FromBill,No_FromBillProduct,Type_FromBill
- )C on
- C.No_FromBill = A.No_SaleRtnBill and
- C.No_FromBillProduct=B.No_SaleRtnBillProduct and
- C.Type_FromBill=22
- WHERE A.ID_Assessor is not null AND A.No_SaleRtnBill = @No_SaleRtnBill
- ) D
- GROUP BY ID_SaleRtnBill, No_SaleRtnBill, ID_Product
- ) E
- LEFT JOIN SaleRtnBill F ON E.ID_SaleRtnBill = F.ID_SaleRtnBill
- LEFT JOIN Customer G ON F.ID_Customer = G.ID_Customer
- LEFT JOIN Product H ON E.ID_Product = H.ID_Product
- WHERE E.Quantity_SaleRtn > E.Quantity_InDepot AND F.No_SaleRtnBill = @No_SaleRtnBill
- And G.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then G.ID_Creator Else @Right End --added for validating right
- Order By F.No_SaleRtnBill">
- <Params>
- <Param name="@No_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleRtnNoInBillProduct"/>
- </Tables>
- </SearchSaleRtnNoInBillProductHaveFlow>
-
- <SearchSystemSetting CmdType="Text" CmdText=" SELECT SaleBackAndInDepot_SystemSetting FROM SystemSetting">
- <Tables>
- <Table name="System"/>
- </Tables>
- </SearchSystemSetting>
- <SearchSaleRtnNoInBillNoFlow CmdType="Text" CmdText="SELECT distinct F.No_SaleRtnBill, F.Date_SaleRtnBill,F.Reason_SaleRtnBill, G.No_Customer, G.ShortName_Customer
- FROM
- (
- SELECT ID_SaleRtnBill, No_SaleRtnBill, ID_Product, isnull(SUM(Quantity_SaleRtnBillProduct),0.00) AS Quantity_SaleRtn, isnull(SUM(Quantity_ModifyDepotBillProduct),0.00) AS Quantity_InDepot
- FROM
- (
- SELECT A.ID_SaleRtnBill, A.No_SaleRtnBill, B.ID_Product, B.Quantity_SaleRtnBillProduct, C.Quantity_ModifyDepotBillProduct
- FROM SaleRtnBill A
- LEFT JOIN SaleRtnBillProduct B on A.ID_SaleRtnBill=B.ID_SaleRtnBill
- left join (select Sum(Quantity_ModifyDepotBillProduct) as Quantity_ModifyDepotBillProduct,No_FromBill,No_FromBillProduct,Type_FromBill from ModifyDepotBillProduct
- left join ModifyDepotBill on ModifyDepotBill.ID_ModifyDepotBill = ModifyDepotBillProduct.ID_ModifyDepotBill
- where ModifyDepotBill.ID_Assessor is not null
- Group by No_FromBill,No_FromBillProduct,Type_FromBill
- )C on
- C.No_FromBill = A.No_SaleRtnBill and
- C.No_FromBillProduct=B.No_SaleRtnBillProduct and
- C.Type_FromBill=22
- WHERE A.ID_Assessor is not null
- ) D
- GROUP BY ID_SaleRtnBill, No_SaleRtnBill, ID_Product
- ) E
- LEFT JOIN SaleRtnBill F ON E.ID_SaleRtnBill = F.ID_SaleRtnBill
- LEFT JOIN Customer G ON F.ID_Customer = G.ID_Customer
- LEFT JOIN Product H ON E.ID_Product = H.ID_Product
- WHERE E.Quantity_SaleRtn > E.Quantity_InDepot
- And G.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then G.ID_Creator Else @Right End --added for validating right
- Order By F.No_SaleRtnBill">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="SaleRtnNoInBill"/>
- </Tables>
- </SearchSaleRtnNoInBillNoFlow>
- <SearchSaleRtnNoInBillProductNoFlow CmdType="Text" CmdText="SELECT H.No_Product, H.Name_Product, E.Quantity_SaleRtn, E.Quantity_InDepot
- FROM
- (
- SELECT ID_SaleRtnBill, No_SaleRtnBill, ID_Product, isnull(SUM(Quantity_SaleRtnBillProduct),0.00) AS Quantity_SaleRtn, isnull(SUM(Quantity_ModifyDepotBillProduct),0.00) AS Quantity_InDepot
- FROM
- (
- SELECT A.ID_SaleRtnBill, A.No_SaleRtnBill, B.ID_Product, B.Quantity_SaleRtnBillProduct, C.Quantity_ModifyDepotBillProduct
- FROM SaleRtnBill A
- LEFT JOIN SaleRtnBillProduct B on A.ID_SaleRtnBill=B.ID_SaleRtnBill
- left join (select Sum(Quantity_ModifyDepotBillProduct) as Quantity_ModifyDepotBillProduct,No_FromBill,No_FromBillProduct,Type_FromBill from ModifyDepotBillProduct
- left join ModifyDepotBill on ModifyDepotBill.ID_ModifyDepotBill = ModifyDepotBillProduct.ID_ModifyDepotBill
- where ModifyDepotBill.ID_Assessor is not null
- Group by No_FromBill,No_FromBillProduct,Type_FromBill
- )C on
- C.No_FromBill = A.No_SaleRtnBill and
- C.No_FromBillProduct=B.No_SaleRtnBillProduct and
- C.Type_FromBill=22
- WHERE A.ID_Assessor is not null and A.No_SaleRtnBill = @No_SaleRtnBill
- ) D
- GROUP BY ID_SaleRtnBill, No_SaleRtnBill, ID_Product
- ) E
- LEFT JOIN SaleRtnBill F ON E.ID_SaleRtnBill = F.ID_SaleRtnBill
- LEFT JOIN Customer G ON F.ID_Customer = G.ID_Customer
- LEFT JOIN Product H ON E.ID_Product = H.ID_Product
- WHERE E.Quantity_SaleRtn > E.Quantity_InDepot AND F.No_SaleRtnBill = @No_SaleRtnBill
- And G.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then G.ID_Creator Else @Right End --added for validating right
- Order By F.No_SaleRtnBill">
- <Params>
- <Param name="@No_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleRtnNoInBillProduct"/>
- </Tables>
- </SearchSaleRtnNoInBillProductNoFlow>
-
- </Search>
- </Server>
- <Lables>
- <Search>
-
- </Search>
- <New>
- </New>
- <View>
- </View>
- <Modify>
- </Modify>
- </Lables>
- </Form>
- </Forms>
|