123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmStocktakingBill">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="盘库作业";
- GetSchema();
- @SetFlag1=1;
- dgProduct.NoMember="No_StocktakingBillProduct";
-
- Search("SearchStockQty",DBNull(),DBNull());
- Search("SearchProductStocks",DBNull(),DBNull());
- Search("SearchNo_Product","p");
- Search("SearchLocationByNo","p");
- Search("SearchOneLocation","p","p");
-
- dgProduct.ColumnVisibleByColumnName("UnitPrice_StocktakingBillProduct",!GetFieldRight(@Title,"单价","查看"));
- 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>
- <IKDateTimePicker name="timeMake" DataSource="StocktakingBill.Date_StocktakingBill"/>
- <IKTextButton name="tbNo" DataSource="StocktakingBill.No_StocktakingBill">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchStocktakingBillWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- MessageBox("该盘库单不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入盘库单号!", @Title);
-
- }
- }
- ]]>
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbNo",tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbLocation" DisplaySource="StocktakingBill.Name_Location" NoSource="StocktakingBill.No_Location" ValueSource="StocktakingBill.ID_Location" DataSource="Location" DisplayMember="Name_Location" NoMember="No_Location" ValueMember="ID_Location">
- <Events>
- <Reload>
- UpdateForm(false, "cbLocation");
- Search("SearchLocation");
- UpdateForm(true, "cbLocation");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtMaker" DataSource="StocktakingBill.Name_Creator"/>
- <IKTextBox name="txtAssessor" DataSource="StocktakingBill.Name_Assessor"/>
- <IKDateTimeText name="dtAssessDate" DataSource="StocktakingBill.AssessDate_StocktakingBill"/>
- <IKTextBox name="txtComment" DataSource="StocktakingBill.Comment_StocktakingBill"/>
- <IKDataGridEx name="dgProduct" DataSource="StocktakingBillProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="StocktakingBillProduct.No_StocktakingBillProduct"/>
- <DataColumn Index="1" DataSource="StocktakingBillProduct.No_Product" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- ShowSearchBox("ProductSearch","INFOMATION",#StocktakingBillProduct.No_Product);
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="2" DataSource="StocktakingBillProduct.Name_Product"/>
- <DataColumn Index="3" DataSource="StocktakingBillProduct.No_Location" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag1=1;
- @LocationNo = ShowSearchBox("LocationSearch","INFOMATION",#StocktakingBillProduct.No_Location);
- if(@LocationNo != "")
- #StocktakingBillProduct.No_Location = @LocationNo;
- </Click>
- <SetFlagBeforeClick>
- @SetFlag1=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="4" DataSource="StocktakingBillProduct.Name_Location" />
- <DataColumn Index="5" DataSource="StocktakingBillProduct.StockQty_StocktakingBillProduct"/>
- <DataColumn Index="6" DataSource="StocktakingBillProduct.Quantity_StocktakingBillProduct"/>
- <DataColumn Index="7" DataSource="StocktakingBillProduct.Unit_Product" />
- <DataColumn Index="8" DataSource="StocktakingBillProduct.Account" />
- <DataColumn Index="9" DataSource="StocktakingBillProduct.UnitPrice_StocktakingBillProduct" />
- <DataColumn Index="10" DataSource="StocktakingBillProduct.Comment_StocktakingBillProduct" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchStocktakingBillFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchStocktakingBillPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchStocktakingBillNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchStocktakingBillLast", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- @NewNumber=GetNextAutoNumber(true);
- if(@NewNumber != "")
- {
- ChangeMode("New");
- tbNo.CValue=@NewNumber;
- }
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- ShowPrintBox("BillSearch",#StocktakingBill.No_StocktakingBill,#StocktakingBill.No_StocktakingBill,GetFieldRight(@Title,"单价","查看"));
- </ClickPrint>
- <ClickAudit>
- <![CDATA[
- BeginAudit();
- #StocktakingBill.ID_Assessor = GetLoginUserID();
- #StocktakingBill.Name_Assessor = GetCurrentUser();
- #StocktakingBill.AssessDate_StocktakingBill = DateTimeNow();
- Audit();
- ChangeMode("View");
- EndAudit();
- ]]>
- </ClickAudit>
- <ClickUnAudit>
- <![CDATA[
- BeginUnAudit();
- #StocktakingBill.ID_Assessor = DBNull();
- #StocktakingBill.Name_Assessor = "";
- UnAudit();
- ChangeMode("View");
- EndUnAudit();
- ]]>
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- <ClickImportItem>
- ;
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- </ClickImportItem>
- <ClickExportItem>
- if(toolBar.MenuItemText=="库存异动作业")
- {
- ExportBillProductStart("#ModifyDepotBillProduct.Type_FromBill",4,"#ModifyDepotBillProduct.SourceBillName_ModifyDepotBillProduct","盘库单","#ModifyDepotBillProduct.No_FromBill",#StocktakingBill.No_StocktakingBill,"#ModifyDepotBill.ChangedDepot_ModifyDepotBill",#StocktakingBill.Name_Location);
- ExportBillProduct("dgProduct","#StocktakingBillProduct","#ModifyDepotBillProduct.No_FromBillProduct","#StocktakingBillProduct.No_StocktakingBillProduct");
- }
- <!--初始化目标数据-->
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- </ClickExportItem>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="StocktakingBillProduct">
- <Events>
- <ColumnsChanged>
- <No_Product>
- <![CDATA[
- if(#StocktakingBillProduct.No_Product == "" || !Search("SearchNo_Product",#StocktakingBillProduct.No_Product))
- {
- if(#StocktakingBillProduct.No_Product != "")
- MessageBox("该产品不存在!",@Title);
- #StocktakingBillProduct.ID_Product = GuidEmpty();
- #StocktakingBillProduct.Unit_Product = "";
- #StocktakingBillProduct.Name_Product = "";
- #StocktakingBillProduct.UnitPrice_StocktakingBillProduct = 0.00;
- }
- else
- {
- if(!Equals(#NoProduct.SuspendDate_Product,DBNull()))
- {
- MessageBox("该产品已停用!",@Title);
- }
-
- #StocktakingBillProduct.ID_Product = #NoProduct.ID_Product;
- #StocktakingBillProduct.Unit_Product = #NoProduct.Unit_Product;
- #StocktakingBillProduct.Name_Product = #NoProduct.Name_Product;
- #StocktakingBillProduct.UnitPrice_StocktakingBillProduct = #NoProduct.Cost_Product;
- if( Search("SearchOneLocation",#StocktakingBillProduct.No_Product,GetCurrentDepot()))
- {
- #StocktakingBillProduct.No_Location = #OneLocation.No_Location;
- #StocktakingBillProduct.Name_Location = #OneLocation.Name_Location;
- #StocktakingBillProduct.ID_Location = #OneLocation.ID_Location;
- if(!Search("SearchStockQty",#StocktakingBillProduct.ID_Product,#StocktakingBillProduct.ID_Location))
- {
- #StocktakingBillProduct.StockQty_StocktakingBillProduct = 0.00;
- }
- else
- {
- #StocktakingBillProduct.StockQty_StocktakingBillProduct = #StockQty.StockQty_ProductStocks;
- }
- }
- }
- ]]>
- </No_Product>
- <Name_Location>
- <![CDATA[
- if(!Search("SearchStockQty",#StocktakingBillProduct.ID_Product,#StocktakingBillProduct.ID_Location))
- {
- #StocktakingBillProduct.StockQty_StocktakingBillProduct = 0.00;
- }
- else
- {
- #StocktakingBillProduct.StockQty_StocktakingBillProduct = #StockQty.StockQty_ProductStocks;
- }
- ]]>
- </Name_Location>
- <Quantity_StocktakingBillProduct>
- #StocktakingBillProduct.Account = #StocktakingBillProduct.Quantity_StocktakingBillProduct - #StocktakingBillProduct.StockQty_StocktakingBillProduct;
- </Quantity_StocktakingBillProduct>
- <StockQty_StocktakingBillProduct>
- #StocktakingBillProduct.Account = #StocktakingBillProduct.Quantity_StocktakingBillProduct - #StocktakingBillProduct.StockQty_StocktakingBillProduct;
- </StockQty_StocktakingBillProduct>
- <No_Location>
- if(@SetFlag1==0)
- {
- return;
- }
- if(#StocktakingBillProduct.No_Location != StringEmpty())
- {
- if(!Search("SearchLocationByNo", #StocktakingBillProduct.No_Location))
- {
- MessageBox("不存在此库位编号",@Title);
- #StocktakingBillProduct.ID_Location=GuidEmpty();
- #StocktakingBillProduct.Name_Location=StringEmpty();
- }
- else
- {
- #StocktakingBillProduct.ID_Location=#Location.ID_Location;
- #StocktakingBillProduct.Name_Location=#Location.Name_Location;
- if(Search("SearchProductStocks", #StocktakingBillProduct.ID_Product, #Location.ID_Location))
- #StocktakingBillProduct.StockQty_StocktakingBillProduct = #ProductStocks.StockQty_ProductStocks;
- }
- }
- </No_Location>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_StocktakingBill" LockNO="No_StocktakingBill" LockSearchFunction="SearchStocktakingBillWithNo" LockAudit="ID_Assessor"/>
- <LogInfomation LogNO="#StocktakingBill.No_StocktakingBill" RecordFormField="" RecordDataGridField=""/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="StocktakingBill" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchStocktakingBillWithNo">
- <DataColumn Index="0" MappingName="#StocktakingBill.No_StocktakingBill" HeaderText="盘库单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#StocktakingBill.Date_StocktakingBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#StocktakingBill.Name_Location" HeaderText="盘点仓库" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#StocktakingBill.Comment_StocktakingBill" HeaderText="备注" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品" ReturnDataSource="StocktakingBillProduct" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#StocktakingBillProduct.No_Product"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Product.Type_Product" HeaderText="产品大类" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Product.Name_Location" HeaderText="所在库位" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#Product.Unit_Product" HeaderText="基本单位" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#Product.Suspend" HeaderText="暂停使用" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="LocationSearch" DataSource="Location" SearchFunction="SearchAllLocation" SearchFunctionByNo="" MappingName="库位" ReturnDataSource="StocktakingBillProduct" ShowCheckBox="false">
- <DataColumn Index="0" MappingName="#Location.No_Location" HeaderText="库位编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#StocktakingBillProduct.No_Location" />
- <DataColumn Index="1" MappingName="#Location.Name_Location" HeaderText="库位名称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="StocktakingBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location "/>
- <New CmdType="Text" CmdText="INSERT INTO StocktakingBill(ID_StocktakingBill,
- No_StocktakingBill,
- Date_StocktakingBill,
- ID_Location,
- ID_Creator,
- ID_Assessor,
- AssessDate_StocktakingBill,
- Comment_StocktakingBill,
- CreateDate_StocktakingBill,
- LastModUser_StocktakingBill,
- LastModDate_StocktakingBill
- )
- VALUES(@ID_StocktakingBill,
- @No_StocktakingBill,
- @Date_StocktakingBill,
- @ID_Location,
- @ID_Creator,
- @ID_Assessor,
- @AssessDate_StocktakingBill,
- @Comment_StocktakingBill,
- @CreateDate_StocktakingBill,
- @LastModUser_StocktakingBill,
- @LastModDate_StocktakingBill
- ) ">
- <Params>
- <Param name="@ID_StocktakingBill" type="StocktakingBill.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" sourceColumn="No_StocktakingBill" />
- <Param name="@Date_StocktakingBill" type="StocktakingBill.Date_StocktakingBill" sourceColumn="Date_StocktakingBill" />
- <Param name="@ID_Location" type="StocktakingBill.ID_Location" sourceColumn="ID_Location" />
- <Param name="@ID_Creator" type="StocktakingBill.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@ID_Assessor" type="StocktakingBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_StocktakingBill" type="StocktakingBill.AssessDate_StocktakingBill" sourceColumn="AssessDate_StocktakingBill" />
- <Param name="@Comment_StocktakingBill" type="StocktakingBill.Comment_StocktakingBill" sourceColumn="Comment_StocktakingBill" />
- <Param name="@CreateDate_StocktakingBill" type="StocktakingBill.CreateDate_StocktakingBill" sourceColumn="CreateDate_StocktakingBill" />
- <Param name="@LastModUser_StocktakingBill" type="StocktakingBill.LastModUser_StocktakingBill" sourceColumn="LastModUser_StocktakingBill" />
- <Param name="@LastModDate_StocktakingBill" type="StocktakingBill.LastModDate_StocktakingBill" sourceColumn="LastModDate_StocktakingBill" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE StocktakingBill
- SET No_StocktakingBill = @No_StocktakingBill,
- Date_StocktakingBill = @Date_StocktakingBill,
- ID_Location = @ID_Location,
- ID_Creator = @ID_Creator,
- ID_Assessor = @ID_Assessor,
- AssessDate_StocktakingBill = @AssessDate_StocktakingBill,
- Comment_StocktakingBill = @Comment_StocktakingBill,
- CreateDate_StocktakingBill = @CreateDate_StocktakingBill,
- LastModUser_StocktakingBill = @LastModUser_StocktakingBill,
- LastModDate_StocktakingBill = @LastModDate_StocktakingBill
- WHERE ID_StocktakingBill = @ID_StocktakingBill ">
-
- <Params>
- <Param name="@ID_StocktakingBill" type="StocktakingBill.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" sourceColumn="No_StocktakingBill" />
- <Param name="@Date_StocktakingBill" type="StocktakingBill.Date_StocktakingBill" sourceColumn="Date_StocktakingBill" />
- <Param name="@ID_Location" type="StocktakingBill.ID_Location" sourceColumn="ID_Location" />
- <Param name="@ID_Creator" type="StocktakingBill.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@ID_Assessor" type="StocktakingBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_StocktakingBill" type="StocktakingBill.AssessDate_StocktakingBill" sourceColumn="AssessDate_StocktakingBill" />
- <Param name="@Comment_StocktakingBill" type="StocktakingBill.Comment_StocktakingBill" sourceColumn="Comment_StocktakingBill" />
- <Param name="@CreateDate_StocktakingBill" type="StocktakingBill.CreateDate_StocktakingBill" sourceColumn="CreateDate_StocktakingBill" />
- <Param name="@LastModUser_StocktakingBill" type="StocktakingBill.LastModUser_StocktakingBill" sourceColumn="LastModUser_StocktakingBill" />
- <Param name="@LastModDate_StocktakingBill" type="StocktakingBill.LastModDate_StocktakingBill" sourceColumn="LastModDate_StocktakingBill" />
- </Params>
- </Update>
- <Audit CmdType="Text" CmdText=" UPDATE StocktakingBill SET
- ID_Assessor=@ID_Assessor,
- AssessDate_StocktakingBill=@AssessDate_StocktakingBill
- WHERE ID_StocktakingBill=@ID_StocktakingBill">
- <Params>
- <Param name="@ID_StocktakingBill" type="StocktakingBill.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" sourceColumn="No_StocktakingBill" />
- <Param name="@ID_Assessor" type="StocktakingBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_StocktakingBill" type="StocktakingBill.AssessDate_StocktakingBill" sourceColumn="AssessDate_StocktakingBill" />
- </Params>
- </Audit>
- <Delete CmdType="Text" CmdText="DELETE StocktakingBillProduct WHERE StocktakingBillProduct.ID_StocktakingBill = @ID_StocktakingBill
- DELETE StocktakingBill WHERE StocktakingBill.ID_StocktakingBill = @ID_StocktakingBill">
- <Params>
- <Param name="@ID_StocktakingBill" type="StocktakingBill.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="本记录被其他单据使用过,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="销货出库单号已存在,提交失败!"/>
- </Table>
- <Table name="StocktakingBillProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 StocktakingBillProduct.*,convert(decimal(14,2),0) as Account, '' as No_StocktakingBill,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location, Location.ID_Location
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location "/>
- <New CmdType="Text" CmdText="INSERT INTO StocktakingBillProduct(ID_StocktakingBillProduct,
- No_StocktakingBillProduct,
- ID_StocktakingBill,
- ID_Product,
- ID_Location,
- StockQty_StocktakingBillProduct,
- Quantity_StocktakingBillProduct,
- UnitPrice_StocktakingBillProduct,
- Comment_StocktakingBillProduct
- )
- VALUES(@ID_StocktakingBillProduct,
- @No_StocktakingBillProduct,
- @ID_StocktakingBill,
- @ID_Product,
- @ID_Location,
- @StockQty_StocktakingBillProduct,
- @Quantity_StocktakingBillProduct,
- @UnitPrice_StocktakingBillProduct,
- @Comment_StocktakingBillProduct)" >
-
- <Params>
- <Param name="@ID_StocktakingBillProduct" type="StocktakingBillProduct.ID_StocktakingBillProduct" sourceColumn="ID_StocktakingBillProduct" />
- <Param name="@No_StocktakingBillProduct" type="StocktakingBillProduct.No_StocktakingBillProduct" sourceColumn="No_StocktakingBillProduct" />
- <Param name="@ID_StocktakingBill" type="StocktakingBillProduct.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- <Param name="@ID_Product" type="StocktakingBillProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@ID_Location" type="StocktakingBillProduct.ID_Location" sourceColumn="ID_Location" />
- <Param name="@StockQty_StocktakingBillProduct" type="StocktakingBillProduct.StockQty_StocktakingBillProduct" sourceColumn="StockQty_StocktakingBillProduct" />
- <Param name="@Quantity_StocktakingBillProduct" type="StocktakingBillProduct.Quantity_StocktakingBillProduct" sourceColumn="Quantity_StocktakingBillProduct" />
- <Param name="@UnitPrice_StocktakingBillProduct" type="StocktakingBillProduct.UnitPrice_StocktakingBillProduct" sourceColumn="UnitPrice_StocktakingBillProduct" />
- <Param name="@Comment_StocktakingBillProduct" type="StocktakingBillProduct.Comment_StocktakingBillProduct" sourceColumn="Comment_StocktakingBillProduct" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE StocktakingBillProduct
- SET No_StocktakingBillProduct = @No_StocktakingBillProduct ,
- ID_StocktakingBill = @ID_StocktakingBill ,
- ID_Product = @ID_Product ,
- ID_Location = @ID_Location ,
- StockQty_StocktakingBillProduct = @StockQty_StocktakingBillProduct ,
- Quantity_StocktakingBillProduct = @Quantity_StocktakingBillProduct ,
- UnitPrice_StocktakingBillProduct = @UnitPrice_StocktakingBillProduct ,
- Comment_StocktakingBillProduct = @Comment_StocktakingBillProduct
- WHERE ID_StocktakingBillProduct = @ID_StocktakingBillProduct " >
-
- <Params>
- <Param name="@ID_StocktakingBillProduct" type="StocktakingBillProduct.ID_StocktakingBillProduct" sourceColumn="ID_StocktakingBillProduct" />
- <Param name="@No_StocktakingBillProduct" type="StocktakingBillProduct.No_StocktakingBillProduct" sourceColumn="No_StocktakingBillProduct" />
- <Param name="@ID_StocktakingBill" type="StocktakingBillProduct.ID_StocktakingBill" sourceColumn="ID_StocktakingBill" />
- <Param name="@ID_Product" type="StocktakingBillProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@ID_Location" type="StocktakingBillProduct.ID_Location" sourceColumn="ID_Location" />
- <Param name="@StockQty_StocktakingBillProduct" type="StocktakingBillProduct.StockQty_StocktakingBillProduct" sourceColumn="StockQty_StocktakingBillProduct" />
- <Param name="@Quantity_StocktakingBillProduct" type="StocktakingBillProduct.Quantity_StocktakingBillProduct" sourceColumn="Quantity_StocktakingBillProduct" />
- <Param name="@UnitPrice_StocktakingBillProduct" type="StocktakingBillProduct.UnitPrice_StocktakingBillProduct" sourceColumn="UnitPrice_StocktakingBillProduct" />
- <Param name="@Comment_StocktakingBillProduct" type="StocktakingBillProduct.Comment_StocktakingBillProduct" sourceColumn="Comment_StocktakingBillProduct" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE StocktakingBillProduct WHERE StocktakingBillProduct.ID_StocktakingBillProduct = @ID_StocktakingBillProduct">
- <Params>
- <Param name="@ID_StocktakingBillProduct" type="StocktakingBillProduct.ID_StocktakingBillProduct" sourceColumn="ID_StocktakingBillProduct" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchStocktakingBillWithNo CmdType="Text" CmdText=" DECLARE @ID_StocktakingBill uniqueidentifier
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- WHERE StocktakingBill.No_StocktakingBill = @No_StocktakingBill
- SELECT @ID_StocktakingBill = StocktakingBill.ID_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill = @No_StocktakingBill
- SELECT StocktakingBillProduct.*,convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location,Location.ID_Location,@No_StocktakingBill as No_StocktakingBill
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
- WHERE StocktakingBillProduct.ID_StocktakingBill=@ID_StocktakingBill
- order by CAST(No_StocktakingBillProduct AS INT)">
-
-
- <Params>
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" Index="0" />
- </Params>
- <Tables>
- <Table name="StocktakingBill" />
- <Table name="StocktakingBillProduct" />
- </Tables>
- </SearchStocktakingBillWithNo>
- <SearchNo_Product CmdType="Text" CmdText=" SELECT Product.ID_Product, Product.No_Product,Product.Name_Product,
- Product.SuspendDate_Product, Product.Unit_Product,
- Product.Cost_Product,AvailableQty_ProductStocks,Cost_Product
- FROM Product WHERE Product.No_Product=@No_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="NoProduct" />
- </Tables>
- </SearchNo_Product>
- <SearchProductStocks CmdType="Text" CmdText="SELECT StockQty_ProductStocks FROM ProductStocks WHERE ID_Product=@ID_Product AND
- ID_Location=@ID_Location">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" Index="0" />
- <Param name="@ID_Location" type="Location.ID_Location" Index="1" />
- </Params>
- <Tables>
- <Table name="ProductStocks" />
- </Tables>
- </SearchProductStocks>
- <SearchLocationByNo CmdType="Text" CmdText="SELECT ID_Location, Name_Location FROM Location WHERE No_Location=@No_Location
- ">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" Index="0" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationByNo>
- <SearchAllLocation CmdType="Text" CmdText="SELECT No_Location,Name_Location FROM Location ">
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchAllLocation>
- <SearchAllBill CmdType="Text" CmdText=" SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location ">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchLocation CmdType="Text" CmdText="SELECT Name_Location,ID_Location,No_Location FROM Location WHERE Level_Location=0">
-
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocation>
- <SearchProductLocation CmdType="Text" CmdText=" SELECT Name_Location,ID_Location FROM Location WHERE ID_Warehouse=@ID_Location AND LowestLevel_Location=1">
-
- <Params>
- <Param name="@ID_Location" type="Location.ID_Location" Index="0" />
- </Params>
- <Tables>
- <Table name="ProductLocationFromWarehouse" />
- </Tables>
- </SearchProductLocation>
- <SearchStocktakingBillFirst CmdType="Text" CmdText="DECLARE @StocktakingBillNo nvarchar(64)
- SELECT TOP 1 @StocktakingBillNo = StocktakingBill.No_StocktakingBill FROM StocktakingBill ORDER BY StocktakingBill.No_StocktakingBill
-
- DECLARE @ID_StocktakingBill uniqueidentifier
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT @ID_StocktakingBill = StocktakingBill.ID_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT StocktakingBillProduct.*,convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location,Location.ID_Location,@StocktakingBillNo as No_StocktakingBill
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
- WHERE StocktakingBillProduct.ID_StocktakingBill=@ID_StocktakingBill
- order by CAST(No_StocktakingBillProduct AS INT)">
- <Tables>
- <Table name="StocktakingBill" />
- <Table name="StocktakingBillProduct" />
- </Tables>
- </SearchStocktakingBillFirst>
- <SearchStocktakingBillPrevious CmdType="Text" CmdText="DECLARE @StocktakingBillNo nvarchar(64)
- SELECT TOP 1 @StocktakingBillNo = StocktakingBill.No_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill < @No_StocktakingBill ORDER BY StocktakingBill.No_StocktakingBill DESC
-
- DECLARE @ID_StocktakingBill uniqueidentifier
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT @ID_StocktakingBill = StocktakingBill.ID_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT StocktakingBillProduct.*,convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location,Location.ID_Location,@StocktakingBillNo as No_StocktakingBill
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
- WHERE StocktakingBillProduct.ID_StocktakingBill=@ID_StocktakingBill
- order by CAST(No_StocktakingBillProduct AS INT)">
- <Params>
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" Index="0" />
- </Params>
- <Tables>
- <Table name="StocktakingBill" />
- <Table name="StocktakingBillProduct" />
- </Tables>
- </SearchStocktakingBillPrevious>
- <SearchStocktakingBillNext CmdType="Text" CmdText="DECLARE @StocktakingBillNo nvarchar(64)
- SELECT TOP 1 @StocktakingBillNo = StocktakingBill.No_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill > @No_StocktakingBill ORDER BY StocktakingBill.No_StocktakingBill
-
- DECLARE @ID_StocktakingBill uniqueidentifier
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT @ID_StocktakingBill = StocktakingBill.ID_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT StocktakingBillProduct.*,convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location,Location.ID_Location,@StocktakingBillNo as No_StocktakingBill
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
- WHERE StocktakingBillProduct.ID_StocktakingBill=@ID_StocktakingBill
- order by CAST(No_StocktakingBillProduct AS INT)">
- <Params>
- <Param name="@No_StocktakingBill" type="StocktakingBill.No_StocktakingBill" Index="0" />
- </Params>
- <Tables>
- <Table name="StocktakingBill" />
- <Table name="StocktakingBillProduct" />
- </Tables>
- </SearchStocktakingBillNext>
- <SearchStocktakingBillLast CmdType="Text" CmdText="DECLARE @StocktakingBillNo nvarchar(64)
- SELECT TOP 1 @StocktakingBillNo = StocktakingBill.No_StocktakingBill FROM StocktakingBill ORDER BY StocktakingBill.No_StocktakingBill DESC
-
- DECLARE @ID_StocktakingBill uniqueidentifier
- SELECT StocktakingBill.*,a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location
- FROM StocktakingBill
- LEFT JOIN AppUser a ON a.ID_User = StocktakingBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = StocktakingBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = StocktakingBill.LastModUser_StocktakingBill
- LEFT JOIN Location ON Location.ID_Location = StocktakingBill.ID_Location
- WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT @ID_StocktakingBill = StocktakingBill.ID_StocktakingBill FROM StocktakingBill WHERE StocktakingBill.No_StocktakingBill = @StocktakingBillNo
- SELECT StocktakingBillProduct.*,convert(decimal(14,2),Quantity_StocktakingBillProduct - StockQty_StocktakingBillProduct) as Account,
- Product.No_Product,Product.Name_Product,Product.Unit_Product,
- Location.No_Location, Location.Name_Location,Location.ID_Location,@StocktakingBillNo as No_StocktakingBill
- FROM StocktakingBillProduct
- LEFT JOIN Product ON Product.ID_Product = StocktakingBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = StocktakingBillProduct.ID_Location
- WHERE StocktakingBillProduct.ID_StocktakingBill=@ID_StocktakingBill
- order by CAST(No_StocktakingBillProduct AS INT)">
- <Tables>
- <Table name="StocktakingBill" />
- <Table name="StocktakingBillProduct" />
- </Tables>
- </SearchStocktakingBillLast>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product,Product.Type_Product,B.Name_Location,Product.Unit_Product,Product.SuspendDate_Product, case isnull(Product.SuspendDate_Product,0) when 0 then '否' else '是' end as Suspend FROM Product
- LEFT JOIN ProductStocks ON ProductStocks.ID_Product = Product.ID_Product
- LEFT JOIN Location B ON ProductStocks.ID_Location = B.ID_Location
- ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchJudgeLocationAndWarehouse CmdType="Text" CmdText="SELECT Name_Location,ID_Location FROM Location WHERE ID_Warehouse=@ID_Warehouse AND ID_Location=@ID_Location and LowestLevel_Location=1">
- <Params>
- <Param name="@ID_Warehouse" type="Location.ID_Warehouse" Index="0" />
- <Param name="@ID_Location" type="Location.ID_Location" Index="1" />
- </Params>
- <Tables>
- <Table name="JudgeLocationAndWarehouse" />
- </Tables>
- </SearchJudgeLocationAndWarehouse>
- <SearchStockQty CmdType="Text" CmdText=" SELECT StockQty_ProductStocks FROM ProductStocks
- WHERE ProductStocks.ID_Product=@ID_Product AND ProductStocks.ID_Location=@ID_Location">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" Index="0" />
- <Param name="@ID_Location" type="Product.ID_Location" Index="1" />
- </Params>
- <Tables>
- <Table name="StockQty" />
- </Tables>
- </SearchStockQty>
- <SearchOneLocation CmdType="" CmdText="Select Top 1 B.ID_Location,B.No_Location,B.Name_Location From Location B
- inner join Location C on B.ID_Warehouse = C.ID_Location
- Left Join ProductStocks On ProductStocks.ID_Location = B.ID_Location
- Left Join Product On Product.ID_Product = ProductStocks.ID_Product
- Where C.Name_Location = @Name_Location And B.LowestLevel_Location =1 And No_Product= @No_Product
- And Mark_ProductStocks = 1
- Order By B.No_Location">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- <Param name="@Name_Location" type="Location.Name_Location" Index="1" />
- </Params>
- <Tables>
- <Table name="OneLocation" />
- </Tables>
- </SearchOneLocation>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- timeMake.Enabled =false;
- txtComment.ReadOnly =true;
- tbNo.ReadOnly =false;
- cbLocation.Enabled =false;
- dgProduct.ReadOnly =true;
- toolBar.EnableSubmit =false;
- toolBar.EnableModify =false;
- toolBar.EnableDelete =false;
- toolBar.EnableAudit =false;
- toolBar.EnableUnAudit =false;
- toolBar.EnableNew =GetRight(@Title,"新增");
- toolBar.EnablePrint =false;
- toolBar.EnableExport = false;
- #StocktakingBill.AssessDate_StocktakingBill =DBNull();
- #StocktakingBill.ID_Assessor =DBNull();
- #StocktakingBill.ID_Creator =DBNull();
- #StocktakingBill.LastModUser_StocktakingBill =DBNull();
- #StocktakingBill.LastModDate_StocktakingBill =DBNull();
- UpdateForm(true,"");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- timeMake.Enabled =true;
- txtComment.ReadOnly =false;
- tbNo.ReadOnly =true;
- cbLocation.Enabled =true;
- dgProduct.ReadOnly =false;
- toolBar.EnableSubmit =GetRight(@Title,"新增");
- toolBar.EnableModify =false;
- toolBar.EnableDelete =false;
- toolBar.EnableAudit =false;
- toolBar.EnableUnAudit =false;
- toolBar.EnableNew =false;
- toolBar.EnablePrint =false;
- toolBar.EnableExport = false;
- #StocktakingBill.ID_StocktakingBill =NewGuid();
- #StocktakingBill.ID_Creator =GetLoginUserID();
- #StocktakingBill.Name_Creator =GetCurrentUser();
- #StocktakingBill.AssessDate_StocktakingBill =DBNull();
- #StocktakingBill.ID_Assessor =DBNull();
- #StocktakingBill.LastModUser_StocktakingBill =DBNull();
- #StocktakingBill.LastModUserName =DBNull();
- #StocktakingBill.LastModDate_StocktakingBill =DBNull();
- #StocktakingBill.ID_Location =GetCurrentDepotID();
- #StocktakingBill.Name_Location =GetCurrentDepot();
- #StocktakingBill.No_Location =GetCurrentDepotNo();
- #StocktakingBill.Date_StocktakingBill =GetCurrentTime();
- UpdateForm(true,"");
- timeMake.Focus();
- @Status=1;
- </New>
- <View>
- timeMake.Enabled =false;
- txtComment.ReadOnly =true;
- tbNo.ReadOnly =false;
- cbLocation.Enabled =false;
- dgProduct.ReadOnly =true;
- toolBar.EnableSubmit =false;
- toolBar.EnableNew =GetRight(@Title,"新增");
- if(Equals(#StocktakingBill.ID_Assessor, DBNull()))
- {
- toolBar.EnableUnAudit=false;
- toolBar.EnableAudit=GetRight(@Title,"审核");
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- }
- else
- {
- toolBar.EnableAudit=false;
- toolBar.EnableUnAudit=GetRight(@Title,"取消审核");
- toolBar.EnableDelete=false;
- toolBar.EnableModify=false;
- }
- toolBar.EnablePrint =GetRight(@Title,"打印");
- toolBar.EnableExport = true;
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- timeMake.Enabled =false;
- txtComment.ReadOnly =false;
- tbNo.ReadOnly =true;
- dgProduct.ReadOnly =false;
- cbLocation.Enabled =true;
- toolBar.EnableSubmit =GetRight(@Title,"修改");
- toolBar.EnableModify =false;
- toolBar.EnableDelete =false;
- toolBar.EnableAudit =false;
- toolBar.EnableUnAudit =false;
- toolBar.EnableNew =false;
- toolBar.EnablePrint =false;
- toolBar.EnableExport = false;
- #StocktakingBill.LastModUser_StocktakingBill =GetLoginUserID();
- #StocktakingBill.LastModUserName =GetCurrentUser();
- #StocktakingBill.LastModDate_StocktakingBill =DateTimeNow();
- UpdateForm(true, "");
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if (!cbLocation.CheckSelectedItem())
- {
- MessageBox("请选择有效的盘点仓库!",@Title);
- cbLocation.Focus();
- return;
- }
- if(RowCount("#StocktakingBillProduct")==0)
- {
- MessageBox("请输入盘点产品!",@Title);
- dgProduct.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- for (@i=0;@i<=RowCount("#StocktakingBillProduct")-1;@i=@i+1)
- {
- SetPosition("#StocktakingBillProduct", @i);
- if (Equals(#StocktakingBillProduct.No_Product,""))
- {
- dgProduct.CurrentRowIndex = @i;
- MessageBox("请输入产品编号!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(Equals(#StocktakingBillProduct.ID_Product,GuidEmpty()))
- {
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该产品不存在!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(Equals(#StocktakingBillProduct.ID_Location,DBNull()) || Equals(#StocktakingBillProduct.ID_Location,GuidEmpty()))
- {
- dgProduct.CurrentRowIndex = @i;
- MessageBox("请选择有效的库位!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(!Search("SearchJudgeLocationAndWarehouse",#StocktakingBill.ID_Location,#StocktakingBillProduct.ID_Location))
- {
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该库位不属于所选仓库,请重新选择!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if (Equals(#StocktakingBillProduct.ID_StocktakingBillProduct,GuidEmpty()))
- {
- #StocktakingBillProduct.ID_StocktakingBillProduct = NewGuid();
- }
- #StocktakingBillProduct.ID_StocktakingBill=#StocktakingBill.ID_StocktakingBill;
- }
- ResumeLayout();
- if(@Status == 1)
- {
- #StocktakingBill.CreateDate_StocktakingBill=DateTimeNow();
- #StocktakingBill.No_StocktakingBill = New("#StocktakingBill.No_StocktakingBill", timeMake.CValue);
- }
- else if(@Status == 3)
- {
- #StocktakingBill.LastModDate_StocktakingBill =DateTimeNow();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
-
-
-
-
-
-
-
-
-
-
|