Hello Doug,
This is caused by a vendor that has the Separate Check option selected in Vendor Maintenance and the vendor has only a debit adjustment that is unpaid. The system selects the AD for payment but can't cut a negative check. So this item gets stuck and causes the system to skip check numbers and create a problem for the other checks in the batch.
This is due to bug 19556 which is corrected in SL 2011 SP1. The workaround is to execute the script below on the application database. This will prevent the issue in the future until you upgrade. You should run select statements on the APcheck and APcheckdet tables to make sure a record isn't sitting in one of the tables for this vendor with the single AD outstanding. If there are no check batches currently in process, there should be no records in either of those tables.
Below is the script to run in SQL Server Management Studio to prevent further occurences.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/****** Object: Stored Procedure dbo.FindLastAPCheck Script Date: 4/7/98 12:19:55 PM ******/
ALTER Procedure [dbo].[FindLastAPCheck] @parm1 varchar ( 10), @parm2 varchar ( 24) As
-- temp fix for MBS bug 10339
update apcheck set checklines = (select count(*) from apcheckdet where apcheck.checkrefnbr=apcheckdet.checkrefnbr) from apcheck
delete from apcheck where checkrefnbr not in (select distinct checkrefnbr from apcheckdet)
Select ISNULL(MAX(refnbr) ,'0')
FROM APDoc a (NOLOCK)
Where a.DocClass = 'C'
AND a.Acct = @parm1
AND a.Sub = @parm2
AND
(a.DocType in ('CK', 'MC', 'SC', 'ZC')
OR
((a.DocType = 'VC')
AND NOT EXISTS (SELECT 1 FROM APDoc b (NOLOCK) WHERE a.refnbr = b.refnbr AND a.VendId = b.VendId and a.Acct = b.Acct and a.Sub = b.Sub and b.DocType = 'HC')))
Please let me know if you need additional assistance.