on 2011 Feb 21 12:58 PM
Hi
Cardcode exists is Sales Order but still it is allowing to add A/R Invoice
IF @transaction_type IN ('A','U') AND @object_type = '13'
BEGIN
if exists
(SELECT T1.CardCode
FROM OINV T0
INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
INNER JOIN INV1 T2 ON T0.DocEntry = T2.DocEntry
Where T0.DocEntry=@list_of_cols_val_tab_del
and T2.BaseType=-1
and not exists
(SELECT T.DocEntry FROM RDR1 T WHERE T.BaseCard=T1.CardCode))
SELECT @error = 1, @error_message = 'A/R Invoice without Copy From Delivery not Permitted !'
What i require is if user is making A/R invoice directly of a Business Partner and that Business Partner has transaction in Sales Order , then user should not be able to make A/R Invoice. In the above S.P it is allowing.
Thanks
Try this
IF @transaction_type IN ('A', 'u') AND @object_type = '13'
BEGIN
if exists
(SELECT T0.CardCode
FROM OINV T0
INNER JOIN INV1 T2 ON T0.DocEntry = T2.DocEntry
Where T0.DocEntry=@list_of_cols_val_tab_del
and T2.BaseType=-1 and T0.Cardcode in (Select distinct T5.CardCode from ORDR T5))
Begin
SELECT @error = 1, @error_message = 'A/R Invoice without Copy From Delivery not Permitted !'
End
End
Regards:
Balaji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Closed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.