How to Undo UPDIF#

Running UPDIF in non-trial mode will result in the CHECK_PRINTED or DEPOSIT_PRINTED toggle being enabled.
The process can be reset by either manually updating the toggle on the P2K_PR_CHECKS or P2K_PR_DEPOSITS tables or via SQL script.

Below are sample scripts for undoing UPDIF when it has been run in non-trial mode incorrectly, using Pay Run Numbers

These scripts are only required if you have run multiple payrolls and require a different file

Script for Checks - Replace XXXXX with your Pay run number

1)a - Capture the expected number of checks to be undone.#

SELECT
COUNT(ID)
FROM P2K_PR_CHECKS
WHERE PDS_ID IN
(
SELECT PDS_ID
FROM P2K_PR_PAY_HEADERS
WHERE PRN_ID IN (
SELECT ID
FROM P2K_PR_PAY_RUNS
WHERE PAY_RUN_NUMBER
IN (XXXXX, XXXXX, XXXXX, XXXXX)
)
);

1)b - If the number in 1)a is accurate - run the Update.#

UPDATE P2K_PR_CHECKS
SET CHECK_PRINTED = null
WHERE PDS_ID in
(
SELECT PDS_ID
FROM P2K_PR_PAY_HEADERS
WHERE PRN_ID IN (
SELECT ID
FROM P2K_PR_PAY_RUNS
WHERE PAY_RUN_NUMBER
IN (XXXXX, XXXXX, XXXXX, XXXXX)
)
);

2)a - Capture the expected number of deposits to be undone.#

SELECT
COUNT(ID)
FROM P2K_PR_DEPOSITS
WHERE PDS_ID IN
(
SELECT PDS_ID
FROM P2K_PR_PAY_HEADERS
WHERE PRN_ID IN (
SELECT ID
FROM P2K_PR_PAY_RUNS
WHERE PAY_RUN_NUMBER
IN (XXXXX, XXXXX, XXXXX, XXXXX)
)
);

2)b - If the number in 2)a is accurate - run the Update.#

UPDATE P2K_PR_DEPOSITS
SET DEPOSIT_PRINTED = null
WHERE PDS_ID in
(
SELECT PDS_ID
FROM P2K_PR_PAY_HEADERS
WHERE PRN_ID IN (
SELECT ID
FROM P2K_PR_PAY_RUNS
WHERE PAY_RUN_NUMBER
IN (XXXXX, XXXXX, XXXXX, XXXXX)
)
);

3) - COMMIT; -- IF the numbers are good
#