Jump to content

Price/VAT Question


cb2004

Recommended Posts

This is possible

It depends on how good your basic php skills are.

As a starter quick fix I'd suggest looking in includes/content/cart.inc.php and adding something along the lines of

$vatpart = $subTotal - ($subTotal / 1.175 );

$view_cart->assign("VAL_TAX",priceFormat($vatpart ));




would be better to maybe use the tax valus in the database which I think might be "$product[0]['percent']"



maybe around line 520 just after 


$subTotal = $subTotal + ($price * $quantity);

then add {VAL_TAX} into the cart template (skins/yourskin/styleTemplates/content/cart.tpl where you want it to appear.

You'll need to know some basic editing to get this done, but it should be a quick fix until you find a proper solution.

Ben

Link to comment
Share on other sites

Or maybe this one.....

This is for a flat tax of 25%, you may have to find the correct number for other values(0.8=25%)

around line 540 change to this one.

Find this line

$subTotal = $subTotal + ($price * $quantity);




And chang to this




$subTotal = $subTotal + ($price * $quantity);

$subTotal = $subTotal * 0.8;




and a few line more down.. find this




// work out tax

if($config['priceIncTax']==0 && $taxCustomer==1){

	

$lineTax = ($product[0]['percent'] / 100) * ($price * $quantity);

$tax = $tax + $lineTax;

}




And replace with this one




// work out tax

//if($config['priceIncTax']==0 && $taxCustomer==1){

	

$lineTax = ($product[0]['percent'] / 100) * ($price * $quantity);

$tax = $tax + $lineTax * 0.8;

//}

As far as i can se it show the price include tax and subtotal ex tax + tax gives you the total includ tax again..

At least this fix it for me...no need to change in templates sins it corretly passes on the correct value..

Fright cost and tax is not fixed in this...

Link to comment
Share on other sites

The fix i posted work as you first described. I have it working at my site. (http://bad.in.no)

It shows the price inc tax on all pages.

In checkout it show each product price inc tax.

Subtotal is ex tax

Plus tax on top of subtotal gives you the amount inc tax again.

It have only been tested with Print Order Form, but sins it is calulated within the order checkout system it should behave likly on all payment gateways unless there is an extra tax check within them to.

The only part that i havent got to work is the tax on the shipping part.

Link to comment
Share on other sites

Hi,

You have to find the correct number for 17,5% (0.8=25%) (100/125 for 25% and 100/117,5 for 17,5%)

Witch should be 0,8510638297872340425531914893617 (0,851064) for 17,5

Or use the correct calculation insted with the use of variables you have or create.

Link to comment
Share on other sites

Hi,

You have to find the correct number for 17,5% (0.8=25%) (100/125 for 25% and 100/117,5 for 17,5%)

Witch should be 0,8510638297872340425531914893617 (0,851064) for 17,5

Or use the correct calculation insted with the use of variables you have or create.

Cheers for your help with this. It didnt work though unfortunately. With 1 product it does. Anymore and the tax throws a wobbly.

Link to comment
Share on other sites

Try this one and se if it is better....looks better here now, but havent tested it so mutch..

Find this around line 630

:rolly: Wrong number, should be 0.1489361702127659574468085106383 to show tax part :lol: And on line 650 find this code

if($tax>0){

		

		$view_cart->assign("VAL_TAX",priceFormat($tax));

		

	

	} else {

		

		$view_cart->assign("VAL_TAX",$lang['front']['cart']['na']);




Add this line just before this code




$tax = $subTotal * 0.8510638297872340425531914893617;


 
$grandTotal = $subTotal + $tax + $basket['shipCost'];




and change to this




$grandTotal = $subTotal + $basket['shipCost'];

And change the langauga variable "tax" to show "herby VAT of" or somthing like that to show that this is the tax part of the total.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...