Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

micros 3700. close multi checks at once

Status
Not open for further replies.

cooperk222

IS-IT--Management
Sep 16, 2020
1
SA
Hi all.

I am having hard time closing checks one by one (as some places have over 100 none closed checks) that stacked over the years

I am aware to use micros.sp_forcechkclose(#) and it will close that check #. is there a way to close. multiple checks at once or even close all open checks "command I use to see the open checks" select* from micros.chk_dtl where chk_open='t'

 
You can update the checks table.

Update micros.chk_dtl set chk_open = 'T', chk_clsd_date_time = getdate()
Where chk_num in (1001,1002,1003)
Commit

Just replace the numbers in the brackets with your check numbers.
 
I've used this before when our integrations spam RES with checks -- might have to mess around with line 25 if checks are from today.


BEGIN

DECLARE err_NOTFOUND EXCEPTION FOR SQLSTATE VALUE '02000';
DECLARE @ChkSeqToClose INTEGER;

DECLARE LOCAL TEMPORARY TABLE t_chk_close_list (
chkSeq INTEGER PRIMARY KEY ) ON COMMIT PRESERVE ROWS;

DECLARE c_check DYNAMIC SCROLL CURSOR FOR
SELECT
chkSeq
FROM
t_chk_close_list
ORDER BY
chkSeq;

-- Get the check seqs for open checks that are more than 24 hours old
INSERT INTO t_chk_close_list ( chkSeq )
SELECT
chk_seq
FROM
MICROS.chk_dtl
WHERE
chk_open = 'T'
AND now(*) - chk_open_date_time > 1;
MESSAGE 'ForceCloseChecks>>> Checks TO CLOSE: ' || @@rowcount;

OPEN c_check WITH HOLD;

CHECK_LOOP:
LOOP
FETCH NEXT c_check INTO
@ChkSeqToClose;

IF SQLSTATE = ERR_NOTFOUND THEN
LEAVE CHECK_LOOP;
END IF;

MESSAGE 'ForceCloseChecks>>> Closing check_seq: ' || @ChkSeqToClose;

CALL MICROS.sp_forcechkclose(@ChkSeqToClose);
COMMIT;

END LOOP CHECK_LOOP;

CLOSE c_check;

END;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top