123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmPreGet">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="收款单";
- GetSchema();
- Search("SearchSystemSetting");
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- ChangeMode("Search");
- ]]>
- </Load>
- <Closing>
- ;<!--TODO-->
- </Closing>
- <Closed>
- ;<!--TODO-->
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- <New>
- <Lable name="New" />
- </New>
- <View>
- <Lable name="View" />
- </View>
- <Modify>
- <Lable name="Modify" />
- </Modify>
- </Mode>
- <Controls>
- <IKTextButton name="tbNo" DataSource="PreGet.No_PreGet">
- <Events>
- <Enter>
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchPreGetWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- MessageBox("该收款单不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入收款编号!", @Title);
- }
- }
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKCheckBox name="ikCkNoPreGetStrikeBalance" DataSource="PreGet.UnPreGetStrikeBalance_PreGet"/>
- <IKDataTimePicker name="dtDate" DataSource="PreGet.Date_PreGet" />
- <IKTextBox name="txtMaker" DataSource="PreGet.Creator" />
- <IKTextButton name="tbCustomerNo" DataSource="PreGet.No_Customer" >
- <Events>
- <Enter>
- UpdateForm(false,"");
- if(tbCustomerNo.CValue!=StringEmpty())
- {
- if(!Search("SearchCustomer",tbCustomerNo.CValue))
- {
- MessageBox("该客户不存在!",@Title);
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if(@temp != "")
- {
- tbCustomerNo.CValue = @temp;
- ActiveControlEvent("tbCustomerNo", "Enter");
- }
- }
- else
- {
- if (Search("SearchCustomersCustomer",tbCustomerNo.CValue))
- {
- MessageBox("该客户为 "+ #CustomersCustomer.No_Customer +" 的客户,不能填单!");
- tbCustomerNo.Text = "";
- return;
- }
- if(!Equals(#Customer.SuspendDate_Customer,DBNull()))
- {
- MessageBox("该客户已停用!",@Title);
- }
- #PreGet.ID_Customer=#Customer.ID_Customer;
- #PreGet.ShortName_Customer=#Customer.ShortName_Customer;
- #PreGet.Balance_PreGet=0;
- }
- }
- else
- {
- MessageBox("请输入客户编号!",@Title);
- #PreGet.ID_Customer=GuidEmpty();
- #PreGet.ShortName_Customer="";
- #PreGet.Balance_PreGet=0;
- tbCustomerNo.Focus();
- }
- UpdateForm(true,"txtCustomerName");
- <!--UpdateForm(true,"ntbBalance");-->
- </Enter>
- <Click>
- if (tbCustomerNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo.CValue = @temp;
- ActiveControlEvent("tbCustomerNo", "Enter");
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtCustomerName" DataSource="PreGet.ShortName_Customer"/>
- <IKComboBoxEx name="cbGetCurrency" DisplaySource="PreGet.GetCurrency_PreGet"/>
- <IKComboBoxEx name="cbBillCurrency" DisplaySource="PreGet.Currency_PreGet"/>
- <IKNumericTextBox name="txtRate" DataSource="PreGet.Rate_PreGet"/>
- <IKComboBoxEx name="cbType" DisplaySource="PreGet.Method_PreGet" DataSource="Method" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbType");
- Search("SearchMethod");
- UpdateForm(true, "cbType");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="AmountType" DataSource="GetType" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false,"AmountType");
- Search("SearchType");
- UpdateForm(true,"AmountType");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKNumericTextBox name="ntbMoney" DataSource="PreGet.Amount_PreGet"/>
- <IKTextBox name="txtVoucherDate" DataSource="PreGet.VoucherDate_PreGet" />
- <IKTextBox name="txtVoucherNo" DataSource="PreGet.VoucherNo_PreGet"/>
- <IKComboBoxEx name="cbReceiver" ValueSource="PreGet.ID_Receiver" DisplaySource="PreGet.Name_Employee" NoSource="PreGet.No_Receiver" DataSource="Employee" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbReceiver");
- Search("SearchReceiver");
- UpdateForm(true, "cbReceiver");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <!--<IKNumericTextBox name="ntbBalance" DataSource="PreGet.Balance_PreGet"/>-->
- <IKTextBox name="txtAssessor" DataSource="PreGet.Assessor" />
- <IKDateTimeText name="dtAssessDate" DataSource="PreGet.AssessDate_PreGet" />
- <IKTextBox name="txtLastModUser" DataSource="PreGet.LastModUser"/>
- <IKDateTimeText name="dtLastModDate" DataSource="PreGet.LastModDate_PreGet"/>
- <IKComboBoxEx name="cbComment" DisplaySource="PreGet.Comment_PreGet" DataSource="Comment" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbComment");
- Search("SearchComment");
- UpdateForm(true, "cbComment");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- AmountType.SelectedName="";
- if(Search("SearchPreGetFirst"))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- AmountType.SelectedName="";
- if(Search("SearchPreGetPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- AmountType.SelectedName="";
- if(Search("SearchPreGetNext",tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- AmountType.SelectedName="";
- if(Search("SearchPreGetLast"))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #PreGet.No_PreGet= @NextNo;
- UpdateForm(true, "tbNo");
- }
- ]]>
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- BeginAudit();
- #PreGet.ID_Assessor=GetLoginUserID();
- #PreGet.Assessor=GetCurrentUser();
- #PreGet.AssessDate_PreGet=DateTimeNow();
- Audit();
- ChangeMode("View");
- EndAudit();
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #PreGet.ID_Assessor=DBNull();
- #PreGet.Assessor=DBNull();
- #PreGet.AssessDate_PreGet=DataTimeNow();
- UnAudit();
- ChangeMode("View");
- EndUnAudit();
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <LockInfomation LockID="ID_PreGet" LockNO="No_PreGet" LockSearchFunction="SearchPreGetWithNo" LockAudit="ID_Assessor"/>
- <LogInfomation LogNO="#PreGet.No_PreGet" RecordFormField="收款方式:#PreGet.Method_PreGet,客户编号:#PreGet.No_Customer,收款金额:#PreGet.Amount_PreGet" RecordDataGridField=""/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PreGet" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPreGetWithNo">
- <DataColumn Index="0" MappingName="#PreGet.No_PreGet" HeaderText="收款单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PreGet.CreateDate_PreGet" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PreGet.No_Customer" HeaderText="客户编号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#PreGet.ShortName_Customer" HeaderText="客户简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#PreGet.Method_PreGet" HeaderText="收款方式" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#PreGet.Amount_PreGet" HeaderText="金额" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="6" MappingName="#PreGet.ID_Assessor" HeaderText="状态" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" 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="PreGet" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PreGet.*,a.Name_User As Creator
- ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Employee.No_Employee As No_Receiver,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- ">
- </GetSchema>
- <New CmdType="Text" CmdText=" INSERT INTO PreGet(ID_PreGet
- ,No_PreGet
- ,UnPreGetStrikeBalance_PreGet
- ,Date_PreGet
- ,ID_Customer
- ,GetCurrency_PreGet
- ,Currency_PreGet
- ,Rate_PreGet
- ,Method_PreGet
- ,Amount_PreGet
- ,VoucherNo_PreGet
- ,VoucherDate_PreGet
- ,ID_Receiver
- ,Balance_PreGet
- ,ID_Creator
- ,CreateDate_PreGet
- ,LastModUser_PreGet
- ,LastModDate_PreGet
- ,ID_Assessor
- ,AssessDate_PreGet
- ,Comment_PreGet)
-
- VALUES(@ID_PreGet
- ,@No_PreGet
- ,@UnPreGetStrikeBalance_PreGet
- ,@Date_PreGet
- ,@ID_Customer
- ,@GetCurrency_PreGet
- ,@Currency_PreGet
- ,@Rate_PreGet
- ,@Method_PreGet
- ,@Amount_PreGet
- ,@VoucherNo_PreGet
- ,@VoucherDate_PreGet
- ,@ID_Receiver
- ,@Balance_PreGet
- ,@ID_Creator
- ,@CreateDate_PreGet
- ,@LastModUser_PreGet
- ,@LastModDate_PreGet
- ,@ID_Assessor
- ,@AssessDate_PreGet
- ,@Comment_PreGet)
-
- declare @amount decimal(16,4)
-
- select @amount=SUM(Amount_PreGet)
- from PreGet
- where ID_Customer=@ID_Customer
-
- Update Customer
- Set PerValue_Customer = @amount
- Where ID_Customer = @ID_Customer
- ">
- <Params>
- <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
- <Param name="@No_PreGet" type="PreGet.No_PreGet" sourceColumn="No_PreGet" />
- <Param name="@UnPreGetStrikeBalance_PreGet" type="PreGet.UnPreGetStrikeBalance_PreGet" sourceColumn="UnPreGetStrikeBalance_PreGet" />
- <Param name="@Date_PreGet" type="PreGet.Date_PreGet" sourceColumn="Date_PreGet" />
- <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@GetCurrency_PreGet" type="PreGet.GetCurrency_PreGet" sourceColumn="GetCurrency_PreGet" />
- <Param name="@Currency_PreGet" type="PreGet.Currency_PreGet" sourceColumn="Currency_PreGet" />
- <Param name="@Rate_PreGet" type="PreGet.Rate_PreGet" sourceColumn="Rate_PreGet" />
- <Param name="@Method_PreGet" type="PreGet.Method_PreGet" sourceColumn="Method_PreGet" />
- <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
- <Param name="@VoucherNo_PreGet" type="PreGet.VoucherNo_PreGet" sourceColumn="VoucherNo_PreGet" />
- <Param name="@VoucherDate_PreGet" type="PreGet.VoucherDate_PreGet" sourceColumn="VoucherDate_PreGet" />
- <Param name="@ID_Receiver" type="PreGet.ID_Receiver" sourceColumn="ID_Receiver" />
- <Param name="@Balance_PreGet" type="PreGet.Balance_PreGet" sourceColumn="Balance_PreGet" />
- <Param name="@ID_Creator" type="PreGet.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PreGet" type="PreGet.CreateDate_PreGet" sourceColumn="CreateDate_PreGet" />
- <Param name="@LastModUser_PreGet" type="PreGet.LastModUser_PreGet" sourceColumn="LastModUser_PreGet" />
- <Param name="@LastModDate_PreGet" type="PreGet.LastModDate_PreGet" sourceColumn="LastModDate_PreGet" />
- <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet" />
- <Param name="@Comment_PreGet" type="PreGet.Comment_PreGet" sourceColumn="Comment_PreGet" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE PreGet
- SET No_PreGet=@No_PreGet
- ,UnPreGetStrikeBalance_PreGet = @UnPreGetStrikeBalance_PreGet
- ,Date_PreGet=@Date_PreGet
- ,ID_Customer=@ID_Customer
- ,GetCurrency_PreGet=@GetCurrency_PreGet
- ,Currency_PreGet=@Currency_PreGet
- ,Rate_PreGet=@Rate_PreGet
- ,Method_PreGet=@Method_PreGet
- ,Amount_PreGet=@Amount_PreGet
- ,VoucherNo_PreGet=@VoucherNo_PreGet
- ,VoucherDate_PreGet=@VoucherDate_PreGet
- ,ID_Receiver=@ID_Receiver
- ,Balance_PreGet=@Balance_PreGet
- ,ID_Creator=@ID_Creator
- ,CreateDate_PreGet=@CreateDate_PreGet
- ,LastModUser_PreGet=@LastModUser_PreGet
- ,LastModDate_PreGet=@LastModDate_PreGet
- ,ID_Assessor=@ID_Assessor
- ,AssessDate_PreGet=@AssessDate_PreGet
- ,Comment_PreGet=@Comment_PreGet
- WHERE ID_PreGet=@ID_PreGet
- declare @amount decimal(16,4)
-
- select @amount=SUM(Amount_PreGet)
- from PreGet
- where ID_Customer=@ID_Customer
-
- Update Customer
- Set PerValue_Customer = @amount
- Where ID_Customer = @ID_Customer
-
- ">
- <Params>
- <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
- <Param name="@No_PreGet" type="PreGet.No_PreGet" sourceColumn="No_PreGet" />
- <Param name="@UnPreGetStrikeBalance_PreGet" type="PreGet.UnPreGetStrikeBalance_PreGet" sourceColumn="UnPreGetStrikeBalance_PreGet" />
- <Param name="@Date_PreGet" type="PreGet.Date_PreGet" sourceColumn="Date_PreGet" />
- <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@GetCurrency_PreGet" type="PreGet.GetCurrency_PreGet" sourceColumn="GetCurrency_PreGet" />
- <Param name="@Currency_PreGet" type="PreGet.Currency_PreGet" sourceColumn="Currency_PreGet" />
- <Param name="@Rate_PreGet" type="PreGet.Rate_PreGet" sourceColumn="Rate_PreGet" />
- <Param name="@Method_PreGet" type="PreGet.Method_PreGet" sourceColumn="Method_PreGet" />
- <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
- <Param name="@VoucherNo_PreGet" type="PreGet.VoucherNo_PreGet" sourceColumn="VoucherNo_PreGet" />
- <Param name="@VoucherDate_PreGet" type="PreGet.VoucherDate_PreGet" sourceColumn="VoucherDate_PreGet" />
- <Param name="@ID_Receiver" type="PreGet.ID_Receiver" sourceColumn="ID_Receiver" />
- <Param name="@Balance_PreGet" type="PreGet.Balance_PreGet" sourceColumn="Balance_PreGet" />
- <Param name="@ID_Creator" type="PreGet.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PreGet" type="PreGet.CreateDate_PreGet" sourceColumn="CreateDate_PreGet" />
- <Param name="@LastModUser_PreGet" type="PreGet.LastModUser_PreGet" sourceColumn="LastModUser_PreGet" />
- <Param name="@LastModDate_PreGet" type="PreGet.LastModDate_PreGet" sourceColumn="LastModDate_PreGet" />
- <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet" />
- <Param name="@Comment_PreGet" type="PreGet.Comment_PreGet" sourceColumn="Comment_PreGet" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" declare @amount decimal(16,4)
- declare @ID_Customer uniqueidentifier
- ,@PerValue_Customer decimal(16,4)
- Select @ID_Customer=ID_Customer
- from PreGet
- where ID_PreGet=@ID_PreGet
- select @amount=Amount_PreGet
- from PreGet
- where ID_PreGet=@ID_PreGet
-
- Select @PerValue_Customer=isnull(Sum(PerValue_Customer),0) from Customer
- where ID_Customer=@ID_Customer
- Update Customer
- Set PerValue_Customer = @PerValue_Customer - @amount
- Where ID_Customer = @ID_Customer
- DELETE PreGet WHERE ID_PreGet=@ID_PreGet
- ">
- <Params>
- <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet" />
- </Params>
- </Delete>
- <Audit CmdType="Text" CmdText=" IF(@ID_Assessor IS NOT NULL)
- UPDATE Customer SET PrePayBalance_Customer=PrePayBalance_Customer+@Amount_PreGet WHERE ID_Customer=@ID_Customer
- ELSE
- UPDATE Customer SET PrePayBalance_Customer=PrePayBalance_Customer-@Amount_PreGet WHERE ID_Customer=@ID_Customer
- UPDATE PreGet SET ID_Assessor=@ID_Assessor,AssessDate_PreGet=@AssessDate_PreGet WHERE ID_PreGet=@ID_PreGet
- ">
- <Params>
- <Param name="@ID_PreGet" type="PreGet.ID_PreGet" sourceColumn="ID_PreGet"/>
- <Param name="@ID_Customer" type="PreGet.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@Amount_PreGet" type="PreGet.Amount_PreGet" sourceColumn="Amount_PreGet" />
- <Param name="@ID_Assessor" type="PreGet.ID_Assessor" sourceColumn="ID_Assessor"/>
- <Param name="@AssessDate_PreGet" type="PreGet.AssessDate_PreGet" sourceColumn="AssessDate_PreGet"/>
- </Params>
- </Audit>
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText="
- select
- [ID_PreGet]
- ,[No_PreGet]
- ,[UnPreGetStrikeBalance_PreGet]
- ,[Date_PreGet]
- ,PreGet.[ID_Customer]
- ,[GetCurrency_PreGet]
- ,[Currency_PreGet]
- ,[Rate_PreGet]
- ,[Method_PreGet]
- ,[Amount_PreGet]
- ,[VoucherNo_PreGet]
- ,[VoucherDate_PreGet]
- ,[ID_Receiver]
- ,[Balance_PreGet]
- ,PreGet.[ID_Creator]
- ,case isnull(ID_Assessor,'00000000-0000-0000-0000-000000000000')
- when '00000000-0000-0000-0000-000000000000' then '未审核'
- else '已审核'
- end as ID_Assessor
- ,[AssessDate_PreGet]
- ,[Comment_PreGet]
- ,[CreateDate_PreGet]
- ,[LastModUser_PreGet]
- ,[LastModDate_PreGet]
- ,ShortName_Customer,No_Customer
- FROM PreGet
- LEFT JOIN Customer ON Customer.ID_Customer=PreGet.ID_Customer
- ">
- <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>
- <SearchCustomer CmdType="Text" CmdText=" SELECT ID_Customer,ShortName_Customer,PrePayBalance_Customer
- ,Customer.SuspendDate_Customer
- From Customer
- WHERE No_Customer=@No_Customer
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer"/>
- </Tables>
- </SearchCustomer>
- <SearchReceiver CmdType="Text" CmdText=" SELECT Name_Employee,ID_Employee,No_Employee
- From Employee
- ORDER BY No_Employee">
- <Tables>
- <Table name="Employee"/>
- </Tables>
- </SearchReceiver>
- <SearchMethod CmdType="Text" CmdText=" SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef=23 ">
- <Tables>
- <Table name="Method"/>
- </Tables>
- </SearchMethod>
- <SearchType CmdType="Text" CmdText=" CREATE TABLE #TypeDef( Type nvarchar(64)) DECLARE @i int SET @i = 0
- WHILE @i < 2
- BEGIN
- IF(@i=0)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('收款')
- END
- IF(@i=1)
- BEGIN
- INSERT INTO #TypeDef (Type)VALUES('退款')
- END
-
- SET @i = @i + 1
- END
- SELECT Type AS Name_TypeDef FROM #TypeDef
- DROP TABLE #TypeDef
- ">
- <Tables>
- <Table name="GetType" />
- </Tables>
- </SearchType>
- <SearchComment CmdType="Text" CmdText="Select Name_TypeDef From TypeDef Where Type_TypeDef = 29 ">
- <Tables>
- <Table name="Comment" />
- </Tables>
- </SearchComment>
- <SearchPreGetWithNo CmdType="Text" CmdText=" Select PreGet.ID_PreGet
- ,PreGet.No_PreGet
- ,PreGet.UnPreGetStrikeBalance_PreGet
- ,PreGet.Date_PreGet
- ,PreGet.ID_Customer
- ,PreGet.GetCurrency_PreGet
- ,PreGet.Currency_PreGet
- ,PreGet.Rate_PreGet
- ,PreGet.Method_PreGet
- ,PreGet.Amount_PreGet
- ,PreGet.VoucherNo_PreGet
- ,PreGet.VoucherDate_PreGet
- ,PreGet.ID_Receiver
- ,PreGet.Balance_PreGet
- ,PreGet.ID_Creator
- ,PreGet.ID_Assessor
- ,PreGet.AssessDate_PreGet
- ,PreGet.Comment_PreGet
- ,PreGet.CreateDate_PreGet
- ,PreGet.LastModUser_PreGet
- ,PreGet.LastModDate_PreGet
- ,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer
- ,Customer.ShortName_Customer,Employee.No_Employee AS No_Receiver
- ,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- WHERE No_PreGet=@No_PreGet">
- <Params>
- <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
- </Params>
- <Tables>
- <Table name="PreGet"/>
- </Tables>
- </SearchPreGetWithNo>
- <SearchPreGetFirst CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
- ,PreGet.No_PreGet
- ,PreGet.UnPreGetStrikeBalance_PreGet
- ,PreGet.Date_PreGet
- ,PreGet.ID_Customer
- ,PreGet.GetCurrency_PreGet
- ,PreGet.Currency_PreGet
- ,PreGet.Rate_PreGet
- ,PreGet.Method_PreGet
- ,PreGet.Amount_PreGet
- ,PreGet.VoucherNo_PreGet
- ,PreGet.VoucherDate_PreGet
- ,PreGet.ID_Receiver
- ,PreGet.Balance_PreGet
- ,PreGet.ID_Creator
- ,PreGet.ID_Assessor
- ,PreGet.AssessDate_PreGet
- ,PreGet.Comment_PreGet
- ,PreGet.CreateDate_PreGet
- ,PreGet.LastModUser_PreGet
- ,PreGet.LastModDate_PreGet
- ,a.Name_User As Creator
- ,b.Name_User As Assessor
- ,c.Name_User As LastModUser
- ,Customer.No_Customer
- ,Customer.ShortName_Customer
- ,Employee.No_Employee AS No_Receiver
- ,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- ORDER BY No_PreGet">
- <Tables>
- <Table name="PreGet"/>
- </Tables>
- </SearchPreGetFirst>
- <SearchPreGetLast CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
- ,PreGet.No_PreGet
- ,PreGet.UnPreGetStrikeBalance_PreGet
- ,PreGet.Date_PreGet
- ,PreGet.ID_Customer
- ,PreGet.GetCurrency_PreGet
- ,PreGet.Currency_PreGet
- ,PreGet.Rate_PreGet
- ,PreGet.Method_PreGet
- ,PreGet.Amount_PreGet
- ,PreGet.VoucherNo_PreGet
- ,PreGet.VoucherDate_PreGet
- ,PreGet.ID_Receiver
- ,PreGet.Balance_PreGet
- ,PreGet.ID_Creator
- ,PreGet.ID_Assessor
- ,PreGet.AssessDate_PreGet
- ,PreGet.Comment_PreGet
- ,PreGet.CreateDate_PreGet
- ,PreGet.LastModUser_PreGet
- ,PreGet.LastModDate_PreGet
- ,a.Name_User As Creator
- ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- ORDER BY No_PreGet DESC">
- <Tables>
- <Table name="PreGet"/>
- </Tables>
- </SearchPreGetLast>
- <SearchPreGetPrevious CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
- ,PreGet.No_PreGet
- ,PreGet.UnPreGetStrikeBalance_PreGet
- ,PreGet.Date_PreGet
- ,PreGet.ID_Customer
- ,PreGet.GetCurrency_PreGet
- ,PreGet.Currency_PreGet
- ,PreGet.Rate_PreGet
- ,PreGet.Method_PreGet
- ,PreGet.Amount_PreGet
- ,PreGet.VoucherNo_PreGet
- ,PreGet.VoucherDate_PreGet
- ,PreGet.ID_Receiver
- ,PreGet.Balance_PreGet
- ,PreGet.ID_Creator
- ,PreGet.ID_Assessor
- ,PreGet.AssessDate_PreGet
- ,PreGet.Comment_PreGet
- ,PreGet.CreateDate_PreGet
- ,PreGet.LastModUser_PreGet
- ,PreGet.LastModDate_PreGet
- ,a.Name_User As Creator
- ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- WHERE No_PreGet < @No_PreGet
- ORDER BY No_PreGet DESC">
- <Params>
- <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
- </Params>
- <Tables>
- <Table name="PreGet"/>
- </Tables>
- </SearchPreGetPrevious>
- <SearchPreGetNext CmdType="Text" CmdText=" SELECT TOP 1 PreGet.ID_PreGet
- ,PreGet.No_PreGet
- ,PreGet.UnPreGetStrikeBalance_PreGet
- ,PreGet.Date_PreGet
- ,PreGet.ID_Customer
- ,PreGet.GetCurrency_PreGet
- ,PreGet.Currency_PreGet
- ,PreGet.Rate_PreGet
- ,PreGet.Method_PreGet
- ,PreGet.Amount_PreGet
- ,PreGet.VoucherNo_PreGet
- ,PreGet.VoucherDate_PreGet
- ,PreGet.ID_Receiver
- ,PreGet.Balance_PreGet
- ,PreGet.ID_Creator
- ,PreGet.ID_Assessor
- ,PreGet.AssessDate_PreGet
- ,PreGet.Comment_PreGet
- ,PreGet.CreateDate_PreGet
- ,PreGet.LastModUser_PreGet
- ,PreGet.LastModDate_PreGet
- ,a.Name_User As Creator
- ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Employee.No_Employee AS No_Receiver,Employee.Name_Employee
- FROM PreGet
- LEFT JOIN AppUser a ON PreGet.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PreGet.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PreGet.LastModUser_PreGet=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=PreGet.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee=PreGet.ID_Receiver
- WHERE No_PreGet > @No_PreGet
- ORDER BY No_PreGet">
- <Params>
- <Param name="@No_PreGet" type="PreGet.No_PreGet" Index="0" />
- </Params>
- <Tables>
- <Table name="PreGet"/>
- </Tables>
- </SearchPreGetNext>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchCustomersCustomer CmdType="Text" CmdText="Select *
- From Customer
- Where ID_Customer = (Select CustomerID_Customer
- From Customer
- Where No_Customer = @No_Customer
- And IsCustomersCustomer_Customer = 1)">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="CustomersCustomer"/>
- </Tables>
- </SearchCustomersCustomer>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- ikCkNoPreGetStrikeBalance.Enabled=false;
- dtDate.Enabled=false;
- tbCustomerNo.ReadOnly=true;
- cbType.Enabled=false;
- AmountType.Enabled=false;
- txtVoucherDate.Enabled=false;
- txtVoucherNo.ReadOnly=true;
- cbReceiver.Enabled=false;
- ntbMoney.ReadOnly=true;
- cbComment.Enabled=false;
- #PreGet.Creator="";
- #PreGet.ID_Creator=DBNull();
- #PreGet.Assessor="";
- #PreGet.ID_Assessor=DBNull();
- #PreGet.AssessDate_PreGet=DBNull();
- #PreGet.LastModUser_PreGet=DBNull();
- #PreGet.LastModUser="";
- #PreGet.LastModDate_PreGet=DBNull();
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableUnAudit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- toolBar.EnablePrint=false;
- UpdateForm(true,"");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- @sql = 0;
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- ikCkNoPreGetStrikeBalance.Enabled=true;
- dtDate.Enabled=true;
- tbCustomerNo.ReadOnly=false;
- cbType.Enabled=true;
- AmountType.Enabled = true;
- txtVoucherDate.Enabled=true;
- txtVoucherNo.ReadOnly=false;
- cbReceiver.Enabled=true;
- ntbMoney.ReadOnly=false;
- cbComment.Enabled=true;
- #PreGet.ID_PreGet=NewGuid();
- #PreGet.GetCurrency_PreGet=@SysCurrency;
- #PreGet.Currency_PreGet=@SysCurrency;
- #PreGet.Rate_PreGet=1.00;
- #PreGet.Creator=GetCurrentUser();
- #PreGet.ID_Creator=GetLoginUserID();
- #PreGet.Assessor=DBNull();
- #PreGet.ID_Assessor=DBNull();
- #PreGet.AssessDate_PreGet=DBNull();
- #PreGet.LastModUser_PreGet=DBNull();
- #PreGet.LastModUser=DBNull();
- #PreGet.LastModDate_PreGet=DBNull();
- #PreGet.UnPreGetStrikeBalance_PreGet=false;
- #PreGet.Date_PreGet=GetCurrentTime();
- AmountType.SelectedName = "收款";
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableUnAudit=false;
- toolBar.EnableNew=false;
- toolBar.EnablePrint=false;
- UpdateForm(true,"");
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- ikCkNoPreGetStrikeBalance.Enabled=false;
- dtDate.Enabled=false;
- tbCustomerNo.ReadOnly=true;
- txtVoucherDate.Enabled=false;
- txtVoucherNo.ReadOnly=true;
- cbReceiver.Enabled=false;
- cbType.Enabled=false;
- AmountType.Enabled = false;
- ntbMoney.ReadOnly=true;
- cbComment.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- if(Equals(#PreGet.ID_Assessor, DBNull()))
- {
- toolBar.EnableAudit=GetRight(@Title,"审核");
- toolBar.EnableUnAudit=false;
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- }
- else
- {
- toolBar.EnableAudit=false;
- toolBar.EnableUnAudit=GetRight(@Title,"取消审核");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- }
- if(#PreGet.Amount_PreGet>0)
- {
- AmountType.SelectedName ="收款";
- }
- else
- {
- AmountType.SelectedName ="退款";
- }
- toolBar.EnablePrint=GetRight(@Title,"打印");
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- @sql = ntbMoney.CValue;
- tbNo.ReadOnly=true;
- ikCkNoPreGetStrikeBalance.Enabled=true;
- dtDate.Enabled=false;
- tbCustomerNo.ReadOnly=true;
- txtVoucherDate.Enabled=true;
- txtVoucherNo.ReadOnly=false;
- cbReceiver.Enabled=true;
- cbType.Enabled=true;
- AmountType.Enabled = true;
- ntbMoney.ReadOnly=false;
- cbComment.Enabled=true;
- #PreGet.LastModUser=GetCurrentUser();
- #PreGet.LastModUser_PreGet=GetLoginUserID();
- #PreGet.LastModDate_PreGet=GetCurrentTime();
- toolBar.EnableSubmit=GetRight(@Title,"修改");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableUnAudit=false;
- toolBar.EnableNew=false;
- toolBar.EnablePrint=false;
- UpdateForm(true, "");
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(!Search("SearchCustomer",tbCustomerNo.CValue) ||!Equals(#PreGet.ID_Customer,#Customer.ID_Customer))
- {
- MessageBox("请输入有效的客户,回车以示确认!",@Title);
- tbCustomerNo.Focus();
- return;
- }
-
- if(!cbReceiver.CheckSelectedItem())
- {
- MessageBox("请输入有效的收款人!",@Title);
- cbReceiver.Focus();
- return;
- }
- if(!AmountType.CheckSelectedItem())
- {
- MessageBox("请输入有效的金额方式!",@Title);
- AmountType.Focus();
- return;
- }
- UpdateForm(false,"");
- if(@Status==1)
- { #PreGet.CreateDate_PreGet=GetCurrentTime();
-
- if(AmountType.SelectedName=="收款")
- {
- #PreGet.Amount_PreGet = ntbMoney.CValue;
- }
- if(AmountType.SelectedName=="退款")
- {
- #PreGet.Amount_PreGet = -ntbMoney.CValue;
- }
- #PreGet.No_PreGet = New("#PreGet.No_PreGet", dtDate.CValue);
- }
- else if(@Status==3)
- {
- #PreGet.LastModUser=GetCurrentUser();
- #PreGet.LastModUser_PreGet=GetLoginUserID();
- #PreGet.LastModDate_PreGet=GetCurrentTime();
- if(AmountType.SelectedName=="退款")
- {
- if(ntbMoney.CValue!=@sql)
- {
- if(ntbMoney.CValue!=-@sql)
- {
- if (ntbMoney.CValue >=0)
- #PreGet.Amount_PreGet=-ntbMoney.CValue;
- else
- #PreGet.Amount_PreGet=ntbMoney.CValue;
- }
- }
- else
- {
- if(@sql>=0)
- #PreGet.Amount_PreGet=-@sql;
- else
- #PreGet.Amount_PreGet=@sql;
- }
- }
- else
- {
- if(ntbMoney.CValue!=@sql)
- {
- if(ntbMoney.CValue!=-@sql)
- {
- if (ntbMoney.CValue >=0)
- #PreGet.Amount_PreGet=ntbMoney.CValue;
- else
- #PreGet.Amount_PreGet=-ntbMoney.CValue;
- }
- }
- else
- {
- if(@sql>=0)
- #PreGet.Amount_PreGet=@sql;
- else
- #PreGet.Amount_PreGet=-@sql;
- }
- }
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|