Report data provider -Sum of the field with base enum types

Hi everyone,
I am beginner in AX 2012 reporting I need to calculate the value of following attributes , please help me to write business logic for this query in RDP class and the queries involved the calculation of the these field from the table AssetTransTable with base enum type value

  1. Acquisition cost(Field used Temp in Table) – Sum of all transactions (AssetTrans table) with types: Acquisition, Acquisition Adjustment, Write up Adj, Write down Adj

  2. Accumulated Depreciation(Field used in Temp Table) – Sum of all transactions (AssetTrans table) with types: Depreciation, Depreciation Adj, Extraordinary depreciation

  3. YTD Depreciation(Field used in Temp Table) – Sum of current year transactions (AssetTrans table) with types: Depreciation, Depreciation Adj,
    Extraordinary depreciation.

please help anyone asap

public void processReport()

{

while select assetBook

join assetTable

where assetBook.AssetId == assetTable.AssetId

&& assetBook.Status == AssetStatus::Open

{

tmpFixedAsset.clear();

tmpFixedAsset.AssetName = assetTable.Name;

tmpFixedAsset.AssetNumber = assetTable.AssetId;

tmpFixedAsset.FAGroup = assetTable.AssetGroup;

tmpFixedAsset.MajorType = assetTable.MajorType;

tmpFixedAsset.DatePurchased = assetBook.AcquisitionDate;

tmpFixedAsset.Status = assetBook.Status;

tmpFixedAsset.Convention = assetBook.DepreciationConvention;

tmpFixedAsset.Life = assetBook.LifeTime;

tmpFixedAsset.RemainingLife = assetBook.LifeTimeRest;

tmpFixedAsset.Location = assetTable.Location;

tmpFixedAsset.ProjectNumber = assetTable.MaintenanceInfo1;

tmpFixedAsset.TagNumber = assetTable.MaintenanceInfo2;

tmpFixedAsset.DepreciationMethod = assetBook.Depreciation;

while select sum(AmountCur) from assetTrans

where assetTrans.AssetId == assetBook.AssetId

&& assetTrans.BookId == assetBook.BookId

&& (assetTrans.TransType == AssetTransType::Acquisition

|| assetTrans.TransType == AssetTransType::AcquisitionAdj

|| assetTrans.TransType == AssetTransType::WriteUpAdj

|| assetTrans.TransType == AssetTransType::WriteDownAdj)

{

tmpFixedAsset.AcquisitionCost = assetTrans.AmountCur;

netBookValue = assetTrans.AmountCur;

}

while select sum(AmountCur) from assetTrans

where assetTrans.AssetId == assetBook.AssetId

&& assetTrans.BookId == assetBook.BookId

&& assetTrans.TransType == AssetTransType::Depreciation

|| assetTrans.TransType == AssetTransType::DepreciationAdj

|| assetTrans.TransType == AssetTransType::ExtraordinaryDepreciation

{

tmpFixedAsset.AccumulatedDepreciation = assetTrans.AmountCur;

tmpFixedAsset.NetBookValue = assetTrans.AmountCur + netBookValue;

}

while select sum(AmountCur) from assetTrans

where assetTrans.AssetId == assetBook.AssetId

&& assetTrans.BookId == assetBook.BookId

&& assetTrans.TransDate > mkDate(1, 1, year(today()))

&& assetTrans.TransDate <= today()

&& (assetTrans.TransType == AssetTransType::Depreciation

|| assetTrans.TransType == AssetTransType::DepreciationAdj

|| assetTrans.TransType == AssetTransType::ExtraordinaryDepreciation)

{

tmpFixedAsset.YTDDepreciation = assetTrans.AmountCur;

}

tmpFixedAsset.insert();

}

}