Skip to Content

SPT Not working when invoice is Cancelling

Hi Experts

i had a SPT which auto populate a UDF Data from Invoice to its related JE and its working fine when i Add a new document

But when i cancel the same document, this SPT is not working and does not auto populate the date from UDF to JE UDF

Pls help me to sort it out

Below attached is the SPT

Regards

IF @transaction_type in ('A','C','U') AND @Object_type = '18'
BEGIN
UPDATE D
	SET        D.U_TaxType = B.U_TaxType
	FROM            OPCH AS A INNER JOIN
                         PCH1 AS B ON A.DocEntry = B.DocEntry INNER JOIN
                         OJDT AS C ON A.TransId = C.TransId AND A.ObjType = C.TransType INNER JOIN
                         JDT1 AS D ON C.TransId = D.TransId
	WHERE B.AcctCode = D.Account and B.LineTotal = D.Debit AND A.DocEntry = @list_of_cols_val_tab_del AND A.DocType = 'S'
END
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 02 at 12:10 PM

    Did you check above TN?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 30 at 03:28 PM

    Hi,

    Try this,

    IF @transaction_type in ('A','C','U') AND @Object_type = '18'

    BEGIN

    UPDATE D SET D.U_TaxType = B.U_TaxType

    FROM OPCH AS A INNER JOIN PCH1 AS B ON A.DocEntry = B.DocEntry

    INNER JOIN OJDT AS C ON A.TransId = C.TransId AND A.ObjType = C.TransType

    INNER JOIN JDT1 AS D ON C.TransId = D.TransId WHERE B.AcctCode = D.Account

    and (B.LineTotal = D.Debit OR B.LineTotal = D.Credit) AND A.DocEntry = @list_of_cols_val_tab_del AND A.DocType = 'S'

    END

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded