I'm looking for a solution on magento 2 to get per price or per cart totals the amounts per tax class or customer group.
The case is I have extended \Magento\Quote\Model\Quote\Address\Total\AbstractTotal to have an custom fee (percentage of grand_total - shipping) (based on how to add fee to order totals in magento2) in my cart. I also have a specific customer group with tax class (no tax rule, so 0% tax) for b2b customer, removing the tax from cart.
The tax is removed from cart overview when using b2b address, but the fee is still calculated over the total + tax. Then when switching to b2c address in payment page adds the tax again, but the fee calculation is done over the total without the tax.
At the moment of fee calculation the customer group id is correctly set. Any one with a solution or point me in the right direction ?