123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmPayableStrike">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title = "应付帐款冲帐";
- @ErrorDetail="";
- GetSchema();
- Search("SearchPayer");
-
- Search("SearchFromBillInInvoice","p");
-
- Search("SearchSystemSetting");
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- ChangeMode("Search");
- dgReceiveMoney.NoMember = "No_PayablesStrikeMethod";
- dgBill.NoMember = "No_PayablesStrikeBills";
- Search("SearchPayablesStrikeMethod");
- ]]>
- </Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </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>
- <IKDateTimePicker name="dtDate" DataSource="PayablesStrike.Date_PayablesStrike"></IKDateTimePicker>
- <IKTextButton name="tbNo" DataSource="PayablesStrike.No_PayablesStrike">
- <Events>
- <Enter>
- <![CDATA[
- if (tbNo.ReadOnly == false)
- {
- if (tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if (Search("SearchPayablesStrikeWithNo", tbNo.CValue))
- {
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- }
- else
- {
- MessageBox("该应付帐款冲帐单据不存在!", @Title);
- return;
- }
- }
- else
- {
- MessageBox("请输入应付帐款冲帐单号!", @Title);
- return;
- }
- }
- ]]>
- <Lable name="CountSum" />
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","NODEPOT", "tbNo", tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKCheckBox name="cbPrev" DataSource="PayablesStrike.Prev_PayablesStrike">
- <Events>
- <CheckedChanged>
- <![CDATA[
- if (cbPrev.Checked)
- {
- btnSearchByInvoice.Enabled = false;
- btnAutoStrike.Enabled = false;
- }
- else
- {
- btnSearchByInvoice.Enabled = true;
- btnAutoStrike.Enabled = true;
- }
- ]]>
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKTextButton name="tbSupplierNo" DataSource="PayablesStrike.No_Supplier">
- <Events>
- <Enter>
- <![CDATA[
- if (tbSupplierNo.ReadOnly == false)
- {
- UpdateForm(false, "");
- if (tbSupplierNo.CValue == "" || !Search("SearchSupplierWithNo", #PayablesStrike.No_Supplier))
- {
- if (tbSupplierNo.CValue == "")
- {
- MessageBox("请输入供应商编号!", @Title);
- }
- else
- {
- MessageBox("该供应商不存在!", @Title);
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
- if (@temp != "")
- {
- tbSupplierNo.CValue = @temp;
- ActiveControlEvent("tbSupplierNo", "Enter");
- return;
- }
- }
- #PayablesStrike.ID_Supplier = GuidEmpty();
- #PayablesStrike.ShortName_Supplier = "";
- #PayablesStrike.PreGetBalance_Supplier = 0;
- }
- else
- {
- if (!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
- {
- MessageBox("该供应商已停用!", @Title);
- }
- #PayablesStrike.ID_Supplier = #Supplier.ID_Supplier;
- #PayablesStrike.ShortName_Supplier = #Supplier.ShortName_Supplier;
- #PayablesStrike.PreGetBalance_Supplier = #Supplier.PreGetBalance_Supplier;
- }
- UpdateForm(true, "");
- }
- ]]>
- </Enter>
- <Click>
- <![CDATA[
- if (tbSupplierNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
- if ( @temp == "" )
- return;
- tbSupplierNo.CValue = @temp;
- ActiveControlEvent("tbSupplierNo", "Enter");
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtSupplierName" DataSource="PayablesStrike.ShortName_Supplier"></IKTextBox>
- <IKComboBoxEx name="cbGetCurrency" DisplaySource="PayablesStrike.GetCurrency_PayablesStrike" DataSource="PayablesStrike"></IKComboBoxEx>
- <IKComboBoxEx name="cbBillCurrency" DisplaySource="PayablesStrike.BillCurrency_PayablesStrike" DataSource="PayablesStrike"></IKComboBoxEx>
- <IKNumericTextBox name="txtRate" DataSource="PayablesStrike.Rate_PayablesStrike"></IKNumericTextBox>
- <IKComboBoxEx name="cbPayer" ValueSource="PayablesStrike.ID_Payer" DisplaySource="PayablesStrike.Name_Employee" NoSource="PayablesStrike.No_Payer" DataSource="Payer" DisplayMember="Name_Employee" NoMember="No_Employee" ValueMember="ID_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbPayer");
- Search("SearchPayer");
- UpdateForm(true, "cbPayer");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtMaker" DataSource="PayablesStrike.Name_Creator"></IKTextBox>
- <IKTextBox name="txtAssessor" DataSource="PayablesStrike.Name_Assessor"></IKTextBox>
- <IKTextBox name="dtAssessDate" DataSource="PayablesStrike.AssessDate_PayablesStrike"></IKTextBox>
- <IKTextBox name="txtLastModUser" DataSource="PayablesStrike.Name_LastModUser"></IKTextBox>
- <IKTextBox name="dtLastModDate" DataSource="PayablesStrike.LastModDate_PayablesStrike"></IKTextBox>
- <IKTextBox name="txtComment" DataSource="PayablesStrike.Comment_PayablesStrike"></IKTextBox>
- <IKButton name="btnSearchByInvoice">
- <Events>
- <Click>
- <![CDATA[
- @DateStart = DBNull();
- @DateEnd = DBNull();
- if (dtStart.Checked)
- {
- @DateStart = dtStart.CValue;
- }
- if (dtEnd.Checked)
- {
- @DateEnd = dtEnd.CValue;
- }
- ShowSearchBox("", "STRIKEIMPORT", "进项发票", "#PayablesStrikeBills", @DateStart, @DateEnd);
- if (RowCount("#PayablesStrikeBills") > 0)
- {
- for (@i=0; @i<RowCount("#PayablesStrikeBills"); @i=@i+1)
- {
- dgBill.CurrentRowIndex = @i;
- }
- dgBill.CurrentRowIndex = 0;
- }
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnVerify">
- <Events>
- <Click>
- <Lable name="Verify" />
- MessageBox("校验已通过!",@Title);
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnAutoStrike">
- <Events>
- <Click>
- <![CDATA[
- if (RowCount("#PayablesStrikeMethod") > 0 && RowCount("#PayablesStrikeBills") > 0)
- {
- @AllStrikeAmount = SumOfCol("#PayablesStrikeMethod.Amount_PayablesStrikeMethod");
- SuspendLayout();
- for (@j=0; @j<RowCount("#PayablesStrikeBills"); @j=@j+1)
- {
- SetPosition("#PayablesStrikeBills", @j);
- if (@AllStrikeAmount >= #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills)
- {
- @AllStrikeAmount -= #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills;
- #PayablesStrikeBills.Strike_PayablesStrikeBills = #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills;
- }
- else
- {
- #PayablesStrikeBills.Strike_PayablesStrikeBills = @AllStrikeAmount;
- @AllStrikeAmount = 0;
- }
- }
- ResumeLayout();
- }
- ]]>
- <Lable name="CountSum" />
- </Click>
- </Events>
- </IKButton>
- <IKDataGridEx name="dgReceiveMoney" DataSource="PayablesStrikeMethod" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PayablesStrikeMethod.No_PayablesStrikeMethod" />
- <DataColumn Index="1" DataSource="PayablesStrikeMethod.Type_PayablesStrikeMethod">
- <IKDataGridComboBoxColumn DisplaySourceEx="PayablesStrikeMethod.Type_PayablesStrikeMethod" ValueSourceEx="PayablesStrikeMethod.Type_PayablesStrikeMethod" DataSourceEx="Method" DisplayMemberEx="Result" ValueMemberEx="Result">
- <Events>
- <Reload>
- Search("SearchPayablesStrikeMethod");
- SetDataGridColumnDataSource(1,"dgReceiveMoney");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="2" DataSource="PayablesStrikeMethod.Amount_PayablesStrikeMethod" />
- <DataColumn Index="3" DataSource="PayablesStrikeMethod.Comment_PayablesStrikeMethod" />
- </IKDataGridEx>
- <IKDataGridEx name="dgBill" DataSource="PayablesStrikeBills" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PayablesStrikeBills.No_PayablesStrikeBills" />
- <DataColumn Index="1" DataSource="PayablesStrikeBills.No_PurchaseInvoice" />
- <DataColumn Index="2" DataSource="PayablesStrikeBills.No_Invoice" />
- <DataColumn Index="3" DataSource="PayablesStrikeBills.PayDate_PayablesStrikeBills" />
- <DataColumn Index="4" DataSource="PayablesStrikeBills.Amount_FromBill" />
- <DataColumn Index="5" DataSource="PayablesStrikeBills.ToPayAmount_PayablesStrikeBills" />
- <DataColumn Index="6" DataSource="PayablesStrikeBills.Strike_PayablesStrikeBills" />
- <DataColumn Index="7" DataSource="PayablesStrikeBills.Discount_PayablesStrikeBills" />
- <DataColumn Index="8" DataSource="PayablesStrikeBills.StrikedAmount_PayablesStrikeBills" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if (Search("SearchPayablesStrikeFirst", tbNo.CValue))
- {
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- <Lable name="CountSum" />
- }
- </ClickFirst>
- <ClickPrev>
- if (Search("SearchPayablesStrikePrevious", tbNo.CValue))
- {
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- <Lable name="CountSum" />
- }
- </ClickPrev>
- <ClickNext>
- if (Search("SearchPayablesStrikeNext", tbNo.CValue))
- {
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- <Lable name="CountSum" />
- }
- </ClickNext>
- <ClickLast>
- if (Search("SearchPayablesStrikeLast", tbNo.CValue))
- {
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- <Lable name="CountSum" />
- }
- </ClickLast>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #PayablesStrike.No_PayablesStrike = @NextNo;
- UpdateForm(true, "tbNo");
- }
- ]]>
- </ClickNew>
- <ClickSubmit>
- <Lable name="Verify" />
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- <Lable name="CountSum" />
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- BeginAudit();
- #PayablesStrike.ID_Assessor = GetLoginUserID();
- #PayablesStrike.Name_Assessor = GetCurrentUser();
- #PayablesStrike.AssessDate_PayablesStrike = DateTimeNow();
- Audit();
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- EndAudit();
- <Lable name="CountSum" />
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #PayablesStrike.ID_Assessor = DBNull();
- #PayablesStrike.Name_Assessor = "";
- UnAudit();
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- EndUnAudit();
- <Lable name="CountSum" />
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- if (toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="PayablesStrikeBills">
- <Events>
- <ColumnsChanged>
- <No_PurchaseInvoice>
- <Lable name="GetFromBill" />
- </No_PurchaseInvoice>
- <Discount_PayablesStrikeBills>
- #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills=#PayablesStrikeBills.Amount_FromBill-#PayablesStrikeBills.StrikedAmount_PayablesStrikeBills-#PayablesStrikeBills.Discount_PayablesStrikeBills;
- <Lable name="CountSum" />
- </Discount_PayablesStrikeBills>
- </ColumnsChanged>
- <RowDeleted>
- <Lable name="CountSum" />
- </RowDeleted>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_PayablesStrike" LockNO="No_PayablesStrike" LockSearchFunction="SearchPayablesStrikeWithNo" LockAudit="ID_Assessor"/>
- <LogInfomation LogNO="#PayablesStrike.No_PayablesStrike" RecordFormField="供应商编号:#PayablesStrike.No_Supplier" RecordDataGridField="#PayablesStrikeBills.No_FromBill,#PayablesStrikeBills.Strike_PayablesStrikeBills,#PayablesStrikeMethod.Amount_PayablesStrikeMethod"/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PayablesStrike" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPayablesStrikeWithNo">
- <DataColumn Index="0" MappingName="#PayablesStrike.No_PayablesStrike" HeaderText="应付帐款冲帐单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PayablesStrike.Date_PayablesStrike" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PayablesStrike.ShortName_Supplier" HeaderText="供应商简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
- <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="PayablesStrike" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer,Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike" />
- <New CmdType="Text" CmdText=" INSERT INTO PayablesStrike (ID_PayablesStrike, No_PayablesStrike, Date_PayablesStrike,
- ID_Supplier, GetCurrency_PayablesStrike, BillCurrency_PayablesStrike, Rate_PayablesStrike,
- ID_Payer, ID_Creator, Comment_PayablesStrike, CreateDate_PayablesStrike, Prev_PayablesStrike)
- VALUES (@ID_PayablesStrike, @No_PayablesStrike, @Date_PayablesStrike,
- @ID_Supplier, @GetCurrency_PayablesStrike, @BillCurrency_PayablesStrike, @Rate_PayablesStrike,
- @ID_Payer, @ID_Creator, @Comment_PayablesStrike, @CreateDate_PayablesStrike, @Prev_PayablesStrike)">
- <Params>
- <Param name="@ID_PayablesStrike" type="PayablesStrike.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@No_PayablesStrike" type="PayablesStrike.No_PayablesStrike" sourceColumn="No_PayablesStrike" />
- <Param name="@Date_PayablesStrike" type="PayablesStrike.Date_PayablesStrike" sourceColumn="Date_PayablesStrike" />
- <Param name="@ID_Supplier" type="PayablesStrike.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@GetCurrency_PayablesStrike" type="PayablesStrike.GetCurrency_PayablesStrike" sourceColumn="GetCurrency_PayablesStrike" />
- <Param name="@BillCurrency_PayablesStrike" type="PayablesStrike.BillCurrency_PayablesStrike" sourceColumn="BillCurrency_PayablesStrike" />
- <Param name="@Rate_PayablesStrike" type="PayablesStrike.Rate_PayablesStrike" sourceColumn="Rate_PayablesStrike" />
- <Param name="@ID_Payer" type="PayablesStrike.ID_Payer" sourceColumn="ID_Payer" />
- <Param name="@ID_Creator" type="PayablesStrike.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@Comment_PayablesStrike" type="PayablesStrike.Comment_PayablesStrike" sourceColumn="Comment_PayablesStrike" />
- <Param name="@CreateDate_PayablesStrike" type="PayablesStrike.CreateDate_PayablesStrike" sourceColumn="CreateDate_PayablesStrike" />
- <Param name="@Prev_PayablesStrike" type="PayablesStrike.Prev_PayablesStrike" sourceColumn="Prev_PayablesStrike" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE PayablesStrike SET Date_PayablesStrike = @Date_PayablesStrike,
- ID_Supplier = @ID_Supplier, GetCurrency_PayablesStrike = @GetCurrency_PayablesStrike,
- BillCurrency_PayablesStrike = @BillCurrency_PayablesStrike, Rate_PayablesStrike = @Rate_PayablesStrike,
- ID_Payer = @ID_Payer, Comment_PayablesStrike = @Comment_PayablesStrike,
- LastModUser_PayablesStrike = @LastModUser_PayablesStrike, LastModDate_PayablesStrike = @LastModDate_PayablesStrike,
- Prev_PayablesStrike = @Prev_PayablesStrike
- WHERE ID_PayablesStrike = @ID_PayablesStrike">
- <Params>
- <Param name="@ID_PayablesStrike" type="PayablesStrike.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@Date_PayablesStrike" type="PayablesStrike.Date_PayablesStrike" sourceColumn="Date_PayablesStrike" />
- <Param name="@ID_Supplier" type="PayablesStrike.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@GetCurrency_PayablesStrike" type="PayablesStrike.GetCurrency_PayablesStrike" sourceColumn="GetCurrency_PayablesStrike" />
- <Param name="@BillCurrency_PayablesStrike" type="PayablesStrike.BillCurrency_PayablesStrike" sourceColumn="BillCurrency_PayablesStrike" />
- <Param name="@Rate_PayablesStrike" type="PayablesStrike.Rate_PayablesStrike" sourceColumn="Rate_PayablesStrike" />
- <Param name="@ID_Payer" type="PayablesStrike.ID_Payer" sourceColumn="ID_Payer" />
- <Param name="@Comment_PayablesStrike" type="PayablesStrike.Comment_PayablesStrike" sourceColumn="Comment_PayablesStrike" />
- <Param name="@LastModUser_PayablesStrike" type="PayablesStrike.LastModUser_PayablesStrike" sourceColumn="LastModUser_PayablesStrike" />
- <Param name="@LastModDate_PayablesStrike" type="PayablesStrike.LastModDate_PayablesStrike" sourceColumn="LastModDate_PayablesStrike" />
- <Param name="@Prev_PayablesStrike" type="PayablesStrike.Prev_PayablesStrike" sourceColumn="Prev_PayablesStrike" />
- </Params>
- </Update>
- <Audit CmdType="Text" CmdText="
- Declare @No_PurchaseInvoice nvarchar(64)
- Declare @Strike_PayablesStrikeBills decimal(18,6)
- Declare @Discount_PayablesStrikeBills decimal(18,6)
- Declare @Type_PayablesStrikeMethod nvarchar(64)
- Declare @Amount_PayablesStrikeMethod decimal(18,6)
- Declare @ID_Assessor_PurchaseInvoice uniqueidentifier
- Declare @Disable_PurchaseInvoice bit
- Declare @Amount_PurchaseInvoice decimal(18,6)
- Declare @StrikedAmount_PurchaseInvoice decimal(18,6)
- Declare @error nvarchar(256)
- DECLARE @StrikePreGet decimal(18,6)
- DECLARE @StrikeAll decimal(18,6)
-
- SELECT @StrikePreGet = ISNULL(SUM(PayablesStrikeMethod.Amount_PayablesStrikeMethod),0) FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike AND PayablesStrikeMethod.Type_PayablesStrikeMethod = '冲减预付款'
- SELECT @StrikeAll = SUM(PayablesStrikeMethod.Amount_PayablesStrikeMethod) FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike
- IF (@ID_Assessor IS NOT NULL)
- BEGIN
- IF ((SELECT PreGetBalance_Supplier FROM Supplier WHERE ID_Supplier = @ID_Supplier) < @StrikePreGet)
- BEGIN
- SET @error = N'该供应商的预付帐款余额小于此次冲帐所使用的金额,审核失败!'
- RAISERROR(@error,16,1)
- RETURN
- END
- END
- ELSE
- BEGIN
- SET @StrikePreGet = - @StrikePreGet
- SET @StrikeAll = - @StrikeAll
- END
-
- IF (@Prev_PayablesStrike = 0)
- BEGIN
- DECLARE CUR CURSOR FOR SELECT PayablesStrikeBills.No_PurchaseInvoice,Strike_PayablesStrikeBills,Discount_PayablesStrikeBills,
- PurchaseInvoice.ID_Assessor ,PurchaseInvoice.Disable_PurchaseInvoice,PurchaseInvoice.Amount_PurchaseInvoice,PurchaseInvoice.StrikedAmount_PurchaseInvoice
- FROM PayablesStrikeBills
- Left Join PurchaseInvoice On PurchaseInvoice.No_PurchaseInvoice=PayablesStrikeBills.No_PurchaseInvoice
- WHERE ID_PayablesStrike = @ID_PayablesStrike
- OPEN CUR
- FETCH NEXT FROM CUR INTO @No_PurchaseInvoice, @Strike_PayablesStrikeBills, @Discount_PayablesStrikeBills, @ID_Assessor_PurchaseInvoice, @Disable_PurchaseInvoice, @Amount_PurchaseInvoice,@StrikedAmount_PurchaseInvoice
- WHILE @@FETCH_STATUS = 0
- BEGIN
- IF (@ID_Assessor IS NULL)
- BEGIN
- set @Strike_PayablesStrikeBills = -@Strike_PayablesStrikeBills
- set @Discount_PayablesStrikeBills = -@Discount_PayablesStrikeBills
- END
-
- IF (@ID_Assessor IS NOT NULL)
- BEGIN
- IF(@ID_Assessor_PurchaseInvoice IS NULL)
- BEGIN
- SET @error = N'编号为' + @No_PurchaseInvoice + '的进项发票尚未经过审核,审核失败!'
- RAISERROR(@error,16,1)
- RETURN
- END
- IF(@Disable_PurchaseInvoice=1)
- BEGIN
- SET @error = N'编号为' + @No_PurchaseInvoice+ '的发票已作废,审核失败!'
- RAISERROR(@error,16,1)
- RETURN
- END
-
- IF ((@Strike_PayablesStrikeBills + @Discount_PayablesStrikeBills) > ( @Amount_PurchaseInvoice-@StrikedAmount_PurchaseInvoice))
- BEGIN
- SET @error = N'编号为' + @No_PurchaseInvoice + '的发票未冲减金额小于本次冲帐和本次折让的和,审核失败!'
- RAISERROR(@error,16,1)
- RETURN
- END
-
- END
- Update PurchaseInvoice Set StrikedAmount_PurchaseInvoice=(StrikedAmount_PurchaseInvoice+@Strike_PayablesStrikeBills + @Discount_PayablesStrikeBills)
- Where No_PurchaseInvoice=@No_PurchaseInvoice
-
- FETCH NEXT FROM CUR INTO @No_PurchaseInvoice, @Strike_PayablesStrikeBills, @Discount_PayablesStrikeBills, @ID_Assessor_PurchaseInvoice, @Disable_PurchaseInvoice, @Amount_PurchaseInvoice,@StrikedAmount_PurchaseInvoice
- END
- CLOSE CUR
- DEALLOCATE CUR
- END
- UPDATE Supplier SET PreGetBalance_Supplier = (PreGetBalance_Supplier - @StrikePreGet), ToPayBalance_Supplier = (ToPayBalance_Supplier - @StrikeAll) WHERE ID_Supplier = @ID_Supplier
- UPDATE PayablesStrike SET ID_Assessor = @ID_Assessor, AssessDate_PayablesStrike = @AssessDate_PayablesStrike WHERE ID_PayablesStrike = @ID_PayablesStrike
- ">
- <Params>
- <Param name="@ID_PayablesStrike" type="PayablesStrike.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@ID_Supplier" type="PayablesStrike.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@ID_Assessor" type="PayablesStrike.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_PayablesStrike" type="PayablesStrike.AssessDate_PayablesStrike" sourceColumn="AssessDate_PayablesStrike" />
- <Param name="@Prev_PayablesStrike" type="PayablesStrike.Prev_PayablesStrike" sourceColumn="Prev_PayablesStrike" />
- </Params>
- </Audit>
- <Delete CmdType="Text" CmdText=" DELETE PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike
- DELETE PayablesStrikeBills WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike
- DELETE PayablesStrike WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike">
- <Params>
- <Param name="@ID_PayablesStrike" type="PayablesStrike.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该单据已被其他单据引用,删除失败!" />
- <UNIQUEErrorReport ErrorMessage="该应付帐款冲帐单号已存在,提交失败!" />
- </Table>
- <Table name="PayablesStrikeMethod" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PayablesStrikeMethod.* FROM PayablesStrikeMethod" />
- <New CmdType="Text" CmdText=" INSERT INTO PayablesStrikeMethod (ID_PayablesStrikeMethod, No_PayablesStrikeMethod, ID_PayablesStrike,
- Type_PayablesStrikeMethod, Amount_PayablesStrikeMethod, Comment_PayablesStrikeMethod)
- VALUES (@ID_PayablesStrikeMethod, @No_PayablesStrikeMethod, @ID_PayablesStrike,
- @Type_PayablesStrikeMethod, @Amount_PayablesStrikeMethod, @Comment_PayablesStrikeMethod)">
- <Params>
- <Param name="@ID_PayablesStrikeMethod" type="PayablesStrikeMethod.ID_PayablesStrikeMethod" sourceColumn="ID_PayablesStrikeMethod" />
- <Param name="@No_PayablesStrikeMethod" type="PayablesStrikeMethod.No_PayablesStrikeMethod" sourceColumn="No_PayablesStrikeMethod" />
- <Param name="@ID_PayablesStrike" type="PayablesStrikeMethod.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@Type_PayablesStrikeMethod" type="PayablesStrikeMethod.Type_PayablesStrikeMethod" sourceColumn="Type_PayablesStrikeMethod" />
- <Param name="@Amount_PayablesStrikeMethod" type="PayablesStrikeMethod.Amount_PayablesStrikeMethod" sourceColumn="Amount_PayablesStrikeMethod" />
- <Param name="@Comment_PayablesStrikeMethod" type="PayablesStrikeMethod.Comment_PayablesStrikeMethod" sourceColumn="Comment_PayablesStrikeMethod" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE PayablesStrikeMethod SET Type_PayablesStrikeMethod = @Type_PayablesStrikeMethod,
- Amount_PayablesStrikeMethod = @Amount_PayablesStrikeMethod, Comment_PayablesStrikeMethod = @Comment_PayablesStrikeMethod
- WHERE ID_PayablesStrikeMethod = @ID_PayablesStrikeMethod">
- <Params>
- <Param name="@ID_PayablesStrikeMethod" type="PayablesStrikeMethod.ID_PayablesStrikeMethod" sourceColumn="ID_PayablesStrikeMethod" />
- <Param name="@Type_PayablesStrikeMethod" type="PayablesStrikeMethod.Type_PayablesStrikeMethod" sourceColumn="Type_PayablesStrikeMethod" />
- <Param name="@Amount_PayablesStrikeMethod" type="PayablesStrikeMethod.Amount_PayablesStrikeMethod" sourceColumn="Amount_PayablesStrikeMethod" />
- <Param name="@Comment_PayablesStrikeMethod" type="PayablesStrikeMethod.Comment_PayablesStrikeMethod" sourceColumn="Comment_PayablesStrikeMethod" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE PayablesStrikeMethod WHERE ID_PayablesStrikeMethod = @ID_PayablesStrikeMethod">
- <Params>
- <Param name="@ID_PayablesStrikeMethod" type="PayablesStrikeMethod.ID_PayablesStrikeMethod" sourceColumn="ID_PayablesStrikeMethod" />
- </Params>
- </Delete>
- </Table>
- <Table name="PayablesStrikeBills" Type="Child">
- <GetSchema CmdType="Text" CmdText="
- SELECT TOP 0 PayablesStrikeBills.*
- FROM PayablesStrikeBills
- " />
- <New CmdType="Text" CmdText=" INSERT INTO PayablesStrikeBills (ID_PayablesStrikeBills, No_PayablesStrikeBills,
- ID_PayablesStrike,No_PurchaseInvoice, No_Invoice,
- PayDate_PayablesStrikeBills,Amount_FromBill,ToPayAmount_PayablesStrikeBills,Strike_PayablesStrikeBills,Discount_PayablesStrikeBills,StrikedAmount_PayablesStrikeBills )
- VALUES (@ID_PayablesStrikeBills, @No_PayablesStrikeBills,
- @ID_PayablesStrike, @No_PurchaseInvoice, @No_Invoice,
- @PayDate_PayablesStrikeBills,@Amount_FromBill,@ToPayAmount_PayablesStrikeBills,@Strike_PayablesStrikeBills,@Discount_PayablesStrikeBills,@StrikedAmount_PayablesStrikeBills ) ">
- <Params>
- <Param name="@ID_PayablesStrikeBills" type="PayablesStrikeBills.ID_PayablesStrikeBills" sourceColumn="ID_PayablesStrikeBills" />
- <Param name="@No_PayablesStrikeBills" type="PayablesStrikeBills.No_PayablesStrikeBills" sourceColumn="No_PayablesStrikeBills" />
- <Param name="@ID_PayablesStrike" type="PayablesStrikeBills.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@No_PurchaseInvoice" type="PayablesStrikeBills.No_PurchaseInvoice" sourceColumn="No_PurchaseInvoice" />
- <Param name="@No_Invoice" type="PayablesStrikeBills.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@PayDate_PayablesStrikeBills" type="PayablesStrikeBills.PayDate_PayablesStrikeBills" sourceColumn="PayDate_PayablesStrikeBills" />
- <Param name="@Amount_FromBill" type="PayablesStrikeBills.Amount_FromBill" sourceColumn="Amount_FromBill" />
- <Param name="@ToPayAmount_PayablesStrikeBills" type="PayablesStrikeBills.ToPayAmount_PayablesStrikeBills" sourceColumn="ToPayAmount_PayablesStrikeBills" />
- <Param name="@Strike_PayablesStrikeBills" type="PayablesStrikeBills.Strike_PayablesStrikeBills" sourceColumn="Strike_PayablesStrikeBills" />
- <Param name="@Discount_PayablesStrikeBills" type="PayablesStrikeBills.Discount_PayablesStrikeBills" sourceColumn="Discount_PayablesStrikeBills" />
- <Param name="@StrikedAmount_PayablesStrikeBills" type="PayablesStrikeBills.StrikedAmount_PayablesStrikeBills" sourceColumn="StrikedAmount_PayablesStrikeBills" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE PayablesStrikeBills SET No_PayablesStrikeBills = @No_PayablesStrikeBills,
- No_PurchaseInvoice = @No_PurchaseInvoice, No_Invoice = @No_Invoice,
- PayDate_PayablesStrikeBills = @PayDate_PayablesStrikeBills,
- Amount_FromBill = @Amount_FromBill,
- ToPayAmount_PayablesStrikeBills = @ToPayAmount_PayablesStrikeBills,
- Strike_PayablesStrikeBills = @Strike_PayablesStrikeBills,
- Discount_PayablesStrikeBills = @Discount_PayablesStrikeBills,
- StrikedAmount_PayablesStrikeBills =@StrikedAmount_PayablesStrikeBills
- WHERE ID_PayablesStrikeBills = @ID_PayablesStrikeBills">
- <Params>
- <Param name="@ID_PayablesStrikeBills" type="PayablesStrikeBills.ID_PayablesStrikeBills" sourceColumn="ID_PayablesStrikeBills" />
- <Param name="@No_PayablesStrikeBills" type="PayablesStrikeBills.No_PayablesStrikeBills" sourceColumn="No_PayablesStrikeBills" />
- <Param name="@ID_PayablesStrike" type="PayablesStrikeBills.ID_PayablesStrike" sourceColumn="ID_PayablesStrike" />
- <Param name="@No_PurchaseInvoice" type="PayablesStrikeBills.No_PurchaseInvoice" sourceColumn="No_PurchaseInvoice" />
- <Param name="@No_Invoice" type="PayablesStrikeBills.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@PayDate_PayablesStrikeBills" type="PayablesStrikeBills.PayDate_PayablesStrikeBills" sourceColumn="PayDate_PayablesStrikeBills" />
- <Param name="@Amount_FromBill" type="PayablesStrikeBills.Amount_FromBill" sourceColumn="Amount_FromBill" />
- <Param name="@ToPayAmount_PayablesStrikeBills" type="PayablesStrikeBills.ToPayAmount_PayablesStrikeBills" sourceColumn="ToPayAmount_PayablesStrikeBills" />
- <Param name="@Strike_PayablesStrikeBills" type="PayablesStrikeBills.Strike_PayablesStrikeBills" sourceColumn="Strike_PayablesStrikeBills" />
- <Param name="@Discount_PayablesStrikeBills" type="PayablesStrikeBills.Discount_PayablesStrikeBills" sourceColumn="Discount_PayablesStrikeBills" />
- <Param name="@StrikedAmount_PayablesStrikeBills" type="PayablesStrikeBills.StrikedAmount_PayablesStrikeBills" sourceColumn="StrikedAmount_PayablesStrikeBills" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE PayablesStrikeBills WHERE ID_PayablesStrikeBills = @ID_PayablesStrikeBills">
- <Params>
- <Param name="@ID_PayablesStrikeBills" type="PayablesStrikeBills.ID_PayablesStrikeBills" sourceColumn="ID_PayablesStrikeBills" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
- <Tables>
- <Table name="AllSupplier" />
- </Tables>
- </SearchAllSupplier>
- <SearchAllBill CmdType="Text" CmdText=" SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike ">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchPayablesStrikeWithNo CmdType="Text" CmdText=" DECLARE @ID_PayablesStrike uniqueidentifier
-
- SELECT @ID_PayablesStrike = PayablesStrike.ID_PayablesStrike FROM PayablesStrike WHERE PayablesStrike.No_PayablesStrike = @No_PayablesStrike
-
- SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer, Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike
- WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike
-
- SELECT PayablesStrikeMethod.* FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeMethod.No_PayablesStrikeMethod
-
- SELECT PayablesStrikeBills.* FROM PayablesStrikeBills
- WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeBills.No_PayablesStrikeBills">
- <Params>
- <Param name="@No_PayablesStrike" type="PayablesStrike.No_PayablesStrike" Index="0" />
- </Params>
- <Tables>
- <Table name="PayablesStrike" />
- <Table name="PayablesStrikeMethod" />
- <Table name="PayablesStrikeBills" />
- </Tables>
- </SearchPayablesStrikeWithNo>
- <SearchSupplierWithNo CmdType="Text" CmdText=" SELECT Supplier.* FROM Supplier WHERE Supplier.No_Supplier = @No_Supplier">
- <Params>
- <Param name="@No_Supplier" type="PayablesStrike.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier" />
- </Tables>
- </SearchSupplierWithNo>
- <SearchPayer CmdType="Text" CmdText=" SELECT Employee.No_Employee,Employee.ID_Employee, Employee.Name_Employee FROM Employee WHERE Employee.SuspendDate_Employee IS NULL">
- <Tables>
- <Table name="Payer" />
- </Tables>
- </SearchPayer>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchPayablesStrikeMethod CmdType="Text" CmdText=" SELECT '现金' AS Result
- UNION
- SELECT '刷卡' AS Result
- UNION
- SELECT '支票' AS Result
- UNION
- SELECT '冲减预付款' AS Result
- UNION
- SELECT '抵帐' AS Result
- UNION
- SELECT '转帐' AS Result
- UNION
- SELECT '银行汇票' AS Result
- UNION
- SELECT '银行承兑汇票' AS Result
- ">
- <Tables>
- <Table name="Method" />
- </Tables>
- </SearchPayablesStrikeMethod>
- <SearchBillType CmdType="Text" CmdText=" SELECT * FROM BillType WHERE Value_BillType = 1 OR Value_BillType = 41 OR Value_BillType=0 ORDER BY Value_BillType">
- <Tables>
- <Table name="BillType" />
- </Tables>
- </SearchBillType>
- <SearchFromBillWithNo CmdType="Text" CmdText=" IF @Type_FromBill = 1
- BEGIN
- SELECT ID_Supplier AS Supplier,Currency_PurchaseInDepotBill AS Currency,ID_Assessor,
- AssessDate_PurchaseInDepotBill AS AssessDate, AssessDate_PurchaseInDepotBill AS PayDate,
- GoodsAmount_PurchaseInDepotBill AS GoodsAmount, TaxAmount_PurchaseInDepotBill AS TaxAmount,
- StrikedGoodsAmount_PurchaseInDepotBill AS StrikedGoodsAmount, StrikedTaxAmount_PurchaseInDepotBill AS StrikedTaxAmount
- FROM PurchaseInDepotBill
- WHERE No_PurchaseInDepotBill = @No_FromBill
- END
- ELSE
- BEGIN
- SELECT ID_Supplier AS Supplier, Currency_PurchaseOrderBill AS Currency,ID_Assessor,
- AssessDate_PurchaseOrderBill AS AssessDate, AssessDate_PurchaseOrderBill AS PayDate,
- GoodsAmount_PurchaseOrderBill AS GoodsAmount, TaxAmount_PurchaseOrderBill AS TaxAmount,
- StrikedGoodsAmount_PurchaseOrderBill AS StrikedGoodsAmount, StrikedTaxAmount_PurchaseOrderBill AS StrikedTaxAmount
- FROM PurchaseOrderBill WHERE No_PurchaseOrderBill = @No_FromBill
- END">
- <Params>
- <Param name="@Type_FromBill" type="PayablesStrikeBills.Type_FromBill" Index="0" />
- <Param name="@No_FromBill" type="PayablesStrikeBills.No_FromBill" Index="1" />
- </Params>
- <Tables>
- <Table name="FromBill" />
- </Tables>
- </SearchFromBillWithNo>
- <SearchFromBillInInvoice CmdType="Text" CmdText="
- Select PurchaseInvoice.No_Invoice,Amount_PurchaseInvoice,PayDate_PurchaseInvoice,StrikedAmount_PurchaseInvoice,ID_Assessor,Disable_PurchaseInvoice,ID_Supplier
- From PurchaseInvoice
- Where No_PurchaseInvoice=@No_PurchaseInvoice
- ">
- <Params>
- <Param name="@No_PurchaseInvoice" type="ReceivablesStrikeBills.No_PurchaseInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="FromBill" />
- </Tables>
- </SearchFromBillInInvoice>
- <SearchPayablesStrikeFirst CmdType="Text" CmdText=" DECLARE @ID_PayablesStrike uniqueidentifier
-
- SELECT TOP 1 @ID_PayablesStrike = PayablesStrike.ID_PayablesStrike FROM PayablesStrike ORDER BY PayablesStrike.No_PayablesStrike
-
- SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer, Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike
- WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike
-
- SELECT PayablesStrikeMethod.* FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeMethod.No_PayablesStrikeMethod
-
- SELECT PayablesStrikeBills.* FROM PayablesStrikeBills
- WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeBills.No_PayablesStrikeBills">
- <Tables>
- <Table name="PayablesStrike" />
- <Table name="PayablesStrikeMethod" />
- <Table name="PayablesStrikeBills" />
- </Tables>
- </SearchPayablesStrikeFirst>
- <SearchPayablesStrikePrevious CmdType="Text" CmdText=" DECLARE @ID_PayablesStrike uniqueidentifier
-
- SELECT TOP 1 @ID_PayablesStrike = PayablesStrike.ID_PayablesStrike FROM PayablesStrike WHERE PayablesStrike.No_PayablesStrike < @No_PayablesStrike ORDER BY PayablesStrike.No_PayablesStrike DESC
-
- SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer, Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike
- WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike
-
- SELECT PayablesStrikeMethod.* FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeMethod.No_PayablesStrikeMethod
-
- SELECT PayablesStrikeBills.* FROM PayablesStrikeBills
- WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeBills.No_PayablesStrikeBills">
- <Params>
- <Param name="@No_PayablesStrike" type="PayablesStrike.No_PayablesStrike" Index="0" />
- </Params>
- <Tables>
- <Table name="PayablesStrike" />
- <Table name="PayablesStrikeMethod" />
- <Table name="PayablesStrikeBills" />
- </Tables>
- </SearchPayablesStrikePrevious>
- <SearchPayablesStrikeNext CmdType="Text" CmdText=" DECLARE @ID_PayablesStrike uniqueidentifier
-
- SELECT TOP 1 @ID_PayablesStrike = PayablesStrike.ID_PayablesStrike FROM PayablesStrike WHERE PayablesStrike.No_PayablesStrike > @No_PayablesStrike ORDER BY PayablesStrike.No_PayablesStrike
-
- SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer,Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike
- WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike
-
- SELECT PayablesStrikeMethod.* FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeMethod.No_PayablesStrikeMethod
-
- SELECT PayablesStrikeBills.* FROM PayablesStrikeBills
- WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeBills.No_PayablesStrikeBills">
- <Params>
- <Param name="@No_PayablesStrike" type="PayablesStrike.No_PayablesStrike" Index="0" />
- </Params>
- <Tables>
- <Table name="PayablesStrike" />
- <Table name="PayablesStrikeMethod" />
- <Table name="PayablesStrikeBills" />
- </Tables>
- </SearchPayablesStrikeNext>
- <SearchPayablesStrikeLast CmdType="Text" CmdText=" DECLARE @ID_PayablesStrike uniqueidentifier
-
- SELECT TOP 1 @ID_PayablesStrike = PayablesStrike.ID_PayablesStrike FROM PayablesStrike ORDER BY PayablesStrike.No_PayablesStrike DESC
-
- SELECT PayablesStrike.*, Supplier.No_Supplier, Supplier.ShortName_Supplier, Supplier.PreGetBalance_Supplier, Employee.No_Employee AS No_Payer,Employee.Name_Employee,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS Name_LastModUser,
- CONVERT(decimal(18,6), 0) AS SumSale, CONVERT(decimal(18,6), 0) AS SumRtn, CONVERT(decimal(18,6), 0) AS SumPay
- FROM PayablesStrike
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PayablesStrike.ID_Supplier
- LEFT JOIN Employee ON Employee.ID_Employee = PayablesStrike.ID_Payer
- LEFT JOIN AppUser a ON a.ID_User = PayablesStrike.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PayablesStrike.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PayablesStrike.LastModUser_PayablesStrike
- WHERE PayablesStrike.ID_PayablesStrike = @ID_PayablesStrike
-
- SELECT PayablesStrikeMethod.* FROM PayablesStrikeMethod WHERE PayablesStrikeMethod.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeMethod.No_PayablesStrikeMethod
-
- SELECT PayablesStrikeBills.* FROM PayablesStrikeBills
- WHERE PayablesStrikeBills.ID_PayablesStrike = @ID_PayablesStrike ORDER BY PayablesStrikeBills.No_PayablesStrikeBills">
- <Tables>
- <Table name="PayablesStrike" />
- <Table name="PayablesStrikeMethod" />
- <Table name="PayablesStrikeBills" />
- </Tables>
- </SearchPayablesStrikeLast>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- dtDate.Enabled = false;
- tbNo.ReadOnly = false;
- tbSupplierNo.ReadOnly = true;
- cbPayer.Enabled = false;
- txtComment.ReadOnly = true;
- txtSumPay.CValue = 0.00;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- dgReceiveMoney.ReadOnly = true;
- dgBill.ReadOnly = true;
- toolBar.EnableNew = GetRight(@Title,"新增");
- toolBar.EnableSubmit = false;
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnablePrint = false;
- cbPrev.Enabled = false;
- btnSearchByInvoice.Enabled = false;
- btnAutoStrike.Enabled = false;
- btnVerify.Enabled = false;
- #PayablesStrike.GetCurrency_PayablesStrike = "";
- #PayablesStrike.BillCurrency_PayablesStrike = "";
- #PayablesStrike.Rate_PayablesStrike = 0;
- #PayablesStrike.AssessDate_PayablesStrike = DBNull();
- #PayablesStrike.LastModDate_PayablesStrike = DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status = 0;
- </Search>
- <New>
- Empty();
- NewInstance();
- dtDate.Enabled = true;
- tbNo.ReadOnly = true;
- tbSupplierNo.ReadOnly = false;
- cbPayer.Enabled = true;
- txtComment.ReadOnly = false;
- txtSumPay.CValue = 0.00;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- dgReceiveMoney.ReadOnly = false;
- dgBill.ReadOnly = false;
- toolBar.EnableNew = false;
- toolBar.EnableSubmit = GetRight(@Title,"新增");
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnablePrint = false;
- cbPrev.Enabled = true;
- btnSearchByInvoice.Enabled = true;
- btnAutoStrike.Enabled = true;
- btnVerify.Enabled = true;
- dgReceiveMoney.AllowNew(true);
- dgReceiveMoney.AllowDelete(true);
- dgReceiveMoney.SetColumnReadOnly(1, false);
- dgReceiveMoney.RowHeaderCheck = true;
- dgBill.AllowNew(true);
- dgBill.AllowDelete(true);
- dgBill.SetColumnReadOnly(1, false);
- dgBill.RowHeaderCheck = true;
- #PayablesStrike.ID_PayablesStrike = NewGuid();
- #PayablesStrike.ID_Creator = GetLoginUserID();
- #PayablesStrike.Name_Creator = GetCurrentUser();
- #PayablesStrike.ID_Assessor = DBNull();
- #PayablesStrike.AssessDate_PayablesStrike = DBNull();
- #PayablesStrike.LastModUser_PayablesStrike = DBNull();
- #PayablesStrike.LastModDate_PayablesStrike = DBNull();
- #PayablesStrike.GetCurrency_PayablesStrike = @SysCurrency;
- #PayablesStrike.BillCurrency_PayablesStrike = @SysCurrency;
- #PayablesStrike.Rate_PayablesStrike = 1;
- SetColumnDefaultValue("PayablesStrikeBills", "PayDate_PayablesStrikeBills", DBNull());
- UpdateForm(true, "");
- @Status = 1;
- </New>
- <View>
- dtDate.Enabled = false;
- tbNo.ReadOnly = true;
- tbSupplierNo.ReadOnly = true;
- cbPayer.Enabled = false;
- txtComment.ReadOnly = true;
- dgReceiveMoney.ReadOnly = true;
- dgBill.ReadOnly = true;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- toolBar.EnableNew = GetRight(@Title,"新增");
- toolBar.EnableSubmit = false;
- if (Equals(#PayablesStrike.ID_Assessor, DBNull()))
- {
- toolBar.EnableModify = GetRight(@Title,"修改");
- toolBar.EnableDelete = GetRight(@Title,"删除");
- toolBar.EnableAudit = GetRight(@Title,"审核");
- toolBar.EnableUnAudit = false;
- }
- else
- {
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = GetRight(@Title,"取消审核");
- }
- toolBar.EnablePrint = GetRight(@Title,"打印");
- cbPrev.Enabled = false;
- btnSearchByInvoice.Enabled = false;
- btnAutoStrike.Enabled = false;
- btnVerify.Enabled = false;
- UpdateForm(true, "");
- @Status = 2;
- </View>
- <Modify>
- dtDate.Enabled = false;
- tbNo.ReadOnly = true;
- tbSupplierNo.ReadOnly = true;
- cbPayer.Enabled = true;
- txtComment.ReadOnly = false;
- dgReceiveMoney.ReadOnly = false;
- dgBill.ReadOnly = false;
- toolBar.EnableNew = false;
- toolBar.EnableSubmit = GetRight(@Title,"修改");
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnablePrint = false;
- @NotAssess = Equals(#PayablesStrike.AssessDate_PayablesStrike, DBNull());
- cbPrev.Enabled = @NotAssess;
- if (cbPrev.Checked)
- {
- btnSearchByInvoice.Enabled = false;
- btnAutoStrike.Enabled = false;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- }
- else
- {
- btnSearchByInvoice.Enabled = @NotAssess;
- btnAutoStrike.Enabled = true;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- }
- btnVerify.Enabled = true;
- dgReceiveMoney.AllowNew(@NotAssess);
- dgReceiveMoney.AllowDelete(@NotAssess);
- dgReceiveMoney.SetColumnReadOnly(1, !@NotAssess);
- dgReceiveMoney.RowHeaderCheck = @NotAssess;
- dgBill.AllowNew(@NotAssess);
- dgBill.AllowDelete(@NotAssess);
- dgBill.SetColumnReadOnly(1, !@NotAssess);
- dgBill.RowHeaderCheck = @NotAssess;
- #PayablesStrike.LastModUser_PayablesStrike = GetLoginUserID();
- #PayablesStrike.Name_LastModUser = GetCurrentUser();
- #PayablesStrike.LastModDate_PayablesStrike = DateTimeNow();
- SetColumnDefaultValue("PayablesStrikeBills", "PayDate_PayablesStrikeBills", DBNull());
- UpdateForm(true, "");
- @Status = 3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if (!cbPayer.CheckSelectedItem())
- {
- MessageBox("请选择有效的经办人!",@Title);
- cbPayer.Focus();
- return;
- }
- SuspendLayout();
- if (#PayablesStrike.PreGetBalance_Supplier < SumOfCol("#PayablesStrikeMethod.Amount_PayablesStrikeMethod", "Type_PayablesStrikeMethod = '冲减预付款'", false))
- {
- MessageBox("该供应商的预付帐款余额不得小于此次冲帐所使用的金额!",@Title);
- dgReceiveMoney.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- return;
- }
- for (@i=0; @i<RowCount("#PayablesStrikeMethod"); @i=@i+1)
- {
- SetPosition("#PayablesStrikeMethod", @i);
- if (Equals(#PayablesStrikeMethod.ID_PayablesStrikeMethod,GuidEmpty()))
- #PayablesStrikeMethod.ID_PayablesStrikeMethod = NewGuid();
- #PayablesStrikeMethod.ID_PayablesStrike = #PayablesStrike.ID_PayablesStrike;
- }
- for (@i=0; @i<RowCount("#PayablesStrikeBills"); @i=@i+1)
- {
- SetPosition("#PayablesStrikeBills", @i);
- if (Equals(#PayablesStrikeBills.ID_PayablesStrikeBills,GuidEmpty()))
- #PayablesStrikeBills.ID_PayablesStrikeBills = NewGuid();
- #PayablesStrikeBills.ID_PayablesStrike = #PayablesStrike.ID_PayablesStrike;
- }
- ResumeLayout();
- UpdateForm(false, "");
- if (@Status == 1)
- {
- #PayablesStrike.CreateDate_PayablesStrike = DateTimeNow();
- #PayablesStrike.No_PayablesStrike = New("#PayablesStrike.No_PayablesStrike",dtDate.CValue);
- }
- else if (@Status == 3)
- {
- #PayablesStrike.LastModDate_PayablesStrike = DateTimeNow();
- Update();
- }
- ChangeMode("View",#PayablesStrike.ID_Assessor);
- ]]>
- </SubmitButtonClick>
- <GetFromBill>
- <![CDATA[
- if(Search("SearchFromBillInInvoice",#PayablesStrikeBills.No_PurchaseInvoice))
- {
- if(Equals(#FromBill.ID_Assessor,DBNull()))
- {
- MessageBox("该进项发票未经审核!",@Title);
- return;
- }
- else if(#FromBill.Disable_PurchaseInvoice == true)
- {
- MessageBox("该进项发票已作废!",@Title);
- return;
- }
- else if(#FromBill.Amount_PurchaseInvoice <= #FromBill.StrikedAmount_PurchaseInvoice)
- {
- MessageBox("该进项发票金额已全部冲减完毕!",@Title);
- return;
- }
-
- #PayablesStrikeBills.No_Invoice=#FromBill.No_Invoice;
- #PayablesStrikeBills.PayDate_PayablesStrikeBills=#FromBill.PayDate_PurchaseInvoice;
- #PayablesStrikeBills.Amount_FromBill=#FromBill.Amount_PurchaseInvoice;
- #PayablesStrikeBills.StrikedAmount_PayablesStrikeBills=#FromBill.StrikedAmount_PurchaseInvoice;
- #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills=#FromBill.Amount_PurchaseInvoice-#FromBill.StrikedAmount_PurchaseInvoice;
-
- }
- else
- {
- MessageBox("该进项发票不存在!",@Title);
- return;
- }
- ]]>
- </GetFromBill>
- <CountSum>
- <![CDATA[
- txtSumPay.CValue = SumOfCol("#PayablesStrikeBills.Strike_PayablesStrikeBills");
- ]]>
- </CountSum>
- <Verify>
- <![CDATA[
- UpdateForm(false, "");
- if (!Search("SearchSupplierWithNo", tbSupplierNo.CValue) || !Equals(#PayablesStrike.ID_Supplier,#Supplier.ID_Supplier))
- {
- MessageBox("请输入有效的供应商编号,并按回车确认!",@Title);
- tbSupplierNo.Focus();
- return;
- }
- if(!cbPayer.CheckSelectedItem())
- {
- MessageBox("请选择有效的经办人!",@Title);
- cbPayer.Focus();
- tbDetail.SelectedIndex = 0;
- return;
- }
- if (RowCount("#PayablesStrikeMethod") == 0)
- {
- MessageBox("收款方式及收款金额列表不能为空!",@Title);
- tbDetail.SelectedIndex = 0;
- dgReceiveMoney.Focus();
- return;
- }
- if (!cbPrev.Checked && RowCount("#PayablesStrikeBills") == 0)
- {
- MessageBox("冲帐单据列表不能为空!",@Title);
- tbDetail.SelectedIndex = 1;
- dgBill.Focus();
- return;
- }
- SuspendLayout();
- for (@i=0; @i<RowCount("#PayablesStrikeMethod"); @i=@i+1)
- {
- SetPosition("#PayablesStrikeMethod", @i);
- if (#PayablesStrikeMethod.Amount_PayablesStrikeMethod < 0)
- {
- MessageBox("付款金额不得小于0!",@Title);
- dgReceiveMoney.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 0;
- dgReceiveMoney.CurrentRowIndex = @i;
- return;
- }
- }
- @AllStrikeAmount = SumOfCol("#PayablesStrikeMethod.Amount_PayablesStrikeMethod") ;
- if (@AllStrikeAmount == 0)
- {
- MessageBox("本次出帐金额不得为0!",@Title);
- dgReceiveMoney.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 0;
- return;
- }
- for (@i=0; @i<RowCount("#PayablesStrikeBills"); @i=@i+1)
- {
- SetPosition("#PayablesStrikeBills", @i);
- if (Equals(#PayablesStrike.Prev_PayablesStrike, false))
- {
- if (Equals(#PayablesStrikeBills.No_PurchaseInvoice, ""))
- {
- MessageBox("请填入进项发票单号!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- if(Search("SearchFromBillInInvoice",#PayablesStrikeBills.No_PurchaseInvoice))
- {
- if(Equals(#FromBill.ID_Assessor,DBNull()))
- {
- MessageBox("该进项发票未经审核!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- else if(#FromBill.Disable_PurchaseInvoice==1)
- {
- MessageBox("该进项发票已作废!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- else if(#FromBill.Amount_PurchaseInvoice <= #FromBill.StrikedAmount_PurchaseInvoice)
- {
- MessageBox("该进项发票金额已全部冲减完毕!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- else if(!Equals(#FromBill.ID_Supplier,#PayablesStrike.ID_Supplier))
- {
- MessageBox("该进项发票的供应商与本单据的供应商不一致!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- }
- else
- {
- MessageBox("该进项发票不存在!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- }
-
- if (#PayablesStrikeBills.Strike_PayablesStrikeBills < 0)
- {
- MessageBox("本次冲帐金额不得小于0!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- if (#PayablesStrikeBills.Discount_PayablesStrikeBills < 0)
- {
- MessageBox("本次冲帐折让金额不得小于0!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- if (#PayablesStrikeBills.Strike_PayablesStrikeBills > #PayablesStrikeBills.ToPayAmount_PayablesStrikeBills )
- {
- MessageBox("本次冲账不得大于本次应付!",@Title);
- dgBill.Focus();
- ResumeLayout();
- tbDetail.SelectedIndex = 1;
- dgBill.CurrentRowIndex = @i;
- return;
- }
- }
- ResumeLayout();
- if (SumOfCol("#PayablesStrikeMethod.Amount_PayablesStrikeMethod")!=SumOfCol("#PayablesStrikeBills.Strike_PayablesStrikeBills"))
- {
- MessageBox("本次冲帐金额和出帐金额不相等!",@Title);
- dgBill.Focus();
- tbDetail.SelectedIndex = 1;
- return;
- }
-
- ]]>
- </Verify>
- </Lables>
- </Form>
- </Forms>
|