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.
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.
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.
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.
Please help me in this issue. How to display TaxRate Percentage using XMLPackage.