I would absolutely NEVER steal or rewrite that. So much finanical stuff is baked into the business logic that impacts finance, regulations, hr, etc.
No do not roll your own ERP core.
Roll everything else