123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmSaleContract">
- <Client>
- <Events>
- <Load><![CDATA[
- @Title="销货合同";
- GetSchema();
- ChangeMode("Search");
- ]]></Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- <View>
- <Lable name="View" />
- </View>
- </Mode>
- <Controls>
- <IKTextButton name="tbCustomerNo" DataSource="SaleBill.No_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- tbCustomerNoEnd.CValue = tbCustomerNo.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
-
- <IKTextButton name="tbCustomerNoEnd" DataSource="SaleBill.No_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNoEnd.CValue);
- if( @temp == "" )
- return;
- tbCustomerNoEnd.CValue = @temp;
- </Click>
-
- </Events>
- </IKTextButton>
- <IKTextBox name="txtShortName" DataSource="SaleBill.ShortName_Customer">
- </IKTextBox>
- <IKTextBox name="txtShortNameEnd" DataSource="SaleBill.ShortName_Customer">
- </IKTextBox>
- <IKDateTimePicker name="dtStart" DataSource="SaleBill.StartTime"/>
- <IKDateTimePicker name="dtEnd" DataSource="SaleBill.EndTime"/>
- <IKDataGridEx name="dgSaleBillResult" DataSource="SaleBill" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="SaleBill.No_SaleBill"/>
- <DataColumn Index="1" DataSource="SaleBill.Date_SaleBill"/>
- <DataColumn Index="2" DataSource="SaleBill.No_Customer1"/>
- <DataColumn Index="3" DataSource="SaleBill.ShortName_Customer"/>
- <DataColumn Index="4" DataSource="SaleBill.TransBack_SaleBill"/>
- <DataColumn Index="5" DataSource="SaleBill.TransBackDate_SaleBill"/>
- <DataColumn Index="6" DataSource="SaleBill.Assess_SaleBill"/>
- <DataColumn Index="7" DataSource="SaleBill.Status"/>
- <DataColumn Index="2" DataSource="SaleBill.No_Customer2"/>
- </IKDataGridEx>
- <IKButton name="btnSearch">
- <Events>
- <Click><![CDATA[
- if(ckDTStart.Checked)
- @StartTime = dtStart.CValue;
- else
- @StartTime = DBNull();
- if(ckDTEnd.Checked)
- @EndTime = dtEnd.CValue;
- else
- @EndTime = DBNull();
- if(!Search("SearchSaleBillList", tbCustomerNo.CValue, txtShortName.CValue, @StartTime, @EndTime,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),tbCustomerNoEnd.CValue, txtShortNameEnd.CValue))
- Empty("#SaleBill");
- else
- ChangeMode("View");
- ]]></Click>
- </Events>
- </IKButton>
- <IKButton name="btnOK">
- <Events>
- <Click>
- ShowPrintBox("ReportTitle",dgSaleBillResult.GetSelectedData(),"销售合同","对账单");
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnEmpty">
- <Events>
- <Click>
- ChangeMode("Search");
- </Click>
- </Events>
- </IKButton>
- <IKCheckBox name = "ckDTStart">
- <Events>
- <Click>
- if(ckDTStart.Checked)
- {
- dtStart.Enabled = true;
- }
- else
- {
- dtStart.Enabled = false;
- }
- </Click>
- </Events>
- </IKCheckBox>
- <IKCheckBox name = "ckDTEnd">
- <Events>
- <Click>
- if(ckDTEnd.Checked)
- {
- dtEnd.Enabled = true;
- }
- else
- {
- dtEnd.Enabled = false;
- }
- </Click>
- </Events>
- </IKCheckBox>
- </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>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="SaleBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- declare @Status nvarchar(64)
- set @Status = '未审核'
- SELECT TOP 0 SaleBill.ID_SaleBill, SaleBill.No_SaleBill, SaleBill.Date_SaleBill, customer1.No_Customer As No_Customer1,
- customer1.ShortName_Customer, '否' as TransBack_SaleBill,
- SaleBill.TransBackDate_SaleBill,'是' as Assess_SaleBill,
- @Status as Status,Getdate() as StartTime, Getdate() as EndTime,customer2.No_Customer as No_Customer2
- FROM SaleBill, Customer as customer1
- LEFT JOIN Customer customer2 ON customer1.CustomerID_Customer=customer2.ID_Customer
- Where customer1.ID_Customer = SaleBill.ID_Customer
- "/>
- </Table>
- </Tables>
- <Search>
- <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>
- <SearchSaleBillList CmdType="Text" CmdText=" declare @cmd nvarchar(4000)
- declare @string nvarchar(1000)
- set @cmd =
- N' SELECT SaleBill.ID_SaleBill,SaleBill.No_SaleBill, SaleBill.Date_SaleBill, customer1.No_Customer as No_Customer1,'
- +N' customer1.ShortName_Customer, case SaleBill.TransBack_SaleBill when 0 then '+nchar(39)+N'否'+nchar(39)+N' else '+nchar(39)+N'是'+nchar(39)+N' end as TransBack_SaleBill,'
- +N' SaleBill.TransBackDate_SaleBill,'
- +N' case SaleBill.Assess_SaleBill when 0 then '+nchar(39)+N'否'+nchar(39)+N' else '+nchar(39)+N'是'+nchar(39)+N' end as Assess_SaleBill, '
- +N' case isnull(DATALENGTH(ID_Assessor),0) when 0 then case Disable_SaleBill when 1 then '+nchar(39)+N'作废'+nchar(39)+N' else '+nchar(39)+N'未审核'+nchar(39)+N' end else '+nchar(39)+N'已审核'+nchar(39)+N' end as Status, '
- +N' customer2.No_Customer as No_Customer2'
- +N' FROM SaleBill,Customer as customer1 '
- +N' LEFT JOIN Customer customer2 ON customer1.CustomerID_Customer=customer2.ID_Customer'
- +N' Where customer1.ID_Customer = SaleBill.ID_Customer and SaleBill.Disable_SaleBill = 0 And 1=1'
-
- if(@StartTime is not null)
- begin
- set @cmd = @cmd + N' AND DATEDIFF(day,SaleBill.Date_SaleBill,'+nchar(39)+convert(nvarchar,@StartTime) +nchar(39)+N')<= 0 '
- end
- if(@EndTime is not null)
- begin
- set @cmd = @cmd +N' AND DATEDIFF(day,SaleBill.Date_SaleBill,'+nchar(39)+convert(nvarchar,@EndTime) +nchar(39)+N')>= 0 '
- end
- if(@No_Customer != '')
- begin
- set @cmd = @cmd+N' AND customer1.No_Customer >= ' + nchar(39) +@No_Customer+nchar(39)
- end
- if (@ShortName_Customer != '')
- begin
- set @cmd = @cmd+N' AND customer1.ShortName_Customer >= ' + nchar(39) +@ShortName_Customer+nchar(39)
- end
-
- if(@EndNo_Customer != '')
- begin
- set @cmd = @cmd+N' AND customer1.No_Customer <= ' + nchar(39) +@EndNo_Customer+nchar(39)
- end
- if (@EndShortName_Customer != '')
- begin
- set @cmd = @cmd+N' AND customer1.ShortName_Customer <= ' + nchar(39) +@EndShortName_Customer+nchar(39)
- end
-
- if(@Right is not null)
- begin
- set @cmd = @cmd +N' AND customer.ID_Creator= '+nchar(39)+Convert(nvarchar(64),@Right)+nchar(39)
- end
-
- set @cmd = @cmd +N' Order by SaleBill.No_SaleBill'
-
- EXECUTE sp_executesql @cmd
- Return
- ">
- <Params>
- <Param name="@No_Customer" type="SaleBill.No_Customer" Index="0"/>
- <Param name="@ShortName_Customer" type="SaleBill.ShortName_Customer" Index="1"/>
- <Param name="@StartTime" type="SaleBill.Date_SaleBill" Index="2"/>
- <Param name="@EndTime" type="SaleBill.Date_SaleBill" Index="3"/>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5"/>
- <Param name="@EndShortName_Customer" type="SaleBill.ShortName_Customer" Index="6"/>
- </Params>
- <Tables>
- <Table name="SaleBill"/>
- </Tables>
- </SearchSaleBillList>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- ckDTStart.Checked = false;
- ckDTEnd.Checked = false;
- tbCustomerNo.CValue = StringEmpty();
- txtShortName.CValue = StringEmpty();
- tbCustomerNoEnd.CValue = StringEmpty();
- txtShortNameEnd.CValue = StringEmpty();
- dtStart.CValue = DateTimeNow();
- dtEnd.CValue = DateTimeNow();
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- dgSaleBillResult.ReadOnly = true;
- dgSaleBillResult.AllowNew(false);
- </Search>
- <View>
- dgSaleBillResult.ReadOnly = false;
- dgSaleBillResult.AllowNew(false);
- dgSaleBillResult.AllowDelete(false);
- </View>
- </Lables>
- </Form>
- </Forms>
|