There seems to be an accounting equivalent of Greenspun's tenth rule:
"Any sufficiently complicated financial reporting system contains an ad-hoc, informally-specified, bug-ridden implementation of double-entry accounting."
It's such a powerful yet simple way of thinking about money that anyone who builds a billing or accounting system should be intimately familiar with it.