I'm not sure if IP is really a good choice here.
I recommend you using one of the many eCommerce open source software out there.
For example, Magento or Prestashop.
They all have customer groups, where you can apply special discounts.
And all of them have an default invoice system build in