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 :-)