I am working with a client who is not getting the correct AP Check number when running AP Print Checks. It appears that several years ago a check with a number of 990100 was used as a CK type check, recently they are having trouble getting the real number to go into the system. The check should be 039609 and it proceeded to pick the 990772 check number and fill in where it could with the next highest check number (becasue they do have 99000 numbers out there the numbers bounced around to the next highest) (I think). They do use 99000 series for Hand Checks, but I am under the impression that it will not look at HC type for the next reference number. How can we get the system to recognize 039609 - I did verify that 039609 has not been used in the past but they do have some Alpha check numbers in the system as well. I have no idea why it would all of a sudden cause issues when the CK types are several years old with the 99XXXX values.
This is the proc that is used to find the next check number.
/****** Object: Stored Procedure dbo.FindLastAPCheck Script Date: 4/7/98 12:19:55 PM ******/
Create Procedure FindLastAPCheck @parm1 varchar ( 10), @parm2 varchar ( 24) As
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' or b.DocType = 'EP'))))
I tested this in the Demo Database and it did not consider any HC documents when it selected the next check number.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,493 Most Valuable Professional
nmaenpaa 101,148