on 05-13-2014 9:48 AM
Hi
I want to block pick the item in pick and manger when a customer have any payment due above 60 dates as per posting date,
we are following first sale order ---->pick ----->Delivery ---->Invoice
Please give me a solution
Hi,
Try this:
SELECT distinct 'true' FROM OINV T0 INNER JOIN OCRD T1 ON
T0.CardCode = T1.CardCode WHERE T0.CardCode = $[$4.0.0] AND
DateDiff(dd,T0.[DocDueDate],Getdate())>60 and T0.DocStatus='O'
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
TRY THIS NOTIFICATION :It will check only the current invoice ,which is going to add
if @object_type = '13' and @transaction_type = 'A'
BEGIN
if exists (SELECT distinct cardcode FROM OINV T0 INNER JOIN OCRD T1 ON
T0.CardCode = T1.CardCode WHERE T0.DocEntry = @list_of_cols_val_tab_del AND
DateDiff(dd,T0.[DocDueDate],Getdate())>60)
begin
select @error = 1, @error_message = 'more than 60 days .... '
end
end
Hi,
Instead of blocking, you can send above document for approval. try to create approval procedure for AR invoice with below query:
SELECT distinct 'true' FROM OINV T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode WHERE T0.CardCode = $[$4.0.0] AND DateDiff(dd,T0.[DocDate],Getdate())>60 and T0.DocStatus='O'
If you want stored procedure, check this thread
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akhil
Try Below query thru store procedure.
if (@object_type = '156') and (@transaction_type = 'A' or @transaction_type = 'U')
BEGIN
SELECT top 1 @error = 1, @error_message = 'Open Invoice Exists'
from OPKL A inner Join PKL1 B on A.AbsEntry = B.AbsEntry
Inner Join ORDR C on B.OrderEntry= C.DocEntry and BaseObject='17'
Inner Join OINV D on C.CardCode = D.CardCode
Where A.AbsEntry=@list_of_cols_val_tab_del and D.DocEntry in (Select X.DocEntry from OINV X where X.DocStatus ='O' and datediff (Day,X.DocDate, GetDate())>60)
END
Regards
Unnikrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.