Skip to Content
0

SPT Not working when invoice is Cancelling

Apr 30 at 08:15 AM

25

avatar image

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
10 |10000 characters needed characters left characters exceeded

ok its fixed

i was the issue with because we had provide line total, when i removed it,, it find perfect

Regards

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Nagarajan K May 02 at 12:10 PM
0

Did you check above TN?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

yes its working fine

0
Nagarajan K Apr 30 at 03:28 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded