Skip to Content
0
Sep 24, 2019 at 04:01 PM

How to do query of fixed asset in SAP Business One 9.2 PL10?

824 Views

Hi all,

I tried to do query of fixed asset but I'm not getting real result, below is my query

select distinct OITM.ItemCode,OITM.ItemName,case when ITM8.APC=0 then ACQ1.LineTotal else ITM8.APC end as APC,OLCT.Location,OITM.AssetClass,OITM.CapDate,ITM8.OrDpAcc,
case when ITM8.OrDpAcc=0 or OITM.CapDate>='2018-07-01'  then (select sum(ODPV.OrdDprAct) from ODPV where ODPV.ItemCode=OITM.ItemCode group by ODPV.ItemCode) else ITM8.OrDpAcc end as 'Accumulated Depreciation',
(case when ITM8.APC=0 then ACQ1.LineTotal else ITM8.APC end) - (case when ITM8.OrDpAcc=0 or OITM.CapDate>='2018-07-01'  then (select sum(ODPV.OrdDprAct) from ODPV where ODPV.ItemCode=OITM.ItemCode group by ODPV.ItemCode) else ITM8.OrDpAcc end) as 'Net Book Value'
,ITM7.UsefulLife,ITM7.PeriodCat,ITM8.PeriodCat from ITM7 inner join ITM8 on ITM7.ItemCode=ITM8.ItemCode inner join ACQ1 on  ITM8.ItemCode=ACQ1.ItemCode inner join OITM on ACQ1.ItemCode=OITM.ItemCode left join OLCT on OLCT.Code=OITM.Location
where  ITM8.PeriodCat='2018_2019' and oitm.itemtype='F'

Please anyone can help me to correct this error