on 05-05-2014 11:04 AM
hi.
i need a stored procedure at purchase order..
what i need is purchase quotation , posting date should be equal to purchase order posting date other wise..
error will show...
the below one i tried but it's not working..
--IF (@object_type = '22' )and (@transaction_type IN ('A','U'))
--BEGIN
--If exists(SELECT T3.[Docentry] FROM POR1 T0 left join OPQT T1 on T0.[BaseDocNum] = T1.[DocNum]
-- INNER JOIN PQT1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OPOR T3 ON T0.DocEntry = T3.DocEntry WHERE DATEDIFF(DD,T3.DocDate,T1.DocDate ) <> 0 and T3.DocEntry =
--@list_of_cols_val_tab_del )
-- Begin
-- set @error =105
-- set @error_message = 'Please Check the Date'
-- End
-- end
Try:
IF (@object_type = '22' )and (@transaction_type IN ('A','U'))
BEGIN
If exists(SELECT T3.[Docentry] FROM POR1 T0 left join OPQT T1 on T0.[BaseEntry] = T1.[DocEntry]
INNER JOIN PQT1 T2 ON T1.DocEntry = T2.DocEntry
INNER JOIN OPOR T3 ON T0.DocEntry = T3.DocEntry
WHERE T3.DocEntry = @list_of_cols_val_tab_del and DateDiff(dd,T3.DocDate,T1.DocDate) != 0)
Begin
set @error =22
set @error_message = 'PO date must be the same as Quote date'
End
END
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Why your query is not working? Its working for me.
You need to enable "allow future posting date" under general settings.Other you will get an error message.
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. Stored procedure is not working...
it is allowing diff posting date at purchase order.. that purchase quotation..
You need to enable "allow future posting date" under general settings.Other you will get an error message.
I opened general setting but i have not seen any option allow future posting date
under which tab i can found above option...
Hi,
Run below query in query generator and let me know the result:
SELECT T3.[Docentry] FROM POR1 T0 left join OPQT T1 on T0.[BaseDocNum] = T1.[DocNum]
INNER JOIN PQT1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OPOR T3 ON T0.DocEntry = T3.DocEntry WHERE DATEDIFF(DD,T3.DocDate,T1.DocDate ) <> 0
Thanks & Regards,
Nagarajan
IF (@object_type = '22' )and (@transaction_type IN ('A','U'))
BEGIN
If exists(SELECT T3.[Docentry] FROM POR1 T0 left join OPQT T1 on T0.[BaseDocNum] = T1.[DocEntry]
INNER JOIN PQT1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OPOR T3 ON T0.DocEntry = T3.DocEntry WHERE T3.DocDate<>T1.DocDate and T3.DocEntry =
@list_of_cols_val_tab_del )
Begin
set @error =105
set @error_message = 'Please Check the Date'
End
end
Hi,
If you create same item with different ware house, system automatically creates two separate PO for each item.
In this case, the base reference number is not from PQ, its taken from same PO number. That's why, the above code is not blocking the transaction.
Try :
1. Create new PQ with single item
2. Raise PO based on above PQ
Thanks & Regards,
Nagarajan
Try this :
IF (@object_type = '22' )and (@transaction_type IN ('A','U'))
BEGIN
If exists(SELECT T3.[Docentry] FROM POR1 T0 left join OPQT T1 on T0.[BaseDocNum] = T1.[DocEntry]
INNER JOIN PQT1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OPOR T3 ON T0.DocEntry = T3.DocEntry WHERE T3.DocDate<>T1.DocDate and T3.DocEntry =
@list_of_cols_val_tab_del )
Begin
set @error =105
set @error_message = 'Please Check the Date'
End
shachar
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.