123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmSaleProductDiscountSearch">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="销售产品折扣查询";
- GetSchema();
- ]]>
- </Load>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- </Mode>
- <Controls>
- <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>
- <IKTextBox name="txtCustomerName1" DataSource="UI.StartName_Customer"/>
- <IKTextBox name="txtCustomerName2" DataSource="UI.EndName_Customer"/>
- <IKDateTimePicker name="dtStart" DataSource="UI.StartDate"/>
- <IKDateTimePicker name="dtEnd" DataSource="UI.EndDate"/>
- <IKTextButton name="tbProductNo1" DataSource="UI.StartNo_Product">
- <Events>
- <Click>
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProductNo1.CValue);
- if( @temp == "" )
- return;
- tbProductNo1.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- tbProductNo2.CValue = tbProductNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbProductNo2" DataSource="UI.EndNo_Product">
- <Events>
- <Click>
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProductNo2.CValue);
- if( @temp == "" )
- return;
- tbProductNo2.CValue = @temp;
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtProductName1" DataSource="UI.StartName_Product"/>
- <IKTextBox name="txtProductName2" DataSource="UI.EndName_Product"/>
- <IKTextBox name="txtDiscount" DataSource="UI.Discount"/>
- <IKExtendGrid name="dgProduct" DataSource="Total" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Total.No_Product"/>
- <DataColumn Index="1" DataSource="Total.Name_Product"/>
- <DataColumn Index="2" DataSource="Total.Quantity_SaleBillProduct"/>
- <DataColumn Index="3" DataSource="Total.UnitPrice_SaleBillProduct"/>
- <DataColumn Index="4" DataSource="Total.Discount_SaleBillProduct"/>
- <DataColumn Index="5" DataSource="Total.No_Customer"/>
- <DataColumn Index="6" DataSource="Total.Name_Customer"/>
- <DataColumn Index="7" DataSource="Total.LowDiscount_Customer"/>
- <DataColumn Index="8" DataSource="Total.No_SaleBill"/>
- <DataColumn Index="9" DataSource="Total.Date_SaleBill"/>
- <DataColumn Index="10" DataSource="Total.Name_Principal"/>
- <Events>
- <ClickPreview>
- PrintReport(dgProduct.CurrentView);
- </ClickPreview>
- <ClickRefresh>
- Empty();
- NewInstance();
- @StartCustomerNo =DBNull();
- @EndCustomerNo =DBNull();
- @StartCustomerName =DBNull();
- @EndCustomerName =DBNull();
- @StartProductNo =DBNull();
- @EndProductNo =DBNull();
- @StartProductName =DBNull();
- @EndProductName =DBNull();
- @StartDate =DBNull();
- @EndDate =DBNull();
- @Discount =DBNull();
- if(!Equals(tbCustomerNo1.CValue,""))
- @StartCustomerNo = tbCustomerNo1.CValue;
- if(!Equals(tbCustomerNo2.CValue,""))
- @EndCustomerNo = tbCustomerNo2.CValue;
- if(!Equals(txtCustomerName1.CValue,""))
- @StartCustomerName = txtCustomerName1.CValue;
- if(!Equals(txtCustomerName2.CValue,""))
- @EndCustomerName = txtCustomerName2.CValue;
- if(!Equals(tbProductNo1.CValue,""))
- @StartProductNo= tbProductNo1.CValue;
- if(!Equals(tbProductNo2.CValue,""))
- @EndProductNo= tbProductNo2.CValue;
- if(!Equals(txtProductName1.CValue,""))
- @StartProductName = txtProductName1.CValue;
- if(!Equals(txtProductName2.CValue,""))
- @EndProductName = txtProductName2.CValue;
- if(dtStart.Checked)
- @StartDate= dtStart.CValue;
- if(dtEnd.Checked)
- @EndDate= dtEnd.CValue;
- if(!Equals(txtDiscount.CValue,""))
- @Discount = txtDiscount.CValue;
- Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartCustomerName,@EndCustomerName,@StartProductNo,@EndProductNo,@StartProductName,@EndProductName,@StartDate,@EndDate,@Discount,GetFieldRight("销货单","特价单","查看"));
- if(Equals(@StartCustomerNo,DBNull()))
- @StartCustomerNo = "";
- if(Equals(@EndCustomerNo,DBNull()))
- @EndCustomerNo = "";
- if(Equals(@StartCustomerName,DBNull()))
- @StartCustomerName = "";
- if(Equals(@EndCustomerName,DBNull()))
- @EndCustomerName = "";
- if(Equals(@StartProductNo,DBNull()))
- @StartProductNo = "";
- if(Equals(@EndProductNo,DBNull()))
- @EndProductNo = "";
- if(Equals(@StartProductName,DBNull()))
- @StartProductName = "";
- if(Equals(@EndProductName,DBNull()))
- @EndProductName = "";
- if(Equals(@StartDate,DBNull()))
- @StartDate = "";
- if(Equals(@EndDate,DBNull()))
- @EndDate = "";
- if(Equals(@Discount,DBNull()))
- @Discount = "";
- #UI.StartNo_Customer = @StartCustomerNo;
- #UI.EndNo_Customer = @EndCustomerNo;
- #UI.StartName_Customer = @StartCustomerName;
- #UI.EndName_Customer = @EndCustomerName;
- #UI.StartNo_Product = @StartProductNo;
- #UI.EndNo_Product = @EndProductNo;
- #UI.StartName_Product = @StartProductName;
- #UI.EndName_Product =@EndProductName;
- #UI.StartDate = @StartDate;
- #UI.EndDate =@EndDate;
- #UI.Discount = @Discount;
- </ClickRefresh>
- <ClickFilter>
- ;
- </ClickFilter>
- <ClickNOFilter>
- ;
- </ClickNOFilter>
- </Events>
- </IKExtendGrid>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- Empty();
- NewInstance();
- @StartCustomerNo =DBNull();
- @EndCustomerNo =DBNull();
- @StartCustomerName =DBNull();
- @EndCustomerName =DBNull();
- @StartProductNo =DBNull();
- @EndProductNo =DBNull();
- @StartProductName =DBNull();
- @EndProductName =DBNull();
- @StartDate =DBNull();
- @EndDate =DBNull();
- @Discount =DBNull();
- if(!Equals(tbCustomerNo1.CValue,""))
- @StartCustomerNo = tbCustomerNo1.CValue;
- if(!Equals(tbCustomerNo2.CValue,""))
- @EndCustomerNo = tbCustomerNo2.CValue;
- if(!Equals(txtCustomerName1.CValue,""))
- @StartCustomerName = txtCustomerName1.CValue;
- if(!Equals(txtCustomerName2.CValue,""))
- @EndCustomerName = txtCustomerName2.CValue;
- if(!Equals(tbProductNo1.CValue,""))
- @StartProductNo= tbProductNo1.CValue;
- if(!Equals(tbProductNo2.CValue,""))
- @EndProductNo= tbProductNo2.CValue;
- if(!Equals(txtProductName1.CValue,""))
- @StartProductName = txtProductName1.CValue;
- if(!Equals(txtProductName2.CValue,""))
- @EndProductName = txtProductName2.CValue;
- if(dtStart.Checked)
- @StartDate= dtStart.CValue;
- if(dtEnd.Checked)
- @EndDate= dtEnd.CValue;
- if(!Equals(txtDiscount.CValue,""))
- @Discount = txtDiscount.CValue;
- Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartCustomerName,@EndCustomerName,@StartProductNo,@EndProductNo,@StartProductName,@EndProductName,@StartDate,@EndDate,@Discount,GetFieldRight("销货单","特价单","查看"));
- if(Equals(@StartCustomerNo,DBNull()))
- @StartCustomerNo = "";
- if(Equals(@EndCustomerNo,DBNull()))
- @EndCustomerNo = "";
- if(Equals(@StartCustomerName,DBNull()))
- @StartCustomerName = "";
- if(Equals(@EndCustomerName,DBNull()))
- @EndCustomerName = "";
- if(Equals(@StartProductNo,DBNull()))
- @StartProductNo = "";
- if(Equals(@EndProductNo,DBNull()))
- @EndProductNo = "";
- if(Equals(@StartProductName,DBNull()))
- @StartProductName = "";
- if(Equals(@EndProductName,DBNull()))
- @EndProductName = "";
- if(Equals(@StartDate,DBNull()))
- @StartDate = "";
- if(Equals(@EndDate,DBNull()))
- @EndDate = "";
- if(Equals(@Discount,DBNull()))
- @Discount = "";
- #UI.StartNo_Customer = @StartCustomerNo;
- #UI.EndNo_Customer = @EndCustomerNo;
- #UI.StartName_Customer = @StartCustomerName;
- #UI.EndName_Customer = @EndCustomerName;
- #UI.StartNo_Product = @StartProductNo;
- #UI.EndNo_Product = @EndProductNo;
- #UI.StartName_Product = @StartProductName;
- #UI.EndName_Product =@EndProductName;
- #UI.StartDate = @StartDate;
- #UI.EndDate =@EndDate;
- #UI.Discount = @Discount;
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnEmpty">
- <Events>
- <Click>
- ChangeMode("Search");
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <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>
- </Client>
- <Server>
- <Tables>
- <Table name="UI" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" Select Convert(Nvarchar(64),'') as StartNo_Customer,Convert(Nvarchar(64),'') as EndNo_Customer,
- Convert(Nvarchar(64),'') as StartName_Customer,Convert(Nvarchar(64),'') as EndName_Customer,
- Convert(Nvarchar(64),'') as StartNo_Product,Convert(Nvarchar(64),'') as EndNo_Product,
- Convert(Nvarchar(64),'') as StartName_Product,Convert(Nvarchar(64),'') as EndName_Product,
- Convert(DateTime,0) as StartDate,Convert(DateTime,0) as EndDate,
- Convert(Nvarchar(64),'') as Discount"/>
- </Table>
- <Table name="Total" Type="Child">
- <GetSchema CmdType="Text" CmdText=" Select Top 0 No_Product,Name_Product,Quantity_SaleBillProduct,UnitPrice_SaleBillProduct,Discount_SaleBillProduct,
- No_Customer,Name_Customer,LowDiscount_Customer,No_SaleBill,Date_SaleBill,Name_Employee AS Name_Principal
- From SaleBill
- Left Join SaleBillProduct On SaleBill.ID_SaleBill = SaleBillProduct.ID_SaleBill
- Left Join Employee On Employee.ID_Employee = SaleBill.ID_Principal
- Left Join Product On Product.ID_Product = SaleBillProduct.ID_Product
- Left Join Customer On Customer.ID_Customer = SaleBill.ID_Customer
- "/>
- </Table>
- </Tables>
- <Search>
- <SearchReceivales CmdType="Text" CmdText="Select No_Product,Name_Product,Quantity_SaleBillProduct,UnitPrice_SaleBillProduct,Discount_SaleBillProduct,
- No_Customer,Name_Customer,LowDiscount_Customer,No_SaleBill,Date_SaleBill,Name_Employee AS Name_Principal
- From SaleBill
- Left Join SaleBillProduct On SaleBill.ID_SaleBill = SaleBillProduct.ID_SaleBill
- Left Join Employee On Employee.ID_Employee = SaleBill.ID_Principal
- Left Join Product On Product.ID_Product = SaleBillProduct.ID_Product
- Left Join Customer On Customer.ID_Customer = SaleBill.ID_Customer
- Where SaleBill.ID_Assessor Is Not Null
- And No_Customer Between IsNull(@StartCustomerNo,Customer.No_Customer) AND ISNULL(@EndCustomerNo,Customer.No_Customer)
- And Name_Customer Between IsNull(@StartCustomerName,Customer.Name_Customer) And IsNull(@EndCustomerName,Customer.Name_Customer)
- And No_Product Between IsNull(@StartProductNo,Product.No_Product) And IsNull(@EndProductNo,Product.No_Product)
- And Name_Product Between IsNull(@StartProductName,Product.Name_Product) And IsNull(@EndProductName,Product.Name_Product)
- AND Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_SaleBill)
- And Discount_SaleBillProduct < IsNull(@Discount,101)
- and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End ">
- <Params>
- <Param name="@StartCustomerNo" type="Customer.No_Customer" Index="0" />
- <Param name="@EndCustomerNo" type="Customer.No_Customer" Index="1" />
- <Param name="@StartCustomerName" type="Customer.Name_Customer" Index="2" />
- <Param name="@EndCustomerName" type="Customer.Name_Customer" Index="3" />
- <Param name="@StartProductNo" type="Product.No_Product" Index="4" />
- <Param name="@EndProductNo" type="Product.No_Product" Index="5" />
- <Param name="@StartProductName" type="Product.Name_Product" Index="6" />
- <Param name="@EndProductName" type="Product.Name_Product" Index="7" />
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="8" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="9" />
- <Param name="@Discount" type="SaleBill.No_SaleBill" Index="10" />
- <Param name="@Special" type="SaleBill.Special_SaleBill" Index="11" />
- </Params>
- <Tables>
- <Table name="Total" />
- </Tables>
- </SearchReceivales>
- <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>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- tbCustomerNo1.CValue = "";
- tbCustomerNo2.CValue = "";
- txtCustomerName1.CValue = "";
- txtCustomerName2.CValue = "";
- tbProductNo1.CValue = "";
- tbProductNo2.CValue = "";
- txtProductName1.CValue = "";
- txtProductName2.CValue = "";
- dtStart.CValue = GetCurrentTime();
- dtEnd.CValue = GetCurrentTime();
- dtStart.Checked = false;
- dtEnd.Checked = false;
- txtDiscount.CValue = "";
- </Search>
- </Lables>
- </Form>
- </Forms>
|