一个销售出库单,直接取用批次库存就出库了,没有根据发货通知下推生成,最后导致销售出库丢失了关联关系(没有单价、不能与发货通知、销售订单关联)。
--销售出库单查询
Select FSourceTranType, FSourceInterId,FSourceBillNo,FSourceEntryID ,* from icstockbillentry
where finterid in (select finterid from icstockbill where fbillno ='TY19082112')
--销售订单查询(取得订单内码)
Select * from seorderentry where finterid in (select finterid from seorder where FBillNo = 'P19072654')
--发货通知查询(取得发货通知的内码、行号
Select top 22 * from SEOutStockEntry Where FSourceInterID = 103898 --订单内码
--取得发货通知的单号
Select * from seoutstock where finterid = 128351
--修改单价、补上销售出库中发货通知、销售订单的关联关系,以便单据上查、下查
Update ICStockbillentry set
FOrderInterID = 103898,
FOrderEntryID = 1,
FOrderBillNo = 'P19072654',
FSourceTranType = 83,
FSourceBillNo = 'SEOUT19081589',
FSourceInterId = 128351,
FSourceEntryID = 1,
FPrice =0.195,
FAmount = 0.195 * FQty,
FAuxPrice = 0.195
Where FInterID = 669736 and fentryid = 1
网友评论