Double-entry accounting with the rules enforced in code. Your books are kept on the server and every balance is recomputed from the journal.