Multiple VAT Levels and my Zen Cart discounts

Every once in a while, a European customer complains that tax recalculation in my Zen Cart mods is not working correctly for their store with multiple levels of embedded taxes.  (This is also an issue in osCommerce.)

Here’s what to look for: non-unique strings in the descriptions of taxes (this is shown in Admin->Locations/Taxes->Tax Rates)

sv_taxes_before

Because of the way Zen Cart (and osCommerce) represent taxes in the order object, the tax descriptions must be unique to allow for reverse lookups.  So try changing the strings “Varav moms” to “Varav moms (1),” “Varav moms (2),” etc. to make them unique.