Warning message while processing/closing Work Orders

Overview

While attempting to complete or close work orders, a user may sometimes encounter the following warning message:

"Stock values are not proper of the line item(s) in the document"

Solution

This error occurs when there is a discrepancy/glitch between the Work Order, Committed quantity table, and allocated quantity in the committed bin.

The problem is resolved by executing the following data fix script to correct the committed stock figure for the item that is committed:

Step 1: Backup

select i.itemno, xs.area_code, i.Q_ON_RESERVE_COMM, sum(xs.Q_ON_RESERVE_COMM) detail_total
,sum(isnull(xd.qty_attach,0)) doc_count  --into zd2161151_x_stk_area2
from items i with (nolock)
inner join x_stk_area xs with (nolock) on i.itemno = xs.item_no
inner join STK_AREA a with (nolock) on xs.AREA_CODE = a.AREA_CODE
left join (
  select w.item_no, w.area_code, sum(qty_attach) qty_attach
  from x_document_detail w with (nolock) inner join STK_AREA a1 with (nolock) on w.area_code = a1.AREA_CODE
  where a1.type = 1
  group by w.item_no, w.AREA_CODE
) xd on xs.AREA_CODE = xd.AREA_CODE and xd.ITEM_NO = xs.ITEM_NO
where a.type = 1 and i.INVENTORED = 'T' and xs.Q_ON_RESERVE_COMM <> 0
group by i.itemno, xs.area_code, i.Q_ON_RESERVE_COMM
having i.Q_ON_RESERVE_COMM <> sum(xs.Q_ON_RESERVE_COMM)

Step 2: Update the committed stock

begin transaction 
update x_stk_area set q_stk = a.doc_count, Q_ON_RESERVE_COMM = a.doc_count 
from zd2161151_x_stk_area2 a
where x_stk_area.item_no = a.ITEMNO and X_STK_AREA.area_code = a.AREA_CODE

commit transaction

Step 3: Verify

select * from x_stk_area, zd2161151_x_stk_area2 a 
where x_stk_area.item_no = a.ITEMNO and X_STK_AREA.area_code = a.AREA_CODE
Warning: Direct database updates should only be carried out by experienced Everest administrators who are advised to always take a backup prior to updating any records. If unsure of how you can use the above script to correct identified discrepancies, submit a support ticket for assistance.

Testing

The user should not encounter any warnings when processing or closing work orders.

Back to top

Comments

0 comments

Please sign in to leave a comment.