Skip to Content
0
Apr 30, 2018 at 08:15 AM

SPT Not working when invoice is Cancelling

69 Views

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