on 04-26-2012 11:30 AM
hai
i create a Gpro Document for 5000 qty and Based on the Grpo i create a Two Ap invoice .
example
Grpo 5000 Qty - Ap invoice 2000 qty
Ap invoice 4000 Qty
AP invoice Qty Greater than the Grpo Qty so i want block this scenario ? Any Store procedure is there ??
HI
Try this
IF(@object_type = '18') and (@transaction_type in ('A', 'U'))
begin
IF Exists (select T0.DocEntry from OINV t0 inner join inv1 t1 on t0.docentry=t1.docentry inner join pdn1 t2 on t1.baseentry=t2.docentry and t1.itemcode = t2.itemcode
where T0.DocEntry = @list_of_cols_val_tab_del and (sum(t1.Quantity)>sum(t2.quantity))
Begin
SET @error = 1
SET @error_message = 'Invoice qty exceeded the GRN Qty'
End
End
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Try now
IF((@object_type = '18') and (@transaction_type in ('A', 'U'))
begin
IF Exists (select T0.DocEntry from OINV t0 inner join inv1 t1 on t0.docentry=t1.docentry inner join pdn1 t2 on t1.baseentry=t2.docentry and t1.itemcode = t2.itemcode
where T0.DocEntry = @list_of_cols_val_tab_del and (sum(t1.Quantity)>sum(t2.quantity))
Begin
SET @error = 1
SET @error_message = 'Invoice qty exceeded the GRN Qty'
End
End
User | Count |
---|---|
95 | |
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.