12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016 |
- <?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"/>
- </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 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>
|