【058】出货单交易分录【主营业务成本】
侧边栏壁纸
  • 累计撰写 60 篇文章
  • 累计收到 2 条评论

【058】出货单交易分录【主营业务成本】

秋驰雪隙
2025-06-19 / 0 评论 / 10 阅读 / 正在检测是否收录...
获取出货单行的预设科目=主营业务成本的会计科目

查询SQL语句

select sp.DocNo,spl.DocLineNo,Act.Segment1
from SM_ShipLine as spl
inner join SM_Ship as sp on sp.ID=spl.Ship 
inner join InvTrans_Period as peri on peri.TransDocLine_EntityType='UFIDA.U9.SM.Ship.ShipLine' and peri.TransDocLine_EntityID=spl.ID
inner join InvTrans_PeriodCost as cost on cost.Period=peri.ID
inner join AAI_TransactionEntry  as aai on aai.OriginalEntityType='UFIDA.U9.InvTrans.Trans.PeriodCost' and aai.OriginalEntity=cost.ID
inner join AAI_TransEntryTemplet as aaitemp on aaitemp.ID=aai.EntryTemplet -- 交易分录模板
inner join AAI_PredeterminedAccount_Trl as aaipreaccl on aaipreaccl.ID=aaitemp.PredAcct and aaipreaccl.Name=N'主营业务成本' -- 预设科目
inner join CBO_Account AS Act ON aai.Account = Act.ID -- 会计科目
where sp.DocNo='101FHD25012000001'

结果

70236cc7b275e5a9301ec000fed18bb.png

9263a194ee7fc1ab80aad001628a4df.png

0

评论 (0)

取消