123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmCostList">
- <Client>
- <Events>
- <Load><![CDATA[
- @Title="销货成本明细";
- GetSchema();
- txtCoNo.CValue=GetCurrentCompanyNo();
- txtCoName.CValue=GetCurrentCompanyShortName();
- Empty();
- NewInstance();
- ]]></Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKTextBox name="txtCoName" DataSource="UI.Company"/>
- <IKDateTimePicker name = "dtStart" DataSource="UI.StartDate">
- <Events>
- <CheckedChanged>
- dtEnd.Checked = dtStart.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEnd.CValue = dtStart.CValue;
- </ValueChanged>
- </Events>
- </IKDateTimePicker>
- <IKDateTimePicker name="dtEnd" DataSource="UI.EndDate"/>
- <IKTextButton name="tbSaleBillNo1" DataSource="UI.StartNo_SaleBill">
- <Events>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo1",tbSaleBillNo1.CValue);
- </Click>
- <TextBoxButtonTextChanged>
- tbSaleBillNo2.CValue = tbSaleBillNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbSaleBillNo2" DataSource="UI.EndNo_SaleBill" >
- <Events>
- <Click>
- @temp=ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo2",tbSaleBillNo2.CValue);
- if(@temp=="")
- return;
- tbSaleBillNo2.CValue=@temp;
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo1" DataSource="UI.StartNo_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo1.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- tbCustomerNo2.CValue = tbCustomerNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo2" DataSource="UI.EndNo_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo2.CValue = @temp;
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbProduct1" DataSource="UI.StartNo_Product">
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct1.CValue);
- if( @temp == "" )
- return;
- tbProduct1.CValue = @temp;
- ]]>
- </Click>
- <TextBoxButtonTextChanged>
- tbProduct2.CValue = tbProduct1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
-
- </IKTextButton>
- <IKTextButton name="tbProduct2" DataSource="UI.EndNo_Product">
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct2.CValue);
- if( @temp == "" )
- return;
- tbProduct2.CValue = @temp;
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbType1" DisplaySource="UI.StartType_Product" DataSource="Type" DisplayMember="Type_Product" >
- <Events>
- <Reload>
- UpdateForm(false, "cbType1");
- Search("SearchType");
- UpdateForm(true, "cbType1");
- </Reload>
- <TextChanged>
- cbType2.Text = cbType1.Text;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbType2" DisplaySource="UI.EndType_Product" DataSource="Type" DisplayMember="Type_Product" >
- <Events>
- <Reload>
- UpdateForm(false, "cbType2");
- Search("SearchType");
- UpdateForm(true, "cbType2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKButton name="btnView">
- <Events>
- <Click>
- UpdateForm(false,"");
- #UI.Name_Creator = GetCurrentUser();
- #UI.CreatDate = GetCurrentTime();
- @StartDate = dtStart.Checked?dtStart.Value:DBNull();
- @EndDate = dtEnd.Checked?dtEnd.Value:DBNull();
- @StartNo_SaleBill = tbSaleBillNo1.CValue!=""?tbSaleBillNo1.CValue:DBNull();
- @EndNo_SaleBill =tbSaleBillNo2.CValue!=""?tbSaleBillNo2.CValue:DBNull();
- @StartNo_Customer =tbCustomerNo1.CValue!=""?tbCustomerNo1.CValue:DBNull();
- @EndNo_Customer =tbCustomerNo2.CValue!=""?tbCustomerNo2.CValue:DBNull();
- @StartNo_Product =tbProduct1.CValue!=""?tbProduct1.CValue:DBNull();
- @EndNo_Product = tbProduct2.CValue!=""?tbProduct2.CValue:DBNull();
- @StartType_Product = cbType1.Text!=""?cbType1.Text:DBNull();
- @EndType_Product = cbType2.Text!=""?cbType2.Text:DBNull();
- if(ikRadioButton2.Checked)
- {
- Search("SearchCostListByProduct",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListByProduct")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- PrintReport("UIFrmCostListByProduct","UI","FrmCostListByProduct");
- }
- }
- else
- {
- Search("SearchCostListBySaleBill",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListBySaleBill")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- PrintReport("UIFrmCostListBySaleBill","UI","FrmCostListBySaleBill");
- }
- }
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnExcel">
- <Events>
- <Click>
- UpdateForm(false,"");
- #UI.Name_Creator = GetCurrentUser();
- #UI.CreatDate = GetCurrentTime();
- @StartDate = dtStart.Checked?dtStart.Value:DBNull();
- @EndDate = dtEnd.Checked?dtEnd.Value:DBNull();
- @StartNo_SaleBill = tbSaleBillNo1.CValue!=""?tbSaleBillNo1.CValue:DBNull();
- @EndNo_SaleBill =tbSaleBillNo2.CValue!=""?tbSaleBillNo2.CValue:DBNull();
- @StartNo_Customer =tbCustomerNo1.CValue!=""?tbCustomerNo1.CValue:DBNull();
- @EndNo_Customer =tbCustomerNo2.CValue!=""?tbCustomerNo2.CValue:DBNull();
- @StartNo_Product =tbProduct1.CValue!=""?tbProduct1.CValue:DBNull();
- @EndNo_Product = tbProduct2.CValue!=""?tbProduct2.CValue:DBNull();
- @StartType_Product = cbType1.Text!=""?cbType1.Text:DBNull();
- @EndType_Product = cbType2.Text!=""?cbType2.Text:DBNull();
- if(ikRadioButton2.Checked)
- {
- Search("SearchCostListByProduct",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListByProduct")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Excel","UIFrmCostListByProduct","UI","FrmCostListByProduct");
- }
- }
- else
- {
- Search("SearchCostListBySaleBill",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListBySaleBill")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Excel","UIFrmCostListBySaleBill","UI","FrmCostListBySaleBill");
- }
- }
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnWord">
- <Events>
- <Click>
- UpdateForm(false,"");
- #UI.Name_Creator = GetCurrentUser();
- #UI.CreatDate = GetCurrentTime();
- @StartDate = dtStart.Checked?dtStart.Value:DBNull();
- @EndDate = dtEnd.Checked?dtEnd.Value:DBNull();
- @StartNo_SaleBill = tbSaleBillNo1.CValue!=""?tbSaleBillNo1.CValue:DBNull();
- @EndNo_SaleBill =tbSaleBillNo2.CValue!=""?tbSaleBillNo2.CValue:DBNull();
- @StartNo_Customer =tbCustomerNo1.CValue!=""?tbCustomerNo1.CValue:DBNull();
- @EndNo_Customer =tbCustomerNo2.CValue!=""?tbCustomerNo2.CValue:DBNull();
- @StartNo_Product =tbProduct1.CValue!=""?tbProduct1.CValue:DBNull();
- @EndNo_Product = tbProduct2.CValue!=""?tbProduct2.CValue:DBNull();
- @StartType_Product = cbType1.Text!=""?cbType1.Text:DBNull();
- @EndType_Product = cbType2.Text!=""?cbType2.Text:DBNull();
- if(ikRadioButton2.Checked)
- {
- Search("SearchCostListByProduct",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListByProduct")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Word","UIFrmCostListByProduct","UI","FrmCostListByProduct");
- }
- }
- else
- {
- Search("SearchCostListBySaleBill",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListBySaleBill")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Word","UIFrmCostListBySaleBill","UI","FrmCostListBySaleBill");
- }
- }
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnPrint">
- <Events>
- <Click>
- UpdateForm(false,"");
- #UI.Name_Creator = GetCurrentUser();
- #UI.CreatDate = GetCurrentTime();
- @StartDate = dtStart.Checked?dtStart.Value:DBNull();
- @EndDate = dtEnd.Checked?dtEnd.Value:DBNull();
- @StartNo_SaleBill = tbSaleBillNo1.CValue!=""?tbSaleBillNo1.CValue:DBNull();
- @EndNo_SaleBill =tbSaleBillNo2.CValue!=""?tbSaleBillNo2.CValue:DBNull();
- @StartNo_Customer =tbCustomerNo1.CValue!=""?tbCustomerNo1.CValue:DBNull();
- @EndNo_Customer =tbCustomerNo2.CValue!=""?tbCustomerNo2.CValue:DBNull();
- @StartNo_Product =tbProduct1.CValue!=""?tbProduct1.CValue:DBNull();
- @EndNo_Product = tbProduct2.CValue!=""?tbProduct2.CValue:DBNull();
- @StartType_Product = cbType1.Text!=""?cbType1.Text:DBNull();
- @EndType_Product = cbType2.Text!=""?cbType2.Text:DBNull();
- if(ikRadioButton2.Checked)
- {
- Search("SearchCostListByProduct",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListByProduct")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("PrintToPrinter","UIFrmCostListByProduct","UI","FrmCostListByProduct");
- }
- }
- else
- {
- Search("SearchCostListBySaleBill",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,@EndNo_Customer,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- if(RowCount("#FrmCostListBySaleBill")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("PrintToPrinter","UIFrmCostListBySaleBill","UI","FrmCostListBySaleBill");
- }
- }
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="SaleBill" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="">
- <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" HeaderText="销售单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#SaleBill.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" HeaderText="客户名称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
- <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- <FormatString>
- <Format name="SearchCustomerCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- <Format name="SearchBillCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Disable_SaleBill=0 and Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="UI" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 convert(datetime,0) as StartDate,
- convert(datetime,0) as EndDate ,
- convert(nvarchar(64),'') as StartNo_SaleBill ,
- convert(nvarchar(64),'') as EndNo_SaleBill ,
- convert(nvarchar(64),'') as StartNo_Customer ,
- convert(nvarchar(64),'') as EndNo_Customer ,
- convert(nvarchar(64),'') as StartNo_Product,
- convert(nvarchar(64),'') as EndNo_Product ,
- convert(nvarchar(64),'') as StartType_Product ,
- convert(nvarchar(64),'') as EndType_Product,
- convert(nvarchar(64),'') as Company ,
- convert(nvarchar(64),'') as Name_Creator,
- convert(datetime,0) As CreatDate "/>
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText=" SELECT SaleBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer, Customer.ID_Creator,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location, CONVERT(decimal(18,6), 0) AS NumSum, CONVERT(decimal(18,6), 0) AS MoneySum,
- CONVERT(decimal(18,6), 0) AS TaxSum, Employee.No_Employee AS No_Principal, Employee.Name_Employee AS Principal_SaleBill
- FROM SaleBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = SaleBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = SaleBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = SaleBill.LastModUser_SaleBill
- LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer FROM Customer ">
- <Tables>
- <Table name="AllCustomer" />
- </Tables>
- </SearchAllCustomer>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef as Type_Product FROM TypeDef WHERE (Type_TypeDef = 8) ORDER BY Name_TypeDef">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- <SearchCostListByProduct CmdType="Text" CmdText="
- Select Product.No_Product,Product.Name_Product,SaleBill.Date_SaleBill,SaleBill.No_SaleBill,SaleBillProduct.Quantity_SaleBillProduct,
- convert(nvarchar(64),SaleBillProduct.ID_SaleBillProduct) As ID_SaleBillProduct,SaleBillProduct.UnitPrice_SaleBillProduct,Currency_SaleBill,Product.Unit_Product,a.No_SaleOutDepotBill,a.Quantity_SaleOutDepotBillProduct,a.UnitCost_SaleOutDepotBillProduct,a.Quantity_SaleOutDepotBillProduct*a.UnitCost_SaleOutDepotBillProduct As CostMoney
- From SaleBill
- Left Join SaleBillProduct On SaleBillProduct.ID_SaleBill=SaleBill.ID_SaleBill
- Left Join Product On Product.ID_Product=SaleBillProduct.ID_Product
- Left Join Customer On Customer.ID_Customer=SaleBill.ID_Customer
- Left Join
- ( Select SaleOutDepotBill.No_SaleOutDepotBill,Quantity_SaleOutDepotBillProduct,UnitCost_SaleOutDepotBillProduct,ID_SaleSourceBillProduct
- From SaleOutDepotBill
- Left Join SaleOutDepotBillProduct On SaleOutDepotBillProduct.ID_SaleOutDepotBill=SaleOutDepotBill.ID_SaleOutDepotBill
- Where SaleOutDepotBill.ID_Assessor Is Not Null
- )a On a.ID_SaleSourceBillProduct=SaleBillProduct.ID_SaleBillProduct
- Where SaleBill.ID_Assessor Is Not Null
- And SaleBill.Date_SaleBill BETWEEN ISNULL(DATEADD(day, DATEDIFF(day, 0, @StartDate), 0), '1900-1-1') AND ISNULL(DATEADD(day, DATEDIFF(day, 0, DATEADD(day, 1, @EndDate)), 0), '9999-12-31')
- And SaleBill.No_SaleBill Between IsNull(@StartNo_SaleBill,No_SaleBill) And IsNull(@EndNo_SaleBill,No_SaleBill)
- And No_Customer Between IsNull(@StartNo_Customer,No_Customer) And IsNull(@EndNo_Customer,No_Customer)
- And No_Product Between IsNull(@StartNo_Product,No_Product) And IsNull(@EndNo_Product,No_Product)
- And Type_Product Between IsNull(@StartType_Product,Type_Product) And IsNull(@EndType_Product,Type_Product)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- Order By No_Product,No_SaleBill,No_SaleOutDepotBill
- ">
- <Params>
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@StartNo_SaleBill" type="SaleBill.No_SaleBill" Index="2" />
- <Param name="@EndNo_SaleBill" type="SaleBill.No_SaleBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5" />
- <Param name="@StartNo_Product" type="SaleBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleBill.Type_Product" Index="13" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="16" />
- </Params>
- <Tables>
- <Table name="FrmCostListByProduct"/>
- </Tables>
- </SearchCostListByProduct>
-
- <SearchCostListBySaleBill CmdType="Text" CmdText="
- Select Product.No_Product,Product.Name_Product,SaleBill.Date_SaleBill,SaleBill.No_SaleBill,SaleBillProduct.Quantity_SaleBillProduct,
- convert(nvarchar(64),SaleBillProduct.ID_SaleBillProduct) As ID_SaleBillProduct,SaleBillProduct.UnitPrice_SaleBillProduct,Currency_SaleBill,Product.Unit_Product,a.No_SaleOutDepotBill,a.Quantity_SaleOutDepotBillProduct,a.UnitCost_SaleOutDepotBillProduct,a.Quantity_SaleOutDepotBillProduct*a.UnitCost_SaleOutDepotBillProduct As CostMoney
- From SaleBill
- Left Join SaleBillProduct On SaleBillProduct.ID_SaleBill=SaleBill.ID_SaleBill
- Left Join Product On Product.ID_Product=SaleBillProduct.ID_Product
- Left Join Customer On Customer.ID_Customer=SaleBill.ID_Customer
- Left Join
- ( Select SaleOutDepotBill.No_SaleOutDepotBill,Quantity_SaleOutDepotBillProduct,UnitCost_SaleOutDepotBillProduct,ID_SaleSourceBillProduct
- From SaleOutDepotBill
- Left Join SaleOutDepotBillProduct On SaleOutDepotBillProduct.ID_SaleOutDepotBill=SaleOutDepotBill.ID_SaleOutDepotBill
- Where SaleOutDepotBill.ID_Assessor Is Not Null
- )a On a.ID_SaleSourceBillProduct=SaleBillProduct.ID_SaleBillProduct
- Where SaleBill.ID_Assessor Is Not Null
- And SaleBill.Date_SaleBill BETWEEN ISNULL(DATEADD(day, DATEDIFF(day, 0, @StartDate), 0), '1900-1-1') AND ISNULL(DATEADD(day, DATEDIFF(day, 0, DATEADD(day, 1, @EndDate)), 0), '9999-12-31')
- And SaleBill.No_SaleBill Between IsNull(@StartNo_SaleBill,No_SaleBill) And IsNull(@EndNo_SaleBill,No_SaleBill)
- And No_Customer Between IsNull(@StartNo_Customer,No_Customer) And IsNull(@EndNo_Customer,No_Customer)
- And No_Product Between IsNull(@StartNo_Product,No_Product) And IsNull(@EndNo_Product,No_Product)
- And Type_Product Between IsNull(@StartType_Product,Type_Product) And IsNull(@EndType_Product,Type_Product)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- Order By No_SaleBill,No_Product,No_SaleOutDepotBill
- ">
- <Params>
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@StartNo_SaleBill" type="SaleBill.No_SaleBill" Index="2" />
- <Param name="@EndNo_SaleBill" type="SaleBill.No_SaleBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5" />
- <Param name="@StartNo_Product" type="SaleBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleBill.Type_Product" Index="13" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="16" />
- </Params>
- <Tables>
- <Table name="FrmCostListBySaleBill"/>
- </Tables>
- </SearchCostListBySaleBill>
- </Search>
- </Server>
- <Lables>
- <Search>
- ;
- </Search>
- </Lables>
- </Form>
- </Forms>
-
-
-
|