Tax Calculation does not reflect country and state

Coordinator
Mar 6, 2013 at 2:19 AM
As a fix,
please run this on your database:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetTaxes]
       @CountryID int,
       @StateID int = null,
       @ProvinceID int = null
AS
BEGIN
       SET NOCOUNT ON;
       IF @StateID IS NOT NULL
              BEGIN
                     SELECT
                           TaxID,
                           TaxName,
                           Fixed,
                           Amount,
                           IsAfterShipping,
                           CountryID,
                           StateID,
                           ProvinceID,
                           Active
                     FROM
                           Tax WITH(NOLOCK)
                     WHERE
                           CountryID = @CountryID AND
                           StateID = @StateID AND
                           Active = 1
              END
       ELSE IF @ProvinceID IS NOT NULL
              BEGIN
                     SELECT
                           TaxID,
                           TaxName,
                           Fixed,
                           Amount,
                           IsAfterShipping,
                           CountryID,
                           StateID,
                           ProvinceID,
                           Active
                     FROM
                           Tax WITH(NOLOCK)
                     WHERE
                           CountryID = @CountryID AND
                           ProvinceID = @ProvinceID AND
                           Active = 1
              END
       ELSE
              BEGIN
                     SELECT
                           TaxID,
                           TaxName,
                           Fixed,
                           Amount,
                           IsAfterShipping,
                           CountryID,
                           StateID,
                           ProvinceID,
                           Active
                     FROM
                           Tax WITH(NOLOCK)
                     WHERE
                           CountryID = @CountryID AND
                           Active = 1
              END
              
              
END