I have added a discount code which provides a 100% discount. In the shopping cart checkout, this is applied correctly under "Cart contents". But on the same page, under "Payment method", the 100% discount is applied to the subtotal and then the tax is added.

Cart contents
Price £114 inc VAT
Coupon -£114 inc VAT
Subtotal £0.00

Payment method
Coupon: -£95
Subtotal: £95
Subtotal excluding taxes: £0.00
VAT: £19
Order total: £19

I have tried selecting "Coupon discount" under Taxed line items in Admin > Store > Configuration > Taxes. But this messes it up in the other direction:

Cart contents
Price £114 inc VAT
Coupon -£136.80 inc VAT
Subtotal £22.80

Payment method
Coupon: -£95
Subtotal: £95
Subtotal excluding taxes: £0.00