cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Procedure for AP Downpaymnet Advice total and ourgoing paymnet total shoud be same

former_member188586
Active Contributor
0 Kudos

Hi to All

little bit confusion on my Stored procedure please correct it ..

if @object_type='46' and @transaction_type='A'
BEGIN

if exists(SELECT DISTINCT 'TRUE' FROM OVPM T0 INNER JOIN VPM2 T1 ON T0.[DocEntry] = T1.[DocNum] INNER JOIN ODPO T2 ON T0.[DocEntry] = T2.[DepositNum] WHERE T1.[SumApplied]<=T2.[DocTotal] OR T1.[SumApplied]>=T2.[DocTotal] AND T1.[InvType] ='204' AND T0.DocEntry= @list_of_cols_val_tab_del
)
begin
set @error = '-253'
set @error_message = 'sHOULD YOU CHOOSE ADV BILL AMT ONLY'
end
END

---

my requirement is when we want to give payment against ap down payment advice total and ovpm payment should be same if not system has to raise on alert ,,,

thanks for advance help

---Ramudu

Accepted Solutions (1)

Accepted Solutions (1)

former_member188586
Active Contributor
0 Kudos

hi

this one is worked but i want this on approval, it means like draft

if @object_type='140' and @transaction_type='A'
BEGIN
if exists(SELECT distinct 'TRUE'



FROM OPDF T3 INNER JOIN OVPM T0 ON T3.[DocEntry] = T0.[DraftKey]inner JOIN VPM2 T1 ON T0.[DocEntry] = T1.[DocNum]
left JOIN ODPO T2 ON T1.DocEntry=T2.DocEntry and T1.InvType=T2.ObjType
WHERE T2.DocTotal<>(Case when isnull(T0.CheckSum,0)=0 then T0.CashSum else T0.CheckSum End)


and T3.DocEntry= @list_of_cols_val_tab_del
)
begin
set @error = '-253'
set @error_message = 'you have to give Adv. Only'
end
END

Answers (1)

Answers (1)

former_member188586
Active Contributor
0 Kudos

Any updates please