diff --git a/addons/eu/en16931/tax_combo_test.go b/addons/eu/en16931/tax_combo_test.go index 943588f0..ec323f7a 100644 --- a/addons/eu/en16931/tax_combo_test.go +++ b/addons/eu/en16931/tax_combo_test.go @@ -67,11 +67,10 @@ func TestTaxComboNormalization(t *testing.T) { func TestTaxComboValidation(t *testing.T) { ad := tax.AddonForKey(en16931.V2017) t.Run("standard VAT rate", func(t *testing.T) { - p := num.MakePercentage(19, 2) c := &tax.Combo{ Category: tax.CategoryVAT, Rate: tax.RateStandard, - Percent: &p, + Percent: num.NewPercentage(19, 2), } ad.Normalizer(c) assert.NoError(t, ad.Validator(c)) @@ -79,6 +78,17 @@ func TestTaxComboValidation(t *testing.T) { assert.Equal(t, "19%", c.Percent.String()) }) + t.Run("exempt reverse charge", func(t *testing.T) { + c := &tax.Combo{ + Category: tax.CategoryVAT, + Rate: tax.RateExempt.With(tax.TagReverseCharge), + } + ad.Normalizer(c) + assert.NoError(t, ad.Validator(c)) + assert.Equal(t, "AE", c.Ext[untdid.ExtKeyTaxCategory].String()) + assert.Nil(t, c.Percent) + }) + t.Run("nil", func(t *testing.T) { var tc *tax.Combo err := ad.Validator(tc)