Core Rewrite

Database re written trigger eliminated, ledger is now populate with php
script rather than a trigger