123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmConstraintEndCase">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="强制结案";
- GetSchema();
- ChangeMode("Search");
- ]]>
- </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>
- <IKTextButton name="tbNo" DataSource="PurchaseOrderBill.No_PurchaseOrderBill">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(!Search("SearchPurchaseOrderBill",tbNo.CValue))
- {
- MessageBox("该采购订单不存在!",@Title);
- }
- else
- {
- if(Search("SearchPurchaseOrderBillWithNo", tbNo.CValue))
- {
-
- ChangeMode("Modify");
- }
- else
- {
- MessageBox("该采购订单未审核!",@Title);
- if(Search("SearchPurchaseOrderBillNoAssess",tbNo.CValue));
- ChangeMode("View");
- }
- }
- }
- else
- {
- MessageBox("请输入采购单号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbNo",tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="refNo" DataSource="PurchaseOrderBill.RefNo_PurchaseOrderBill"/>
- <IKDateTimeText name="dtDate" DataSource="PurchaseOrderBill.Date_PurchaseOrderBill"/>
- <IKDateTimeText name="dtArrivalDate" DataSource="PurchaseOrderBill.ArrivalDate_PurchaseOrderBill"/>
- <IKTextBox name="txtSupplierNo" DataSource="PurchaseOrderBill.No_Supplier"/>
- <IKTextBox name="txtSupplierName" DataSource="PurchaseOrderBill.ShortName_Supplier"/>
- <IKTextBox name="txtAssessor" DataSource="PurchaseOrderBill.Assessor"/>
- <IKDateTimeText name="dtAssessDate" DataSource="PurchaseOrderBill.AssessDate_PurchaseOrderBill"/>
- <IKTextBox name="txtComment" DataSource="PurchaseOrderBill.Comment_EndCase"/>
- <IKDataGridEx name="ikDataGridEx1" DataSource="PurchaseSourceBillProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PurchaseSourceBillProduct.No_Product" />
- <DataColumn Index="1" DataSource="PurchaseSourceBillProduct.Name_Product" />
- <DataColumn Index="2" DataSource="PurchaseSourceBillProduct.Quantity_Order" />
- <DataColumn Index="3" DataSource="PurchaseSourceBillProduct.Amount" />
- <DataColumn Index="4" DataSource="PurchaseSourceBillProduct.Date_EndCase" />
- <DataColumn Index="5" DataSource="PurchaseSourceBillProduct.Quantity_EndCase" />
- <DataColumn Index="6" DataSource="PurchaseSourceBillProduct.Quantity_InDepot" />
- <DataColumn Index="7" DataSource="PurchaseSourceBillProduct.Quantity_OnShip" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if (Search("SearchFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if (Search("SearchPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if (Search("SearchNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if (Search("SearchLast", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- </Events>
- </IKFormToolBar>
- </Controls>
- <!--<LockInfomation LockID="ID_PurchaseOrderBill" LockNO="No_PurchaseOrderBill" LockSearchFunction="SearchPurchaseOrderBillWithNo" LockAudit="ID_Assessor"/>-->
- <LogInfomation LogNO="#PurchaseOrderBill.No_PurchaseOrderBill" RecordFormField="" RecordDataGridField="#PurchaseSourceBillProduct.No_Product,#PurchaseSourceBillProduct.Amount"/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PurchaseOrderBill" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPurchaseOrderBillWithNo">
- <DataColumn Index="0" MappingName="#PurchaseOrderBill.No_PurchaseOrderBill" HeaderText="采购订单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PurchaseOrderBill.Date_PurchaseOrderBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PurchaseOrderBill.ShortName_Supplier" HeaderText="供应商简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="PurchaseOrderBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 PurchaseOrderBill.*, No_Supplier, ShortName_Supplier, Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor"/>
- <New CmdType="Text" CmdText="
- IF(@Comment_EndCase != '')
- BEGIN
- INSERT INTO BillComment (ID_BillComment, ID_Bill, Comment_BillComment)
- VALUES(NEWID(),@ID_PurchaseOrderBill,@Comment_EndCase)
- END">
- <Params>
- <Param name="@ID_PurchaseOrderBill" type="PurchaseOrderBill.ID_PurchaseOrderBill" sourceColumn="ID_PurchaseOrderBill" />
- <Param name="@Comment_EndCase" type="PurchaseOrderBill.Comment_EndCase" sourceColumn="Comment_EndCase" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="
- UPDATE PurchaseOrderBill SET Comment_EndCase = @Comment_EndCase WHERE ID_PurchaseOrderBill = @ID_PurchaseOrderBill
- IF(@Comment_EndCase != '')
- BEGIN
- INSERT INTO BillComment (ID_BillComment, ID_Bill, Comment_BillComment)
- VALUES(NEWID(),@ID_PurchaseOrderBill,@Comment_EndCase)
- END">
- <Params>
- <Param name="@ID_PurchaseOrderBill" type="PurchaseOrderBill.ID_PurchaseOrderBill" sourceColumn="ID_PurchaseOrderBill" />
- <Param name="@Comment_EndCase" type="PurchaseOrderBill.Comment_EndCase" sourceColumn="Comment_EndCase" />
- </Params>
- </Update>
- </Table>
- <Table name="PurchaseSourceBillProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 PurchaseSourceBillProduct.*, CONVERT(DECIMAL(14,2),0) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product"/>
- <New CmdType="Text" CmdText="INSERT INTO PurchaseSourceBillProduct(ID_PurchaseSourceBillProduct, Quantity_Order, Quantity_InDepot, Quantity_OnShip, Quantity_EndCase,Date_EndCase)
- VALUES(@ID_PurchaseSourceBillProduct, @Quantity_Order, @Quantity_InDepot, @Quantity_OnShip, @Quantity_EndCase,GetDate())
- ">
- <Params>
- <Param name="@ID_PurchaseSourceBillProduct" type="PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct" sourceColumn="ID_PurchaseSourceBillProduct" />
- <Param name="@Quantity_Order" type="PurchaseSourceBillProduct.Quantity_Order" sourceColumn="Quantity_Order" />
- <Param name="@Quantity_InDepot" type="PurchaseSourceBillProduct.Quantity_InDepot" sourceColumn="Quantity_InDepot" />
- <Param name="@Quantity_OnShip" type="PurchaseSourceBillProduct.Quantity_OnShip" sourceColumn="Quantity_OnShip" />
- <Param name="@Quantity_EndCase" type="PurchaseSourceBillProduct.Quantity_EndCase" sourceColumn="Quantity_EndCase" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="IF(0 > @Quantity_EndCase)
- BEGIN
- RAISERROR('该采购订单产品已全部结案,提交失败!',16,1)
- RETURN
- END
- UPDATE PurchaseSourceBillProduct SET Quantity_Order =@Quantity_Order, Quantity_InDepot =@Quantity_InDepot, Quantity_OnShip =@Quantity_OnShip, Quantity_EndCase =@Quantity_EndCase,Date_EndCase = GetDate()
- WHERE ID_PurchaseSourceBillProduct =@ID_PurchaseSourceBillProduct">
- <Params>
- <Param name="@ID_PurchaseSourceBillProduct" type="PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct" sourceColumn="ID_PurchaseSourceBillProduct" />
- <Param name="@Quantity_Order" type="PurchaseSourceBillProduct.Quantity_Order" sourceColumn="Quantity_Order" />
- <Param name="@Quantity_InDepot" type="PurchaseSourceBillProduct.Quantity_InDepot" sourceColumn="Quantity_InDepot" />
- <Param name="@Quantity_OnShip" type="PurchaseSourceBillProduct.Quantity_OnShip" sourceColumn="Quantity_OnShip" />
- <Param name="@Quantity_EndCase" type="PurchaseSourceBillProduct.Quantity_EndCase" sourceColumn="Quantity_EndCase" />
- </Params>
- </Update>
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText=" SELECT PurchaseOrderBill.*,a.Name_User As Creator,b.Name_User As Assessor,c.Name_User As LastModUser,No_Supplier,Name_Supplier=CASE ISNULL(Supplier.SuspendDate_Supplier,0) WHEN 0 THEN Name_Supplier ELSE Name_Supplier+'(已暂停!)'END, ShortName_Supplier,RegistedAddress_Supplier,PostalCode_Supplier,Name_Location,No_Location,EmpA.No_Employee,EmpB.No_Employee As No_Linkman,convert(decimal(18,6),'0.00') As MoneySum,convert(decimal(18,6),'0.00') As TaxSum
- FROM PurchaseOrderBill
- LEFT JOIN AppUser a ON a.ID_User=PurchaseOrderBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User=PurchaseOrderBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User=PurchaseOrderBill.LastModUser_PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier=PurchaseOrderBill.ID_Supplier
- LEFT JOIN Location ON Location.ID_Location=PurchaseOrderBill.ID_Location
- LEFT JOIN Employee EmpA ON EmpA.ID_Employee=PurchaseOrderBill.ID_Principal
- LEFT JOIN Employee EmpB ON EmpB.Name_Employee=PurchaseOrderBill.Name_Linkman
- WHERE Disable_PurchaseOrderBill = 0">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchPurchaseOrderBill CmdType="Text" CmdText="SELECT * FROM PurchaseOrderBill WHERE No_PurchaseOrderBill = @No_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="123" />
- </Tables>
- </SearchPurchaseOrderBill>
- <SearchPurchaseOrderBillWithNo CmdType="Text" CmdText="DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @No_PurchaseOrderBill AND ID_Assessor IS NOT NULL
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier,Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @No_PurchaseOrderBill AND ID_Assessor IS NOT NULL
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchPurchaseOrderBillWithNo>
- <SearchPurchaseOrderBillNoAssess CmdType="Text" CmdText="DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @No_PurchaseOrderBill
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier,Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @No_PurchaseOrderBill
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchPurchaseOrderBillNoAssess>
- <SearchFirst CmdType="Text" CmdText="DECLARE @NextNo Nvarchar(64)
- SELECT TOP 1 @NextNo = PurchaseOrderBill.No_PurchaseOrderBill FROM PurchaseOrderBill ORDER BY PurchaseOrderBill.No_PurchaseOrderBill
- DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier, Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchFirst>
- <SearchPrevious CmdType="Text" CmdText="DECLARE @NextNo Nvarchar(64)
- SELECT TOP 1 @NextNo = PurchaseOrderBill.No_PurchaseOrderBill FROM PurchaseOrderBill WHERE No_PurchaseOrderBill < @No_PurchaseOrderBill ORDER BY PurchaseOrderBill.No_PurchaseOrderBill DESC
- DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier,Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchPrevious>
- <SearchNext CmdType="Text" CmdText="DECLARE @NextNo Nvarchar(64)
- SELECT TOP 1 @NextNo = PurchaseOrderBill.No_PurchaseOrderBill FROM PurchaseOrderBill WHERE No_PurchaseOrderBill > @No_PurchaseOrderBill ORDER BY PurchaseOrderBill.No_PurchaseOrderBill
- DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier,Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchNext>
- <SearchLast CmdType="Text" CmdText="DECLARE @NextNo Nvarchar(64)
- SELECT TOP 1 @NextNo = PurchaseOrderBill.No_PurchaseOrderBill FROM PurchaseOrderBill ORDER BY PurchaseOrderBill.No_PurchaseOrderBill DESC
- DECLARE @ID_PurchaseOrderBill UNIQUEIDENTIFIER
- SELECT @ID_PurchaseOrderBill = ID_PurchaseOrderBill FROM PurchaseOrderBill
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseOrderBill.*, No_Supplier, ShortName_Supplier,Name_User AS Assessor From PurchaseOrderBill
- LEFT JOIN Supplier ON Supplier.ID_Supplier = PurchaseOrderBill.ID_Supplier
- LEFT JOIN AppUser ON AppUser.ID_User = PurchaseOrderBill.ID_Assessor
- WHERE No_PurchaseOrderBill = @NextNo
- SELECT PurchaseSourceBillProduct.*, (Quantity_Order-Quantity_EndCase-Quantity_InDepot-Quantity_OnShip) AS Amount,Product.ID_Product, No_Product,Name_Product FROM PurchaseSourceBillProduct
- LEFT JOIN PurchaseOrderBillProduct ON PurchaseOrderBillProduct.ID_PurchaseOrderBillProduct = PurchaseSourceBillProduct.ID_PurchaseSourceBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- LEFT JOIN PurchaseOrderBill ON PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE PurchaseOrderBill.ID_PurchaseOrderBill = @ID_PurchaseOrderBill">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill" />
- <Table name="PurchaseSourceBillProduct" />
- </Tables>
- </SearchLast>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly = false;
- refNo.ReadOnly = true;
- dtDate.ReadOnly = true;
- dtArrivalDate.ReadOnly = true;
- txtSupplierNo.ReadOnly = true;
- txtSupplierName.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtComment.ReadOnly = true;
- ikDataGridEx1.ReadOnly = true;
- toolBar.EnableSubmit = false;
- #PurchaseOrderBill.Date_PurchaseOrderBill = DBNull();
- #PurchaseOrderBill.ArrivalDate_PurchaseOrderBill = DBNull();
- #PurchaseOrderBill.AssessDate_PurchaseOrderBill = DBNull();
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly = true;
- refNo.ReadOnly = true;
- dtDate.ReadOnly = true;
- dtArrivalDate.ReadOnly = true;
- txtSupplierNo.ReadOnly = true;
- txtSupplierName.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtComment.ReadOnly = false;
- ikDataGridEx1.ReadOnly = false;
- toolBar.EnableSubmit = true;
- ikDataGridEx1.AllowNew(true);
- ikDataGridEx1.AllowDelete(true);
- UpdateForm(true, "");
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly = true;
- refNo.ReadOnly = true;
- dtDate.ReadOnly = true;
- dtArrivalDate.ReadOnly = true;
- txtSupplierNo.ReadOnly = true;
- txtSupplierName.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtComment.ReadOnly = true;
- ikDataGridEx1.ReadOnly = true;
- toolBar.EnableSubmit = false;
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly = true;
- refNo.ReadOnly = true;
- dtDate.ReadOnly = true;
- dtArrivalDate.ReadOnly = true;
- txtSupplierNo.ReadOnly = true;
- txtSupplierName.ReadOnly = true;
- txtAssessor.ReadOnly = true;
- dtAssessDate.ReadOnly = true;
- txtComment.ReadOnly = false;
- ikDataGridEx1.ReadOnly = false;
- toolBar.EnableSubmit = true;
- ikDataGridEx1.AllowNew(false);
- ikDataGridEx1.AllowDelete(false);
- UpdateForm(true, "");
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- UpdateForm(false, "");
- if((#PurchaseSourceBillProduct.Amount + #PurchaseSourceBillProduct.Quantity_EndCase + #PurchaseSourceBillProduct.Quantity_InDepot + #PurchaseSourceBillProduct.Quantity_OnShip)>#PurchaseSourceBillProduct.Quantity_Order)
- {
- MessageBox("强制结案数量大于可结案数量(订单数量-已结案-已入库-在途),提交失败!",@Title);
- return;
- }
- SuspendLayout();
- for(@i=0;@i<RowCount("#PurchaseSourceBillProduct");@i=@i+1)
- {
- SetPosition("#PurchaseSourceBillProduct",@i);
- if(#PurchaseSourceBillProduct.Amount < 0 )
- {
- ikDataGridEx1.CurrentRowIndex=@i;
- MessageBox("强制结案数量不得小于0!",@Title);
- ikDataGridEx1.Focus();
- ResumeLayout();
- return;
- }
- #PurchaseSourceBillProduct.Quantity_EndCase = #PurchaseSourceBillProduct.Quantity_EndCase + #PurchaseSourceBillProduct.Amount;
- }
- ResumeLayout();
- Update();
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|