Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Salex Tax in Receipt

  1. #1
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Default Salex Tax in Receipt

    Is there a way to get sales tax in order receipt? We have sales tax depends upon the zipcode, so the sales tax is stored in ZiptaxRate.

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Not exactly sure what you're after here, the receipt should already show taxes. Are you needing to break it into separate line items?

  3. #3
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Default

    Quote Originally Posted by AspDotNetStorefront Staff - Scott View Post
    Not exactly sure what you're after here, the receipt should already show taxes. Are you needing to break it into separate line items?
    Sorry, I would like to correct my question. I need to display sales tax percentage next to the tax amount in receipt.
    We have sales tax depends upon TaxZipRate table, For example if the customer's zipcode is 94015(California) then we are charging 8.5% of sales tax. We would like to display this 8.5% in customer's order receipt. Is it achievable?

    Thanks in advance.

  4. #4
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Default Change in Query

    In order to get the taxrate from ZipTaxRate table, In notification.receipt.xml.config, I changed the query to
    (NOTE: Changes is in red color)
    select a.FreeShipping,
    a.AddressIDs,
    a.ItemCount,
    case when a.Downloads = a.ItemCount then 1 else 0 end allDownloads,
    case when a.FreeShipping = a.ItemCount then 1 else 0 end allFreeShipping,
    case when a.SystemProducts = a.ItemCount then 1 else 0 end allSystemproducts,
    case b.multiship when 1 then 0 else 1 end multiship,
    case b.GiftRegistryItems when 0 then 0 else 1 end hasgiftregistryitems,
    o.* ,
    Z.TaxRate,
    CASE WHEN cp.CouponCode IS NULL THEN '' ELSE cp.ValidForProducts END AS ValidProductsForCoupon
    From dbo.orders o with (NOLOCK)
    join (
    select sc.ordernumber,
    count(distinct sc.ShippingAddressID) AddressIDs,
    sum(sc.IsDownload) Downloads,
    case when sum(scf.FreeShipping) is null then 0 else sum(scf.FreeShipping) end as FreeShipping,
    sum(sc.isSystem) SystemProducts,
    count(*) ItemCount
    From dbo.Orders_ShoppingCart sc with (NOLOCK)
    left outer join dbo.Orders_ShoppingCart scf on scf.OrderNumber = sc.OrderNumber and sc.ShoppingCartRecID = scf.ShoppingCartRecID and scf.FreeShipping = 1
    where sc.ordernumber = @ordernum
    group by sc.ordernumber
    ) a on o.ordernumber = a.ordernumber
    join (
    select OrderNumber,
    count(distinct ShippingAddressID) multiship,
    sum(case GiftRegistryForCustomerID when 0 then 0 else 1 end) GiftRegistryItems
    FROM dbo.Orders_ShoppingCart
    where ordernumber = @ordernum
    group by OrderNumber
    ) b on o.OrderNumber = b.OrderNumber
    join dbo.customer c on o.customerid = c.customerid
    LEFT OUTER JOIN Coupon cp ON cp.CouponCode = o.CouponCode
    INNER JOIN ZipTaxRate Z ON o.ShippingZip = Z.ZipCode WHERE
    Z.ZipCode = (SELECT ShippingZip from Orders where OrderNumber = @ordernum) AND
    o.ordernumber = @ordernum

    So now, inside the <PackageTransform></PackageTransform>, I added the following line to get tax rate,
    <xsl:value-of select="$OrderInfo/TaxRate" disable-output-escaping="yes" />

    When i ran this query in database I am able to get all the values without any errors.
    But when I click the order number to see the receipt in front end, I am getting the error message as,

    "The specified order is no longer valid or is empty!
    If this is an error, please contact us "

    Please give me a solution for this issue.

  5. #5
    Rita is offline Senior Member
    Join Date
    Mar 2009
    Posts
    124

    Default

    Please help me in this issue. How to display TaxRate Percentage using XMLPackage.