1. Obtain the budget statement through the budget cycle and company ID (the budget statement contains the report status attribute ).
2. Obtain the current workflow entity through the ID or vid of the budget preparation ticket (you can know the workflow status ).
3,
Obtain detailed splitting data (fixed assets details)
public IList<ResolutionMDL> GetDetailsResolutions(string detailsID, string detailsType)
Select R. ID, R. companyid, isnull (R. preresolutionnum, 0) as preresolutionnum, isnull (R. addresolutionnum, 0) as addresolutionnum, isnull (R. resolutionnum, 0) as resolutionnum, isnull (R. addresolutionapprovalnum, 0) as addresolutionapprovalnum, isnull (R. resolutionapprovalnum, 0) as resolutionapprovalnum, R. resolutionapproved, R. resolutionimplement, R. resolutionquantity, case when R. resolutionapprovalquantity is null then R. resolutionquantity else R. resolutionapprovalquantity end as resolutionapprovalquantity, R. resolutionapprovedquantity, R. resolutionimplementquantity, R. resolutionuniteprice, case when R. resolutionapprovaluniteprice is null then R. resolutionuniteprice else R. resolutionapprovaluniteprice end as resolutionapprovaluniteprice, R. resolutionapproveduniteprice, R. resolutionimplementuniteprice, C. compshortname as companyName from DBO. bm_resolutionrelatingdetails RRD inner join DBO. bm_resolution R on RRD. resolutionid = R. id left join org_company C on R. companyid = C. ID where RRD. detailsid = 'df2dafa4-b3bb-46c5-824f-6fee8354a912 'and RRD. detailstype = 'fixed asset details' order by compserial ASC
Obtain the detailed entity of a fixed asset using the detailed ID:
Permanentassetsdetailsmdl model = new budgetmanagementbfl (). getpermanentassetsdetails (detailsid );
Obtain the unit budget account information by using the account ID of the detail object.
Companybudgetaccountsmdl cmodel = new budgetmanagementbfl (). getcompanybudgetaccountsbykey (model. accountid );
Obtain the account ID of a fixed asset.
Public ilist <permanentassetsdetailsmdl> getpermanentassetsdetailsbyaccountidandaccountrelatingadjust (string accountid)
SELECT pad.ID, pad.AccountID, ISNULL (cba.Seq, '') + cba.AccountName AS AccountName, ISNULL (r.BasePrice, 0) AS BasePrice, cba.IsPaidByOthers, ut.DictName AS Unite, pad.Specification, pad.PreUnitePrice, pad.UnitePrice, isnull (pad.ApprovalUnitePrice, pad.UnitePrice) AS ApprovalUnitePrice, pad.UnitePriceApproved, pad.PreNumber, pad.Quantity, isnull (pad.ApprovalNumber, pad.Quantity) AS ApprovalNumber, pad.PreMoney, pad.Money, pad.PreApprovalMoney, pad.ApprovalMoney, pad.UserDepartment, pad.ApplyReason, pad.ApprovalApplyReason, bt.DictName AS CalculatedType, (SELECT CASE WHEN COUNT (1) > 0 THEN 'Y' ELSE 'N' END FROM BM_CompanyBudgetAccounts WHERE ParentAccountID = pad.AccountID AND Status = 1) AS IsHasChild, (SELECT CASE WHEN COUNT (1) > 0 THEN 'Y' ELSE 'N' END FROM AM_ApprovalOpinion WHERE BudgetingAccountID = pad.ID) AS IsHasOpinion FROM dbo.BM_DetailsRelatingAccount dra INNER JOIN dbo.BM_PermanentAssetsDetails pad ON dra.DetailsID = pad.ID INNER JOIN dbo.BM_CompanyBudgetAccounts cba ON pad.AccountID = cba.ID INNER JOIN BM_AccountRelatingDetails r ON r.DetailsID = cba.TemplateAccountID LEFT JOIN dbo.EHS_SYS_DictInfo bt ON cba.CalculatedProperty = bt.DictInfo_Id LEFT JOIN dbo.EHS_SYS_DictInfo ut ON cba.Unit_Id = ut.DictInfo_Id WHERE pad.Id IN (SELECT DetailsID FROM dbo.BM_DetailsRelatingAccount WHERE AccountID = 'a9a79021-18b2-4fef-b24e-11e6505aa0b9') AND r.AccountID = (SELECT TemplateAccountID FROM BM_CompanyBudgetAccounts WHERE ID IN (SELECT AdjustmentSubjectID FROM BM_BudgetAdjustmentAccount WHERE ID = 'a9a79021-18b2-4fef-b24e-11e6505aa0b9'))ORDER BY cba.AccountCode ASC, cba.AccountName