SELECT *, M.RetencionFopat,P.PLA_PAT,CASE WHEN RetencionFopat>0  THEN 0.100 ELSE 0.0000 END,P.PLA_TFP,
CASE WHEN RetencionFopat>0  THEN (SELECT POR_COD FROM DBPAR..TABLAPOR WHERE POR_CLA='PAT') ELSE '' END,P.PLA_CFP
FROM 
DBMOV.DBO.PLATRANS P
INNER JOIN DBMUC_.DBO.Manifiestos M ON P.PLA_NUM =M.ManNumero
AND P.PLA_CIA COLLATE database_default=M.ManIdCia COLLATE database_default
WHERE M.ManFechExped >='20260401' AND M.RetencionFopat>=0 

/*
UPDATE P SET	P.PLA_PAT=M.RetencionFopat,
				P.PLA_TFP=CASE WHEN RetencionFopat>0  THEN 0.100 ELSE 0.0000 END,
				P.PLA_CFP=CASE WHEN RetencionFopat>0  THEN (SELECT POR_COD FROM DBPAR..TABLAPOR WHERE POR_CLA='PAT') ELSE '' END
FROM 
DBMOV.DBO.PLATRANS P
INNER JOIN DBMUC_.DBO.Manifiestos M ON P.PLA_NUM =M.ManNumero
AND P.PLA_CIA COLLATE database_default=M.ManIdCia COLLATE database_default
WHERE M.ManFechExped >='20260401' AND M.RetencionFopat>=0 
*/