123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmPurchaseCosting">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="成本核算";
- GetSchema();
- Search("SearchSystemSetting");
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- 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="PurchaseInDepotBill.No_PurchaseInDepotBill">
- <Events>
- <Enter>
- <![CDATA[
- Empty();
- NewInstance();
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchPurchaseInDepotBillWithNo", tbNo.CValue))
- {
- if (#PurchaseInDepotBill.CostVerify_PurchaseInDepotBill == true)
- {
- ChangeMode("View");
- }
- else
- {
- if (GetRight(@Title,"新增") != true)
- {
- MessageBox("您没有权限进行成本核算!",@Title);
- return;
- }
- ChangeMode("Modify");
- }
- }
- else
- {
- MessageBox("该入库单不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入入库单号!", @Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT","tbNo",tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtShortName" DataSource="PurchaseInDepotBill.EncasementNo_PurchaseInDepotBill"/>
- <IKTextBox name="txtAssessor" DataSource="PurchaseInDepotBill.Name_UserAudit"/>
- <IKDateTimeText name="dtAssessDate" DataSource="PurchaseInDepotBill.AssessDate_PurchaseInDepotBill"/>
- <IKTextBox name="txtComment" DataSource="PurchaseInDepotBill.Comment_PurchaseInDepotBill"/>
- <IKTextBox name="txtlastModUser" DataSource="PurchaseInDepotBill.Name_UserMod"/>
- <IKDateTimeText name="dtLastModDate" DataSource="PurchaseInDepotBill.CostingDate_PurchaseInDepotBill"/>
- <IKTextButton name="tbOutDepotBillNo" DataSource="PurchaseInDepotBill.InvoiceNo_PurchaseInDepotBill"/>
- <IKComboBoxEx name="cbCurrency" DisplaySource="PurchaseInDepotBill.Currency_PurchaseInDepotBill" DataSource="PurchaseInDepotBill"/>
- <IKNumericTextBox name="txtMoney" DataSource="PurchaseInDepotBill.GoodsAmount_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txttax" DataSource="PurchaseInDepotBill.TaxAmount_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtcount" DataSource="PurchaseInDepotBill.count"/>
- <IKNumericTextBox name="txtCustom" DataSource="PurchaseInDepotBill.Custom_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtAgent" DataSource="PurchaseInDepotBill.Agent_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtCarriage" DataSource="PurchaseInDepotBill.Carriage_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtHandling" DataSource="PurchaseInDepotBill.Handling_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtOthers" DataSource="PurchaseInDepotBill.Others_PurchaseInDepotBill">
- <Events>
- <Leave>
- UpdateForm(false,"");
- <Lable name="CountSum" />
- </Leave>
- </Events>
- </IKNumericTextBox>
- <IKNumericTextBox name="txtAllMoney" DataSource="PurchaseInDepotBill.Amount_PurchaseInDepotBill"/>
- <IKButton name="btnCostCounting">
- <Events>
- <Click>
- if (#PurchaseInDepotBill.Amount_PurchaseInDepotBill == 0 || SumOfCol("#PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct") == 0)
- {
- MessageBox("『金额总计/采购金额』数值有误,请确认货款、费用及产品采购单价是否已录入!",@Title);
- return;
- }
- <Lable name="CostCounting" />
- </Click>
- </Events>
- </IKButton>
- <IKDataGridEx name="dgProduct" DataSource="PurchaseInDepotBillProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PurchaseInDepotBillProduct.No_Product" />
- <DataColumn Index="1" DataSource="PurchaseInDepotBillProduct.Name_Product" />
- <DataColumn Index="2" DataSource="PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct" />
- <DataColumn Index="3" DataSource="PurchaseInDepotBillProduct.Unit_Product" />
- <DataColumn Index="4" DataSource="PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct" />
- <DataColumn Index="5" DataSource="PurchaseInDepotBillProduct.Money" />
- <DataColumn Index="6" DataSource="PurchaseInDepotBillProduct.Comment_PurchaseInDepotBillProduct" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- ;
- </ClickFirst>
- <ClickPrev>
- ;
- </ClickPrev>
- <ClickNext>
- ;
- </ClickNext>
- <ClickLast>
- ;
- </ClickLast>
- <ClickNew>
- ;
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- if (#PurchaseInDepotBill.Amount_PurchaseInDepotBill == 0 || SumOfCol("#PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct") == 0)
- {
- MessageBox("『金额总计/采购金额』数值有误,请确认货款、费用及产品采购单价是否已录入!",@Title);
- return;
- }
- if (MessageBox("该操作将更新库存成本单价,其后的入库业务都将以此成本核算。确定要提交数据吗?",@Title,MB_YESNO)==DialogResult("NO"))
- {
- return;
- }
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- ;
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="PurchaseInDepotBillProduct">
- <Events>
- <ColumnsChanged>
- <Cost_PurchaseInDepotBillProduct>
- #PurchaseInDepotBillProduct.Money = #PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct * #PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct;
- </Cost_PurchaseInDepotBillProduct>
- </ColumnsChanged>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_PurchaseInDepotBill" LockNO="No_PurchaseInDepotBill" LockSearchFunction="SearchPurchaseInDepotBillWithNo"/>
- <LogInfomation LogNO="#PurchaseInDepotBill.No_PurchaseInDepotBill" RecordFormField="采购入库单号:#PurchaseInDepotBill.No_PurchaseInDepotBill,发票号码:#PurchaseInDepotBill.InvoiceNo_PurchaseInDepotBill,金额总计:#PurchaseInDepotBill.Amount_PurchaseInDepotBill" RecordDataGridField=""/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PurchaseInDepotBill" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPurchaseInDepotBillWithNo">
- <DataColumn Index="0" MappingName="#PurchaseInDepotBill.No_PurchaseInDepotBill" HeaderText="采购入库单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PurchaseInDepotBill.Date_PurchaseInDepotBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PurchaseInDepotBill.CostVerify_PurchaseInDepotBill" HeaderText="已成本核算" Width="90" ColumnType="IKDataGridBoolColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="PurchaseInDepotBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PurchaseInDepotBill.*, a.Name_User as Name_UserAudit, b.Name_User as Name_UserMod, CONVERT(decimal(18,6),0) AS count
- FROM PurchaseInDepotBill
- LEFT JOIN AppUser a ON a.ID_User = PurchaseInDepotBill.ID_Assessor
- LEFT JOIN AppUser b ON b.ID_User = PurchaseInDepotBill.Creator_PurchaseInDepotBill"/>
- <Update CmdType="Text" CmdText=" DECLARE @ID_Assessor uniqueidentifier
- SELECT @ID_Assessor = PurchaseInDepotBill.ID_Assessor FROM PurchaseInDepotBill WHERE PurchaseInDepotBill.ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill
- IF (@ID_Assessor IS NULL)
- BEGIN
- RAISERROR('该采购入库单未经审核,不能进行成本核算!',16,1)
- RETURN
- END
- UPDATE PurchaseInDepotBill
- SET CostVerify_PurchaseInDepotBill = 1,
- Creator_PurchaseInDepotBill = @Creator_PurchaseInDepotBill,
- CostingDate_PurchaseInDepotBill = @CostingDate_PurchaseInDepotBill,
- InvoiceNo_PurchaseInDepotBill = @InvoiceNo_PurchaseInDepotBill,
- Currency_PurchaseInDepotBill = @Currency_PurchaseInDepotBill,
- GoodsAmount_PurchaseInDepotBill = @GoodsAmount_PurchaseInDepotBill,
- TaxAmount_PurchaseInDepotBill = @TaxAmount_PurchaseInDepotBill,
- Custom_PurchaseInDepotBill = @Custom_PurchaseInDepotBill,
- Agent_PurchaseInDepotBill = @Agent_PurchaseInDepotBill,
- Handling_PurchaseInDepotBill = @Handling_PurchaseInDepotBill,
- Carriage_PurchaseInDepotBill = @Carriage_PurchaseInDepotBill,
- Others_PurchaseInDepotBill = @Others_PurchaseInDepotBill,
- Amount_PurchaseInDepotBill = @Amount_PurchaseInDepotBill
- WHERE ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill">
- <Params>
- <Param name="@ID_PurchaseInDepotBill" type="PurchaseInDepotBill.ID_PurchaseInDepotBill" sourceColumn="ID_PurchaseInDepotBill"/>
- <Param name="@Creator_PurchaseInDepotBill" type="PurchaseInDepotBill.Creator_PurchaseInDepotBill" sourceColumn="Creator_PurchaseInDepotBill"/>
- <Param name="@CostingDate_PurchaseInDepotBill" type="PurchaseInDepotBill.CostingDate_PurchaseInDepotBill" sourceColumn="CostingDate_PurchaseInDepotBill"/>
- <Param name="@InvoiceNo_PurchaseInDepotBill" type="PurchaseInDepotBill.InvoiceNo_PurchaseInDepotBill" sourceColumn="InvoiceNo_PurchaseInDepotBill"/>
- <Param name="@Currency_PurchaseInDepotBill" type="PurchaseInDepotBill.Currency_PurchaseInDepotBill" sourceColumn="Currency_PurchaseInDepotBill"/>
- <Param name="@GoodsAmount_PurchaseInDepotBill" type="PurchaseInDepotBill.GoodsAmount_PurchaseInDepotBill" sourceColumn="GoodsAmount_PurchaseInDepotBill"/>
- <Param name="@TaxAmount_PurchaseInDepotBill" type="PurchaseInDepotBill.TaxAmount_PurchaseInDepotBill" sourceColumn="TaxAmount_PurchaseInDepotBill"/>
- <Param name="@Custom_PurchaseInDepotBill" type="PurchaseInDepotBill.Custom_PurchaseInDepotBill" sourceColumn="Custom_PurchaseInDepotBill"/>
- <Param name="@Agent_PurchaseInDepotBill" type="PurchaseInDepotBill.Agent_PurchaseInDepotBill" sourceColumn="Agent_PurchaseInDepotBill"/>
- <Param name="@Handling_PurchaseInDepotBill" type="PurchaseInDepotBill.Handling_PurchaseInDepotBill" sourceColumn="Handling_PurchaseInDepotBill"/>
- <Param name="@Carriage_PurchaseInDepotBill" type="PurchaseInDepotBill.Carriage_PurchaseInDepotBill" sourceColumn="Carriage_PurchaseInDepotBill"/>
- <Param name="@Others_PurchaseInDepotBill" type="PurchaseInDepotBill.Others_PurchaseInDepotBill" sourceColumn="Others_PurchaseInDepotBill"/>
- <Param name="@Amount_PurchaseInDepotBill" type="PurchaseInDepotBill.Amount_PurchaseInDepotBill" sourceColumn="Amount_PurchaseInDepotBill"/>
- </Params>
- </Update>
- </Table>
- <Table name="PurchaseInDepotBillProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 PurchaseInDepotBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product, CONVERT(decimal(18,6),0) AS Money
- FROM PurchaseInDepotBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseInDepotBillProduct.ID_Product"/>
-
- <Update CmdType="Text" CmdText=" UPDATE Product SET Product.Cost_Product = @Cost_PurchaseInDepotBillProduct WHERE Product.ID_Product = @ID_Product
- UPDATE PurchaseInDepotBillProduct SET PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct = @Cost_PurchaseInDepotBillProduct WHERE PurchaseInDepotBillProduct.ID_PurchaseInDepotBillProduct = @ID_PurchaseInDepotBillProduct">
- <Params>
- <Param name="@ID_PurchaseInDepotBillProduct" type="PurchaseInDepotBillProduct.ID_PurchaseInDepotBillProduct" sourceColumn="ID_PurchaseInDepotBillProduct"/>
- <Param name="@ID_Product" type="PurchaseInDepotBillProduct.ID_Product" sourceColumn="ID_Product"/>
- <Param name="@Cost_PurchaseInDepotBillProduct" type="PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct" sourceColumn="Cost_PurchaseInDepotBillProduct"/>
- </Params>
- </Update>
- </Table>
- </Tables>
- <Search>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchAllBill CmdType="Text" CmdText=" SELECT PurchaseInDepotBill.*, a.Name_User as Name_UserAudit, b.Name_User as Name_UserMod, CONVERT(decimal(18,6),0) AS count
- FROM PurchaseInDepotBill
- LEFT JOIN AppUser a ON a.ID_User = PurchaseInDepotBill.ID_Assessor
- LEFT JOIN AppUser b ON b.ID_User = PurchaseInDepotBill.Creator_PurchaseInDepotBill
- WHERE PurchaseInDepotBill.ID_Assessor is not null ">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchPurchaseInDepotBillWithNo CmdType="Text" CmdText=" DECLARE @ID_PurchaseInDepotBill uniqueidentifier
- DECLARE @CostVerify bit
- DECLARE @ID_Assessor uniqueidentifier
- SELECT @ID_PurchaseInDepotBill = ID_PurchaseInDepotBill, @CostVerify = CostVerify_PurchaseInDepotBill, @ID_Assessor = ID_Assessor FROM PurchaseInDepotBill WHERE No_PurchaseInDepotBill = @No_PurchaseInDepotBill
- IF (@CostVerify = 0 AND @ID_Assessor IS NULL)
- BEGIN
- RAISERROR('该采购入库单未经审核,不能进行成本核算!',16,1)
- RETURN
- END
- SELECT PurchaseInDepotBill.*, a.Name_User as Name_UserAudit, b.Name_User as Name_UserMod,
- CONVERT(decimal(18,6),PurchaseInDepotBill.GoodsAmount_PurchaseInDepotBill + PurchaseInDepotBill.TaxAmount_PurchaseInDepotBill) AS count
- FROM PurchaseInDepotBill
- LEFT JOIN AppUser a ON a.ID_User = PurchaseInDepotBill.ID_Assessor
- LEFT JOIN AppUser b ON b.ID_User = PurchaseInDepotBill.Creator_PurchaseInDepotBill
- WHERE PurchaseInDepotBill.ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill
- SELECT PurchaseInDepotBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- CONVERT(decimal(18,6),PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct * PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct) AS Money
- FROM PurchaseInDepotBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseInDepotBillProduct.ID_Product
- WHERE PurchaseInDepotBillProduct.ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill
- Order By Product.Name_Product ">
- <Params>
- <Param name="@No_PurchaseInDepotBill" type="PurchaseInDepotBill.No_PurchaseInDepotBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseInDepotBill" />
- <Table name="PurchaseInDepotBillProduct" />
- </Tables>
- </SearchPurchaseInDepotBillWithNo>
- <SearchPurchaseInDepotBillWithNonoVerify CmdType="Text" CmdText=" DECLARE @ID_PurchaseInDepotBill uniqueidentifier
- DECLARE @CostVerify bit
- DECLARE @ID_Assessor uniqueidentifier
- SELECT @ID_PurchaseInDepotBill = ID_PurchaseInDepotBill FROM PurchaseInDepotBill WHERE No_PurchaseInDepotBill = @No_PurchaseInDepotBill
-
- SELECT PurchaseInDepotBill.*, a.Name_User as Name_UserAudit, b.Name_User as Name_UserMod,
- CONVERT(decimal(18,6),PurchaseInDepotBill.GoodsAmount_PurchaseInDepotBill + PurchaseInDepotBill.TaxAmount_PurchaseInDepotBill) AS count
- FROM PurchaseInDepotBill
- LEFT JOIN AppUser a ON a.ID_User = PurchaseInDepotBill.ID_Assessor
- LEFT JOIN AppUser b ON b.ID_User = PurchaseInDepotBill.Creator_PurchaseInDepotBill
- WHERE PurchaseInDepotBill.ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill and PurchaseInDepotBill.CostVerify_PurchaseInDepotBill=0 and PurchaseInDepotBill.ID_Assessor is not null
- SELECT PurchaseInDepotBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- CONVERT(decimal(18,6),PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct * PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct) AS Money
- FROM PurchaseInDepotBillProduct
- LEFT JOIN Product ON Product.ID_Product = PurchaseInDepotBillProduct.ID_Product
- WHERE PurchaseInDepotBillProduct.ID_PurchaseInDepotBill = @ID_PurchaseInDepotBill and PurchaseInDepotBill.CostVerify_PurchaseInDepotBill=0 and PurchaseInDepotBill.ID_Assessor is not null
- Order By Product.Name_Product ">
- <Params>
- <Param name="@No_PurchaseInDepotBill" type="PurchaseInDepotBill.No_PurchaseInDepotBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseInDepotBill" />
- <Table name="PurchaseInDepotBillProduct" />
- </Tables>
- </SearchPurchaseInDepotBillWithNonoVerify>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly = false;
- tbOutDepotBillNo.ReadOnly = true;
- cbCurrency.Enabled = false;
- txtMoney.ReadOnly = true;
- txttax.ReadOnly = true;
- txtCustom.ReadOnly = true;
- txtAgent.ReadOnly = true;
- txtCarriage.ReadOnly = true;
- txtHandling.ReadOnly = true;
- txtOthers.ReadOnly = true;
- toolBar.EnableSubmit = false;
- toolBar.EnableModify=false;
- dgProduct.ReadOnly = true;
- #PurchaseInDepotBill.AssessDate_PurchaseInDepotBill = DBNull();
- #PurchaseInDepotBill.CostingDate_PurchaseInDepotBill = DBNull();
- UpdateForm(true,"");
- btnCostCounting.Enabled = false;
- tbNo.Focus();
- @Status = 0;
- </Search>
- <New>
- ;
- </New>
- <View>
- tbNo.ReadOnly = true;
- tbOutDepotBillNo.ReadOnly = true;
- cbCurrency.Enabled = false;
- txtMoney.ReadOnly = true;
- txttax.ReadOnly = true;
- txtCustom.ReadOnly = true;
- txtAgent.ReadOnly = true;
- txtCarriage.ReadOnly = true;
- txtHandling.ReadOnly = true;
- txtOthers.ReadOnly = true;
- toolBar.EnableSubmit = false;
- toolBar.EnableModify=true;
- dgProduct.ReadOnly = true;
- UpdateForm(true,"");
- btnCostCounting.Enabled = false;
- @Status = 2;
- </View>
- <Modify>
- tbNo.ReadOnly = true;
- tbOutDepotBillNo.ReadOnly = false;
- cbCurrency.Enabled = false;
- txtMoney.ReadOnly = false;
- txttax.ReadOnly = false;
- txtCustom.ReadOnly = false;
- txtAgent.ReadOnly = false;
- txtCarriage.ReadOnly = false;
- txtHandling.ReadOnly = false;
- txtOthers.ReadOnly = false;
- toolBar.EnableSubmit = true;
- toolBar.EnableModify=false;
- dgProduct.ReadOnly = false;
- #PurchaseInDepotBill.Currency_PurchaseInDepotBill =@SysCurrency;
- #PurchaseInDepotBill.Creator_PurchaseInDepotBill = GetLoginUserID();
- #PurchaseInDepotBill.Name_UserMod = GetCurrentUser();
- #PurchaseInDepotBill.CostingDate_PurchaseInDepotBill = DateTimeNow();
- dgProduct.AllowNew(false);
- dgProduct.AllowDelete(false);
- btnCostCounting.Enabled = true;
- UpdateForm(true,"");
- @Status = 3;
- </Modify>
- <SubmitButtonClick>
- UpdateForm(false,"");
- if (@Status == 3)
- {
- Update();
- }
- ChangeMode("View");
- </SubmitButtonClick>
- <CountSum>
- #PurchaseInDepotBill.count = #PurchaseInDepotBill.GoodsAmount_PurchaseInDepotBill + #PurchaseInDepotBill.TaxAmount_PurchaseInDepotBill;
- #PurchaseInDepotBill.Amount_PurchaseInDepotBill = #PurchaseInDepotBill.count + #PurchaseInDepotBill.Custom_PurchaseInDepotBill + #PurchaseInDepotBill.Agent_PurchaseInDepotBill + #PurchaseInDepotBill.Carriage_PurchaseInDepotBill + #PurchaseInDepotBill.Handling_PurchaseInDepotBill + #PurchaseInDepotBill.Others_PurchaseInDepotBill;
- UpdateForm(true,"");
- </CountSum>
- <CostCounting>
- <![CDATA[
- @SumOfMoney = SumOfCol("#PurchaseInDepotBillProduct.Money");
- SuspendLayout();
- for (@i=0;@i<RowCount("#PurchaseInDepotBillProduct");@i=@i+1)
- {
- SetPosition("#PurchaseInDepotBillProduct", @i);
- #PurchaseInDepotBillProduct.Money = #PurchaseInDepotBill.Amount_PurchaseInDepotBill * #PurchaseInDepotBillProduct.Money / @SumOfMoney;
- #PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct = #PurchaseInDepotBillProduct.Money / #PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct;
- }
- ResumeLayout();
- ]]>
- </CostCounting>
- </Lables>
- </Form>
- </Forms>
|