123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmSaleRtnStatistics">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="销退统计表";
- @ClickType="";
- GetSchema();
- txtCoNo.CValue=GetCurrentCompanyNo();
- txtCoName.CValue=GetCurrentCompanyShortName();
- Empty();
- NewInstance();
- dtStart.CValue=GetCurrentTime();
- dtEnd.CValue=GetCurrentTime();
- ]]>
- <Lable name="CheckChange"/>
- </Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKRadioButton name="ikRadioButton1">
- <Events>
- <CheckedChanged>
- <Lable name="CheckChange"/>
- </CheckedChanged>
- </Events>
- </IKRadioButton>
- <IKRadioButton name="ikRadioButton2">
- <Events>
- <CheckedChanged>
- <Lable name="CheckChange"/>
- </CheckedChanged>
- </Events>
- </IKRadioButton>
- <IKRadioButton name="ikRadioButton3">
- <Events>
- <CheckedChanged>
- <Lable name="CheckChange"/>
- </CheckedChanged>
- </Events>
- </IKRadioButton>
- <IKRadioButton name="ikRadioButton4">
- <Events>
- <CheckedChanged>
- <Lable name="CheckChange"/>
- </CheckedChanged>
- </Events>
- </IKRadioButton>
- <IKDateTimePicker name = "dtStart">
- <Events>
- <CheckedChanged>
- dtEnd.Checked = dtStart.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEnd.CValue = dtStart.CValue;
- </ValueChanged>
- </Events>
- </IKDateTimePicker>
- <IKTextButton name="tbSaleRtnBillNo1" >
- <Events>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleRtnBillNo1",tbSaleRtnBillNo1.CValue);
- </Click>
- <TextBoxButtonTextChanged>
- tbSaleRtnBillNo2.CValue = tbSaleRtnBillNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbSaleRtnBillNo2" >
- <Events>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleRtnBillNo2",tbSaleRtnBillNo2.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo1" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo1.CValue = @temp;
- ]]>
- </Click>
- <TextBoxButtonTextChanged>
- tbCustomerNo2.CValue = tbCustomerNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo2" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo2.CValue = @temp;
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbPrincipal1" DataSource="Principal" DisplayMember="Name_Employee" NoMember="No_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbPrincipal1");
- Search("SearchPrincipal");
- UpdateForm(true, "cbPrincipal1");
- </Reload>
- <TextChanged>
- cbPrincipal2.SelectedName = cbPrincipal1.SelectedName;
- cbPrincipal2.SelectedNo=cbPrincipal1.SelectedNo;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbPrincipal2" DataSource="Principal" DisplayMember="Name_Employee" NoMember="No_Employee" >
- <Events>
- <Reload>
- UpdateForm(false, "cbPrincipal2");
- Search("SearchPrincipal");
- UpdateForm(true, "cbPrincipal2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbLocation1" DataSource="Location" DisplayMember="Name_Location" NoMember="No_Location">
- <Events>
- <Reload>
- UpdateForm(false, "cbLocation1");
- Search("SearchLocation");
- UpdateForm(true, "cbLocation1");
- </Reload>
- <TextChanged>
- cbLocation2.SelectedName = cbLocation1.SelectedName;
- cbLocation2.SelectedNo = cbLocation1.SelectedNo;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbLocation2" DataSource="Location" DisplayMember="Name_Location" NoMember="No_Location">
- <Events>
- <Reload>
- UpdateForm(false, "cbLocation2");
- Search("SearchLocation");
- UpdateForm(true, "cbLocation2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextButton name="tbProduct1" >
- <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" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct2.CValue);
- if( @temp == "" )
- return;
- tbProduct2.CValue = @temp;
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbType1" 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" DataSource="Type" DisplayMember="Type_Product" >
- <Events>
- <Reload>
- UpdateForm(false, "cbType2");
- Search("SearchType");
- UpdateForm(true, "cbType2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKButton name="btnView">
- <Events>
- <Click>
- @ClickType="View";
- <Lable name="Action"/>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnExcel">
- <Events>
- <Click>
- @ClickType="Excel";
- <Lable name="Action"/>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnWord">
- <Events>
- <Click>
- @ClickType="Word";
- <Lable name="Action"/>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnPrint">
- <Events>
- <Click>
- @ClickType="PrintToPrinter";
- <Lable name="Action"/>
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="SaleRtnBill" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="">
- <DataColumn Index="0" MappingName="#SaleRtnBill.No_SaleRtnBill" HeaderText="退货单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#SaleRtnBill.Date_SaleRtnBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#SaleRtnBill.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#SaleRtnBill.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_SaleRtnBill=0 and Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="SaleRtnBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 SaleRtnBill.* FROM SaleRtnBill"/>
- </Table>
- <Table name="Get" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 convert(datetime,0) as StartDate ,
- convert(datetime,0) as EndDate ,
- convert(nvarchar(64),'') as StartNo_SaleRtnBill ,
- convert(nvarchar(64),'') as EndNo_SaleRtnBill ,
- convert(nvarchar(64),'') as StartNo_Customer ,
- convert(nvarchar(64),'') as EndNo_Customer ,
- convert(nvarchar(64),'') as StartNo_Principal ,
- convert(nvarchar(64),'') as EndNo_Principal ,
- convert(nvarchar(64),'') as StartNo_Location ,
- convert(nvarchar(64),'') as EndNo_Location ,
- 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_Create,
- convert(bit,0) as Combine
- "/>
- </Table>
- <Table name="FrmSalesStatisticsLocation" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Location, CONVERT(NVARCHAR(64),'') AS Name_Location,CONVERT(NVARCHAR(64),'') AS Currency_SaleRtnBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount
- "/>
- </Table>
- <Table name="FrmSalesStatisticsProduct" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Product, CONVERT(NVARCHAR(64),'') AS Name_Product,CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleRtnBill,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount
- "/>
- </Table>
- <Table name="FrmSalesStatisticsPrincipal" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Employee, CONVERT(NVARCHAR(64),'') AS Principal_SaleRtnBill,CONVERT(NVARCHAR(64),'') AS Currency_SaleRtnBill,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleRtnBill,
- CONVERT(DECIMAL,0.00) AS TaxAmount,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount
- "/>
- </Table>
- <!--<Table name="FrmSalesStatisticsCustomer" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Customer, CONVERT(NVARCHAR(64),'') AS ShortName_Customer,CONVERT(NVARCHAR(64),'') AS Principal_SaleRtnBill,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleRtnBill,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleRtnBill,
- CONVERT(DECIMAL,0.00) AS TaxAmount,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount
- "/>
- </Table>-->
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText=" SELECT SaleRtnBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- 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_SaleRtnBill
- FROM SaleRtnBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleRtnBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = SaleRtnBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = SaleRtnBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = SaleRtnBill.LastModUser_SaleRtnBill
- LEFT JOIN Location ON Location.ID_Location = SaleRtnBill.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee = SaleRtnBill.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>
- <SearchPrincipal CmdType="Text" CmdText="SELECT DISTINCT No_Employee,Name_Employee
- FROM Employee
- ORDER BY No_Employee
- ">
- <Tables>
- <Table name="Principal" />
- </Tables>
- </SearchPrincipal>
- <SearchLocation CmdType="Text" CmdText=" SELECT Location.No_Location, Location.Name_Location FROM Location WHERE Location.Level_Location = 0 ORDER BY Location.No_Location">
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocation>
- <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>
- <SearchFrmSaleRtnStatisticsLocation CmdType="Text" CmdText=" CREATE TABLE Get
- (StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- Combine bit
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,Combine)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleRtnBill,''),isnull(@EndNo_SaleRtnBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),isnull(@StartNo_Principal,''),isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),@Company,@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),isnull(@StartType_Product,''),isnull(@EndType_Product,''),@Combine)
- SELECT * FROM Get
- DROP TABLE Get
-
- declare @CessOut decimal(14,4)
- Select @CessOut=CessOut_SystemSetting/100 From SystemSetting
- Select Product.No_Product,Product.Name_Product,Product.Unit_Product,Location.Name_Location,ab.Quantity,ab.Currency,ab.UnitPrice,
- ab.MoneySum,ab.Amount,ab.TaxCurrency,ab.Amount As CurrencyAmount,ab.No
- From
- (
- (
- Select ID_Product,ID_Customer,ID_Principal,ID_Location,Date_SaleRtnBill As Date,Type='S',
- Currency_SaleRtnBill As Currency,TaxCurrency_SaleRtnBill As TaxCurrency,No='退'+No_SaleRtnBill,
- UnitPrice_SaleRtnBillProduct As UnitPrice,Quantity_SaleRtnBillProduct As Quantity,
- MoneySum = case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '内含' Then (Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))-Convert(Decimal(18,2),Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))*@CessOut/(1+@CessOut)))
- else Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- Amount=case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then (Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))+Convert(Decimal(18,2),Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))*@CessOut))
- else Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end
- From SaleRtnBillProduct
- Join SaleRtnBill ON SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- Where SaleRtnBill.ID_Assessor Is Not Null AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill)
-
- )
- )ab
- LEFT JOIN Product ON Product.ID_Product = ab.ID_Product
- LEFT JOIN Location ON Location.ID_Location = ab.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = ab.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = ab.ID_Principal
- Where No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- AND Date Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date)
- Order By No_Location,No_Product,Type desc,No
- ">
- <Params>
- <Param name="@StartDate" type="SaleRtnBill.Date_SaleRtnBill" Index="0" />
- <Param name="@EndDate" type="SaleRtnBill.Date_SaleRtnBill" Index="1" />
- <Param name="@StartNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="2" />
- <Param name="@EndNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleRtnBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleRtnBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleRtnBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleRtnBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleRtnBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleRtnBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleRtnBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleRtnBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleRtnBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleRtnBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleRtnBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleRtnBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleRtnBill.ID_Customer" Index="16" />
- <Param name="@Combine" type="SaleRtnBill.Disable_SaleRtnBill" Index="17" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmSalesStatisticsLocation"/>
- </Tables>
- </SearchFrmSaleRtnStatisticsLocation>
-
- <SearchFrmSaleRtnStatisticsCustomer CmdType="Text" CmdText=" CREATE TABLE Get
- (StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- Combine bit
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,Combine)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleRtnBill,''),isnull(@EndNo_SaleRtnBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),isnull(@StartNo_Principal,''),isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),@Company,@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),isnull(@StartType_Product,''),isnull(@EndType_Product,''),@Combine)
- SELECT * FROM Get
- DROP TABLE Get
-
- declare @CessOut decimal(14,4)
- Select @CessOut=CessOut_SystemSetting/100 From SystemSetting
- Select No_Customer,ShortName_Customer,Product.No_Product,Product.Name_Product,ab.Quantity,ab.Currency,ab.UnitPrice,
- ab.MoneySum,ab.Amount,ab.TaxCurrency,ab.Amount As CurrencyAmount,ab.No,ab.Reason_SaleRtnBill,
- ab.Name_Principal,
- IsNull(ab.PName_SaleRtnBill,'') As PName_SaleRtnBill,
- ab.No_FromBill,
- ab.Comment_SaleRtnBill
- From
- (
- (
- Select ID_Product,ID_Customer,ID_Principal,ID_Location,Date_SaleRtnBill As Date,Reason_SaleRtnBill,
- Currency_SaleRtnBill As Currency,TaxCurrency_SaleRtnBill As TaxCurrency,No='退'+No_SaleRtnBill,
- UnitPrice_SaleRtnBillProduct As UnitPrice,Quantity_SaleRtnBillProduct As Quantity,
- MoneySum = case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '内含' Then (Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))-Convert(Decimal(18,2),Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))*@CessOut/(1+@CessOut)))
- else Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- Amount=case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then (Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))+Convert(Decimal(18,2),Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))*@CessOut))
- else Convert(Decimal(18,2),(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- Name_Employee As Name_Principal,
- PName_SaleRtnBill,
- No_FromBill,
- Comment_SaleRtnBill
- From SaleRtnBillProduct
- Join SaleRtnBill ON SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- Join Employee On Employee.ID_Employee = SaleRtnBill.ID_Principal
- Where SaleRtnBill.ID_Assessor Is Not Null AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill)
-
- )
-
- )ab
- LEFT JOIN Product ON Product.ID_Product = ab.ID_Product
- LEFT JOIN Location ON Location.ID_Location = ab.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = ab.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = ab.ID_Principal
- Where No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- --AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- --AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Date Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- Order By No_Customer,No
- ">
- <Params>
- <Param name="@StartDate" type="SaleRtnBill.Date_SaleRtnBill" Index="0" />
- <Param name="@EndDate" type="SaleRtnBill.Date_SaleRtnBill" Index="1" />
- <Param name="@StartNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="2" />
- <Param name="@EndNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleRtnBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleRtnBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleRtnBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleRtnBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleRtnBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleRtnBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleRtnBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleRtnBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleRtnBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleRtnBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleRtnBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleRtnBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleRtnBill.ID_Customer" Index="16" />
- <Param name="@Combine" type="SaleRtnBill.Disable_SaleRtnBill" Index="17" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmSalesStatisticsCustomer"/>
- </Tables>
- </SearchFrmSaleRtnStatisticsCustomer>
- <SearchFrmSaleRtnStatisticsPrincipal CmdType="Text" CmdText="CREATE TABLE Get
- (StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- Combine bit
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,Combine)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleRtnBill,''),isnull(@EndNo_SaleRtnBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),isnull(@StartNo_Principal,''),isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),@Company,@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),isnull(@StartType_Product,''),isnull(@EndType_Product,''),@Combine)
- SELECT * FROM Get
- DROP TABLE Get
- Select Customer.No_Customer,Customer.ShortName_Customer,Name_Employee As Principal,No_Employee As No_Principal,Currency,TaxCurrency,No,Amount,GoodsAmount,TaxAmount,LocalAmount=Amount
- From
- (
- (
- Select ID_Customer,ID_Principal,Date_SaleRtnBill As Date,Type='S',ID_Location,
- Reason_SaleRtnBill As Currency,TaxCurrency_SaleRtnBill As TaxCurrency,No='退'+No_SaleRtnBill,
- Amount_SaleRtnBill As Amount,GoodsAmount_SaleRtnBill As GoodsAmount,TaxAmount_SaleRtnBill As TaxAmount
- From SaleRtnBill
- Where SaleRtnBill.ID_Assessor Is Not Null AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill)
-
- )
-
- )ab
- --LEFT JOIN Product ON Product.ID_Product = ab.ID_Product
- LEFT JOIN Location ON Location.ID_Location = ab.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = ab.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = ab.ID_Principal
- Where No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- --AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- --AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Date Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- Order By Principal,No_Customer,Type desc,No
- ">
- <Params>
- <Param name="@StartDate" type="SaleRtnBill.Date_SaleRtnBill" Index="0" />
- <Param name="@EndDate" type="SaleRtnBill.Date_SaleRtnBill" Index="1" />
- <Param name="@StartNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="2" />
- <Param name="@EndNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleRtnBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleRtnBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleRtnBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleRtnBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleRtnBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleRtnBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleRtnBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleRtnBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleRtnBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleRtnBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleRtnBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleRtnBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleRtnBill.ID_Customer" Index="16" />
- <Param name="@Combine" type="SaleRtnBill.Disable_SaleRtnBill" Index="17" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmSalesStatisticsPrincipal"/>
- </Tables>
- </SearchFrmSaleRtnStatisticsPrincipal>
- <SearchFrmSaleRtnStatisticsReason CmdType="Text" CmdText=" CREATE TABLE Get
- (StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- Combine bit
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,Combine)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleRtnBill,''),isnull(@EndNo_SaleRtnBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),isnull(@StartNo_Principal,''),isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),@Company,@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),isnull(@StartType_Product,''),isnull(@EndType_Product,''),@Combine)
- SELECT * FROM Get
- DROP TABLE Get
-
- Select TypeName,No,Date,Customer.ShortName_Customer,Name_Employee As Principal,Location.Name_Location,Currency,TaxCurrency,Amount,GoodsAmount,TaxAmount,LocalAmount=Amount
- From
- (
- (
- Select ID_Customer,ID_Principal,Date_SaleRtnBill As Date,ID_Location,Reason_SaleRtnBill As TypeName,
- Currency_SaleRtnBill As Currency,TaxCurrency_SaleRtnBill As TaxCurrency,No=No_SaleRtnBill,
- Amount_SaleRtnBill As Amount,GoodsAmount_SaleRtnBill As GoodsAmount,TaxAmount_SaleRtnBill As TaxAmount
- From SaleRtnBill
- Where SaleRtnBill.ID_Assessor Is Not Null AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleRtnBill,SaleRtnBill.No_SaleRtnBill)
-
- )
-
- )ab
- --LEFT JOIN Product ON Product.ID_Product = ab.ID_Product
- LEFT JOIN Location ON Location.ID_Location = ab.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = ab.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = ab.ID_Principal
- Where No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- --AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- --AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Date Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- Order By TypeName
- ">
- <Params>
- <Param name="@StartDate" type="SaleRtnBill.Date_SaleRtnBill" Index="0" />
- <Param name="@EndDate" type="SaleRtnBill.Date_SaleRtnBill" Index="1" />
- <Param name="@StartNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="2" />
- <Param name="@EndNo_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleRtnBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleRtnBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleRtnBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleRtnBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleRtnBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleRtnBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleRtnBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleRtnBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleRtnBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleRtnBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleRtnBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleRtnBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleRtnBill.ID_Customer" Index="16" />
- <Param name="@Combine" type="SaleRtnBill.Disable_SaleRtnBill" Index="17" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmSalesStatisticsBillType"/>
- </Tables>
- </SearchFrmSaleRtnStatisticsReason>
- </Search>
- </Server>
- <Lables>
- <Search>
- </Search>
- <Action>
- <![CDATA[
- if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false && ikRadioButton3.Checked==false && ikRadioButton4.Checked==false &&ikRadioButton5.Checked==false)
- {
- MessageBox("请选择格式!",@Title);
- return;
- }
- Empty();
- @Company=GetCurrentCompanyNo();
- @Name_Create = GetCurrentUser();
- @StartDate = DBNull();
- @EndDate = DBNull();
- @StartNo_SaleRtnBill = DBNull();
- @EndNo_SaleRtnBill = DBNull();
- @StartNo_Customer = DBNull();
- @EndNo_Customer = DBNull();
- @StartNo_Principal = DBNull();
- @EndNo_Principal = DBNull();
- @StartNo_Location = DBNull();
- @EndNo_Location = DBNull();
- @StartNo_Product = DBNull();
- @EndNo_Product = DBNull();
- @StartType_Product = DBNull();
- @EndType_Product = DBNull();
- if(dtStart.Checked==true)
- @StartDate = dtStart.CValue;
- if(dtEnd.Checked==true)
- @EndDate = dtEnd.CValue;
- if(tbSaleRtnBillNo1.CValue != "")
- {@StartNo_SaleRtnBill = tbSaleRtnBillNo1.CValue;
- }
- if(tbSaleRtnBillNo2.CValue != "")
- {@EndNo_SaleRtnBill = tbSaleRtnBillNo2.CValue;
- }
- if(tbCustomerNo1.CValue != "")
- {@StartNo_Customer = tbCustomerNo1.CValue;
- }
- if(tbCustomerNo2.CValue != "")
- {@EndNo_Customer = tbCustomerNo2.CValue;
- }
- if(cbPrincipal1.Text!="")
- {
- if(!cbPrincipal1.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal1.Focus();
- return;
- }
- else
- {
- @StartNo_Principal = cbPrincipal1.SelectedNo;
- }
- }
- if(cbPrincipal2.Text!="")
- {
- if(!cbPrincipal2.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal2.Focus();
- return;
- }
- else
- {
- @EndNo_Principal = cbPrincipal2.SelectedNo;
- }
- }
- if(cbLocation1.Text!="")
- {
- if(!cbLocation1.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation1.Focus();
- return;
- }
- else
- {
- @StartNo_Location = cbLocation1.SelectedNo;
- }
- }
- if(cbLocation2.Text!="")
- {
- if(!cbLocation2.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation2.Focus();
- return;
- }
- else
- {
- @EndNo_Location = cbLocation2.SelectedNo;
- }
- }
- if(tbProduct1.CValue != "")
- @StartNo_Product = tbProduct1.CValue;
- if(tbProduct2.CValue != "")
- @EndNo_Product = tbProduct2.CValue;
- if(cbType1.Text != "")
- @StartType_Product = cbType1.Text;
- if(cbType2.Text != "")
- @EndType_Product = cbType2.Text;
- if(ikRadioButton4.Checked)
- {
- Search("SearchFrmSaleRtnStatisticsLocation",@StartDate,@EndDate,@StartNo_SaleRtnBill,@EndNo_SaleRtnBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),ckCombine.Checked);
- if(RowCount("#FrmSalesStatisticsLocation")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- switch(@ClickType)
- {
- case "View":
- PrintReport("GetFrmSaleRtnStatisticsLocation","Get","FrmSalesStatisticsLocation");
- break;
- default:
- ExportReport(@ClickType,"GetFrmSaleRtnStatisticsLocation","Get","FrmSalesStatisticsLocation");
- break;
- }
- }
-
- }
- if(ikRadioButton2.Checked)
- {
- Search("SearchFrmSaleRtnStatisticsReason",@StartDate,@EndDate,@StartNo_SaleRtnBill, @EndNo_SaleRtnBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),ckCombine.Checked);
- if(RowCount("#FrmSalesStatisticsBillType") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- switch(@ClickType)
- {
- case "View":
- PrintReport("GetFrmSaleRtnStatisticsReason","Get","FrmSalesStatisticsBillType");
- break;
- default:
- ExportReport(@ClickType,"GetFrmSaleRtnStatisticsReason","Get","FrmSalesStatisticsBillType");
- break;
- }
- }
-
- }
- if(ikRadioButton1.Checked)
- {
- Search("SearchFrmSaleRtnStatisticsPrincipal",@StartDate,@EndDate,@StartNo_SaleRtnBill, @EndNo_SaleRtnBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),ckCombine.Checked);
- if(RowCount("#FrmSalesStatisticsPrincipal") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- switch(@ClickType)
- {
- case "View":
- PrintReport("GetFrmSaleRtnStatisticsPrincipal","Get","FrmSalesStatisticsPrincipal");
- break;
- default:
- ExportReport(@ClickType,"GetFrmSaleRtnStatisticsPrincipal","Get","FrmSalesStatisticsPrincipal");
- break;
- }
- }
- }
- if(ikRadioButton3.Checked)
- {
- Search("SearchFrmSaleRtnStatisticsCustomer",@StartDate,@EndDate,@StartNo_SaleRtnBill, @EndNo_SaleRtnBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,@Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),ckCombine.Checked);
- if(RowCount("#FrmSalesStatisticsCustomer") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- switch(@ClickType)
- {
- case "View":
- PrintReport("GetFrmSaleRtnStatisticsCustomer","Get","FrmSalesStatisticsCustomer");
- break;
- default:
- ExportReport(@ClickType,"GetFrmSaleRtnStatisticsCustomer","Get","FrmSalesStatisticsCustomer");
- break;
- }
- }
- }
-
- ]]>
- </Action>
- <CheckChange>
- if(ikRadioButton4.Checked)
- {
- tbProduct1.ReadOnly=false;
- tbProduct2.ReadOnly=false;
- tbProduct1.IKButton.Enabled=true;
- tbProduct2.IKButton.Enabled=true;
- cbType1.Enabled=true;
- cbType2.Enabled=true;
- }
- else
- {
- tbProduct1.ReadOnly=true;
- tbProduct2.ReadOnly=true;
- tbProduct1.IKButton.Enabled=false;
- tbProduct2.IKButton.Enabled=false;
- cbType1.Enabled=false;
- cbType2.Enabled=false;
- }
- </CheckChange>
- </Lables>
- </Form>
- </Forms>
|