Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 02, 2017 at 06:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 01, 2017 at 04:38 AM

    Any updates please

    Add comment
    10|10000 characters needed characters exceeded