on 10-01-2008 1:53 PM
Hi Guys
i have created this backorder stored proc that blocks all orders that will take the item into negative, ie selling more than actually available, it works 99% well, issue is i dont know where and why the stored proc still allows certain unknown scenarios to go through. i think i might have to amend it slightly and add " where t0.onhand - t1.quantity < 0", this could block all orders that will make the onhand negative. and yes this is only sold from one warehouse. Thanks
if( @object_type = '17' and(@transaction_type = 'A' or @transaction_type = 'U'))
begin
set @backorder = (select top(1) T0.itemcode from rdr1 T0 inner join oitw T1 on T0.WhsCode = T1.WhsCode where
(T0.Quantity >= T1.OnHand) and T0.itemcode = T1.itemcode and T0.docentry = @list_of_cols_val_tab_del )
if(@backorder is not null)
begin
set @error = 1
set @error_message = N'Item '@backorder' exceeds available quantity'
end
end
Sorted, had to add in "iscommited" into calculation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.