i am a qualified accountant - every commercial accounting system i have ever seen stores a central table with next document references, covering things like next doc ref for invoices, credits, cash postings, journal vouchers, etc etc - even extending to things like stores/product refs, fixed asset refs, personnel ids - indeed many personnel systems do not accept any id number, but use the last number as a check digit.
although we mention it as a possibiltiy, I have never seen a system which determined a reference number by using a lookup on existing data.
some of this may be a vestige of 3GL systems thinking, where autonumbers werent possible, but i feel it also adds benefits that you wouldnt get with a dmax type system
i certainly feel that using a dmax is unnecessarily restrictive, eg, what if an organisation wants to start numbering invoices with a year/month prefix - eg 0902-00786 (the hyphen is just for illustration) - you just cant do this automatically with a dmax system
[edited]
or what if a system is designed to have a text reference (rather than numeric) - eg a fixed asset reference, or a nominal ledger code reference - you cant do those easily with dmax's. and although you COULD do these with an autonumber key, get the numeric bit of the reference with a dmax, and get the alpha bit, based on some sort of lookup - in my experience this isnt how these things get implemented. A NL code is particularly relevant because these would NEVER be implemented sequentially, as they ought to follow a naming and grouping convention of some sort
In a situation like this, where an identifier is appropriate, I tend to have an autonumber primary key, and then let the user enter his own identifier, ratherbvthna use the identifier as the PK