123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmReceivables">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="应收帐款";
- GetSchema();
- Empty();
- txtSum.CValue=0.00;
- ]]>
- </Load>
- <Closing>
- ;<!--TODO-->
- </Closing>
- <Closed>
- ;<!--TODO-->
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- </Mode>
- <Controls>
- <IKTextButton name="txtCustomerNo1" DataSource="UI.StartNo_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo1.CValue);
- if( @temp == "" )
- return;
- txtCustomerNo1.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- txtCustomerNo2.CValue = txtCustomerNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="txtCustomerNo2" DataSource="UI.EndNo_Customer">
- <Events>
- <Click>
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",txtCustomerNo2.CValue);
- if( @temp == "" )
- return;
- txtCustomerNo2.CValue = @temp;
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbInvoiceNo1" >
- <Events>
- <Click>
- @temp = ShowSearchBox("InvoiceNoSearch","NODEPOT","tbInvoiceNo1",tbInvoiceNo1.CValue);
- if( @temp == "" )
- return;
- tbInvoiceNo1.CValue = @temp;
- </Click>
- <TextBoxButtonTextChanged>
- tbInvoiceNo2.CValue = tbInvoiceNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbInvoiceNo2" >
- <Events>
- <Click>
- @temp = ShowSearchBox("InvoiceNoSearch","NODEPOT","tbInvoiceNo2", tbInvoiceNo2.CValue);
- if( @temp == "" )
- return;
- tbInvoiceNo2.CValue = @temp;
- </Click>
- </Events>
- </IKTextButton>
- <IKExtendGrid name="ikExtendGrid1" DataSource="Total" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="Total.No_Customer"/>
- <DataColumn Index="1" DataSource="Total.ShortName_Customer"/>
- <DataColumn Index="2" DataSource="Total.No_SaleInvoice"/>
- <DataColumn Index="3" DataSource="Total.No_Invoice"/>
- <DataColumn Index="4" DataSource="Total.InvoiceDate_SaleInvoice"/>
- <DataColumn Index="5" DataSource="Total.PayDate_SaleInvoice"/>
- <DataColumn Index="6" DataSource="Total.Amount_SaleInvoice"/>
- <DataColumn Index="7" DataSource="Total.StrikedAmount_SaleInvoice"/>
- <DataColumn Index="8" DataSource="Total.ReceivableMoney"/>
- <Events>
- <ClickPreview>
- PrintReport(ikExtendGrid1.CurrentView);
- </ClickPreview>
- <ClickFilter>
- txtSum.CValue=SumOfCol("#Total.ReceivableMoney",ikExtendGrid1.FilterCondition,true);
- </ClickFilter>
- <ClickNOFilter>
- txtSum.CValue=SumOfCol("#Total.ReceivableMoney",ikExtendGrid1.FilterCondition,true);
- </ClickNOFilter>
- <ClickRefresh>
- Empty();
- @StartCustomerNo =DBNull();
- @EndCustomerNo =DBNull();
- @StartSaleInvoiceNo =DBNull();
- @EndSaleInvoiceNo =DBNull();
- @StartInvoiceDate =DBNull();
- @EndInvoiceDate =DBNull();
- @StartPayDate =DBNull();
- @EndPayDate =DBNull();
- if(!Equals(txtCustomerNo1.CValue,""))
- @StartCustomerNo= txtCustomerNo1.CValue;
- if(!Equals(txtCustomerNo2.CValue,""))
- @EndCustomerNo= txtCustomerNo2.CValue;
- if(!Equals(tbInvoiceNo1.CValue,""))
- @StartSaleInvoiceNo= tbInvoiceNo1.CValue;
- if(!Equals(tbInvoiceNo2.CValue,""))
- @EndSaleInvoiceNo= tbInvoiceNo2.CValue;
- if(dtAssessDate1.Checked)
- @StartInvoiceDate= dtAssessDate1.Value;
- if(dtAssessDate2.Checked)
- @EndInvoiceDate= dtAssessDate2.Value;
- if(dt1.Checked)
- @StartPayDate= dt1.Value;
- if(dt2.Checked)
- @EndPayDate= dt2.Value;
- Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartSaleInvoiceNo,@EndSaleInvoiceNo,
- @StartInvoiceDate,@EndInvoiceDate,@StartPayDate,@EndPayDate,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- txtSum.CValue=SumOfCol("#Total.ReceivableMoney");
- </ClickRefresh>
- </Events>
- </IKExtendGrid>
- <IKButton name="btnSearch">
- <Events>
- <Click>
- Empty();
- @StartCustomerNo =DBNull();
- @EndCustomerNo =DBNull();
- @StartSaleInvoiceNo =DBNull();
- @EndSaleInvoiceNo =DBNull();
- @StartInvoiceDate =DBNull();
- @EndInvoiceDate =DBNull();
- @StartPayDate =DBNull();
- @EndPayDate =DBNull();
- if(!Equals(txtCustomerNo1.CValue,""))
- @StartCustomerNo= txtCustomerNo1.CValue;
- if(!Equals(txtCustomerNo2.CValue,""))
- @EndCustomerNo= txtCustomerNo2.CValue;
- if(!Equals(tbInvoiceNo1.CValue,""))
- @StartSaleInvoiceNo= tbInvoiceNo1.CValue;
- if(!Equals(tbInvoiceNo2.CValue,""))
- @EndSaleInvoiceNo= tbInvoiceNo2.CValue;
- if(dtAssessDate1.Checked)
- @StartInvoiceDate= dtAssessDate1.Value;
- if(dtAssessDate2.Checked)
- @EndInvoiceDate= dtAssessDate2.Value;
- if(dt1.Checked)
- @StartPayDate= dt1.Value;
- if(dt2.Checked)
- @EndPayDate= dt2.Value;
- Search("SearchReceivales",@StartCustomerNo,@EndCustomerNo,@StartSaleInvoiceNo,@EndSaleInvoiceNo,
- @StartInvoiceDate,@EndInvoiceDate,@StartPayDate,@EndPayDate,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID());
- txtSum.CValue=SumOfCol("#Total.ReceivableMoney");
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnClear">
- <Events>
- <Click>
- Empty();
- txtCustomerNo1.CValue="";
- txtCustomerNo2.CValue="";
- tbInvoiceNo1.CValue="";
- tbInvoiceNo2.CValue="";
- dtAssessDate1.Checked=False;
- dtAssessDate2.Checked=False;
- dt1.Checked=False;
- dt2.Checked=False;
- txtSum.CValue=0.00;
- </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="InvoiceNoSearch" DataSource="SaleInvoice" SearchFunction="SearchAllInvoiceNo" SearchFunctionByNo="" MappingName="发票编号">
- <DataColumn Index="0" MappingName="#SaleInvoice.No_Invoice" HeaderText="发票编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#SaleInvoice.InvoiceDate_SaleInvoice" HeaderText="发票日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="Total" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- Select Top 0 No_Customer,ShortName_Customer,SaleInvoice.No_SaleInvoice,No_Invoice,InvoiceDate_SaleInvoice,PayDate_SaleInvoice,Amount_SaleInvoice,StrikedAmount_SaleInvoice,(Amount_SaleInvoice-StrikedAmount_SaleInvoice) As ReceivableMoney
- From SaleInvoice
- Join Customer On Customer.ID_Customer=SaleInvoice.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>
- <SearchAllInvoiceNo CmdType="Text" CmdText="SELECT No_Invoice,InvoiceDate_SaleInvoice FROM SaleInvoice">
- <Tables>
- <Table name="AllInvoiceNo" />
- </Tables>
- </SearchAllInvoiceNo>
- <SearchReceivales CmdType="Text" CmdText="
- Select No_Customer,ShortName_Customer,SaleInvoice.No_SaleInvoice,No_Invoice,InvoiceDate_SaleInvoice,PayDate_SaleInvoice,IsNull(Amount_SaleInvoice,0) as Amount_SaleInvoice,IsNull(StrikedAmount_SaleInvoice,0) as StrikedAmount_SaleInvoice,(IsNull(Amount_SaleInvoice,0)-IsNull(StrikedAmount_SaleInvoice,0)) As ReceivableMoney
- From SaleInvoice
- Join Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
-
- WHERE No_Customer BETWEEN ISNULL(@StartCustomerNo,'') AND ISNULL(@EndCustomerNo,(SELECT MAX(No_Customer) FROM Customer))
- And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End
- AND SaleInvoice.No_Invoice BETWEEN ISNULL(@StartSaleInvoiceNo,'') AND ISNULL(@EndSaleInvoiceNo,(Select MAX(No_Invoice) FROM SaleInvoice))
- AND InvoiceDate_SaleInvoice BETWEEN ISNULL(DATEADD(day,0,DATEDIFF(day,0,@StartInvoiceDate)),0) AND ISNULL(DATEADD(day,0,(DATEDIFF(day,0,@EndInvoiceDate)+1)),'9999-12-31')
- AND PayDate_SaleInvoice BETWEEN ISNULL(DATEADD(day,0,DATEDIFF(day,0,@StartPayDate)),0) AND ISNULL(DATEADD(day,0,(DATEDIFF(day,0,@EndPayDate)+1)),'9999-12-31')
- AND SaleInvoice.ID_Assessor IS NOT NULL AND SaleInvoice.Disable_SaleInvoice=0 AND (IsNull(Amount_SaleInvoice,0)-IsNull(StrikedAmount_SaleInvoice,0)) != 0
- Order By No_Customer
- ">
- <Params>
- <Param name="@StartCustomerNo" type="Customer.No_Customer" Index="0" />
- <Param name="@EndCustomerNo" type="Customer.No_Customer" Index="1" />
- <Param name="@StartSaleInvoiceNo" type="SaleInvoice.No_Invoice" Index="2" />
- <Param name="@EndSaleInvoiceNo" type="SaleInvoice.No_Invoice" Index="3" />
- <Param name="@StartInvoiceDate" type="SaleBill.AssessDate_SaleBill" Index="4" />
- <Param name="@EndInvoiceDate" type="SaleBill.AssessDate_SaleBill" Index="5" />
- <Param name="@StartPayDate" type="SaleBill.AssessDate_SaleBill" Index="6" />
- <Param name="@EndPayDate" type="SaleBill.AssessDate_SaleBill" Index="7" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="8" />
- </Params>
- <Tables>
- <Table name="Total"/>
- </Tables>
- </SearchReceivales>
- </Search>
- </Server>
- <Lables>
- <Search>
- </Search>
- </Lables>
- </Form>
- </Forms>
|