close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to properly add tax of shipping costs?

Thread began 3/09/2010 6:11 am by jernej | Last modified 3/12/2010 8:02 pm by Jason Byrnes | 762 views | 3 replies |

jernej

How to properly add tax of shipping costs?

Hi there

In my country we have 2 taxes, 8.5% and 20%. The postage goes in 20% tax.

Now I have a shopping cart and let's say we have postage 2 €. That is total, postage + 20% tax. So I added a shipping rule of flat rate at 1.67 €.

What I need to do now is to say e-cart this postage acts like an item or something, because I have to add the 0.33 € to the taxable total of 20% tax. Using the checkbox to include postage to taxable total didn't work, maybe because we have 2 tax rules, how would ecart know I need to make a tax added to the 20% rule?

I can "hack" e-cart rule to manually add the 0.33 to the sales tax, but because we have 3 postages (I was talking of 2 € just for the example), I can not make that a flat rule. The worst part is if I mungle with tax in eCart1_VB.asp and add the shipping totals to the rule manually every time I open the ecart GUI my postage rules are rewritten, so this is not a good option.

How is the proper way to do this? There must be a way to say to the tax rule I want my postage rules to be included in tax and in which tax? Can I make a calculation for this?

This is puzzling me for 6+ months, I have "solved" this by manually tweaking the tax rules, but it has done more bad than good as I have to copy paste back my shipping rules every time I change something.

The problem I see lies in the fact I can not use the TaxableTotal as in my country I have to state separately the 8.5% tax and the 20% tax, so I need 2 rules which takes values from my item price * tax totals, not the taxable totals. Taxable totals work ok only if you need total of paid tax, but I need 2 different taxes to show in cart and the postage must be added to one of them (20% one).

Thank you for your help

Yours

Jernej

PS - I have eCart 4.5.2 with ASP

Sign in to reply to this post

Jason ByrnesWebAssist

I will need some more information to be able to come up with a solution.

From what you are describing, your question is basically: How to calculate 20% of the Postage.

How are you calculating postage? What is the rule you are using for postage? This will help me determine how to calculate the 20% tax.

Sign in to reply to this post

jernej

Thanx. I know how to calculate 20% of the postage, but how to add 20% of the postage to the TAX calculation is my question? Because I have 2 tax-es (8.5 and 20%) and the postage falls into 20% one.

So if I make a postage rule and tick the option to include it into tax, it works. But works only in Taxable total. So taxable total carries the tax for the postage. But I need it to go to the 20% tax rule, not taxable total...

I've come today with some kind of solution (half), to add to my 20% tax rule the postage calculations * 0.20.

I'll write here all my relevant rules, so perhaps you can see what I am trying to do. This works now, but it is not a good solution:

Here are the 3 postages:

<%
function WAEC_eCart1_PostninaPravne1()
totalShipping = 0
if (true AND ((UBound(eCart1.Items) > 0))) then
totalShipping = totalShipping + 1.67'Result
end if
WAEC_eCart1_PostninaPravne1 = WA_eCart_FormatNumber(totalShipping, eCart1.ForceDecimalsC, eCart1.DecimalPlacesC)
end function
%>
<%
function WAEC_eCart1_PostninaPravne2()
totalShipping = 0
if (true AND ((cStr(Session("tip")) = "1") AND (WA_eCart_TotalColumn(eCart1, "Quantity") > 5))) then
totalShipping = totalShipping + 1.67'Result
end if
WAEC_eCart1_PostninaPravne2 = WA_eCart_FormatNumber(totalShipping, eCart1.ForceDecimalsC, eCart1.DecimalPlacesC)
end function
%>
<%
function WAEC_eCart1_PostninaPravne3()
totalShipping = 0
if (true AND ((cStr(Session("tip")) = "1") AND (WA_eCart_TotalColumn(eCart1, "Quantity") > 10))) then
totalShipping = totalShipping + 2.5'Result
end if
WAEC_eCart1_PostninaPravne3 = WA_eCart_FormatNumber(totalShipping, eCart1.ForceDecimalsC, eCart1.DecimalPlacesC)
end function
%>

Here are both taxes:

<%
function WAEC_eCart1_SalesTax8()
totalTax = 0
if (true AND ((WA_eCart_ConditionalTotal(eCart1, "Quantity", "Tax", "0,085") > 0))) then
totalTax = totalTax + (WA_eCart_ConditionalTotal(eCart1, "DDVSkupaj", "Tax", "0,085"))'Result
end if
WAEC_eCart1_SalesTax8 = WA_eCart_FormatNumber(totalTax, eCart1.ForceDecimalsC, eCart1.DecimalPlacesC)
end function
%>
<%
function WAEC_eCart1_SalesTax20()
totalTax = 0
if (true AND ((WA_eCart_ConditionalTotal(eCart1, "Quantity", "Tax", "0,2") > 0) OR (( cDbl(WA_eCart_GetShipping(eCart1))>0 )))) then
totalTax = totalTax + (WA_eCart_ConditionalTotal(eCart1, "DDVSkupaj", "Tax", "0,20"))+cDbl(WA_eCart_GetShipping(eCart1))*0.20'Result
end if
WAEC_eCart1_SalesTax20 = WA_eCart_FormatNumber(totalTax, eCart1.ForceDecimalsC, eCart1.DecimalPlacesC)
end function
%>

The DDVSkupaj is the [Price] * [Tax] as I have in database neto price and tax value (0.2 or 0.085)

Now this kind of works, but is it smart to add custom function to 20% tax:totalTax = totalTax + (WA_eCart_ConditionalTotal(eCart1, "DDVSkupaj", "Tax", "0,20"))+cDbl(WA_eCart_GetShipping(eCart1))*0.20

As you see I had to use the custom function to add the GetShipping(ecart1)*0.20


The problem I see with ecart here is that it assumes all tax is in one value that is represented in taxable total. Here in Slovenia we have to specify in orders the 8.5% tax and 20% tax SEPARATELY. So taxable total doesn't help and so the check box to incude postage in tax doesn't help me.

I hope it is more clear now, but I am not sure :-)

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of the unedited cart include php file instead of posting the code here, so I can work directly with the calculations an reproduce the cart?

to attach the php file, compress it to a .zip archive and send the zip file with your reply.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...