Jump to content

[FIXED] Tax still shown on cart page for tax exempt customers


Recommended Posts

Open viewcart.tpl and add $loggedin to a couple of lines there

here is an example of what I did in mine on the web20cart template

{if $loggedin}

<tr class="carttablesummary">

<td align="right">{$LANG.ordersubtotal}:  </td>

<td align="center">{$subtotal}</td>

</tr>

{/if}

{if $promotioncode}

<tr class="carttablepromotion">

<td align="right">{$promotiondescription}:  </td>

<td align="center">{$discount}</td>

</tr>

{/if}

{if $taxrate && $loggedin}

<tr class="carttablesummary">

<td align="right">{$taxname} @ {$taxrate}%:  </td>

<td align="center">{$taxtotal}</td>

</tr>

{/if}

{if $taxrate2 && $loggedin}

<tr class="carttablesummary">

<td align="right">{$taxname2} @ {$taxrate2}%:  </td>

<td align="center">{$taxtotal2}</td>

</tr>

{/if}

<tr class="carttabledue">

<td align="right">{$LANG.ordertotalduetoday}:  </td>

<td align="center">{$total}</td>

</tr>

Link to comment
Share on other sites

Open viewcart.tpl and add $loggedin to a couple of lines there

here is an example of what I did in mine on the web20cart template

 

Looking at that it does not do anything to improve the situaton, all it does is hide the tax lines if the user is not logged in, it still shows the tax inclusive total prices and still ignores the tax exempt setting.

 

If anything it makes it worse. Sorry nice try but not a solution i'm afraid.

Link to comment
Share on other sites

It works for me because I include the tax in my prices. I just hide the sub-total and tax lines unless loggedin.

 

You could always hide the tax lines as above and on the total use

 

<tr class="carttabledue">

<td align="right">{$LANG.ordertotalduetoday}:  </td>

<td align="center">{if $loggedin}{$total}{else}{$subtotal}{/if}</td>

</tr>

Edited by sparky
Link to comment
Share on other sites

It does not matter if you include tax in your prices or not, this is about legality, if you are charging tax and selling to someone outside your tax zone (Someone tax exempt) then you MUST NOT charge Tax to that customer.

 

You are essentially running an illegal business if you are simply hiding the tax amount from tax exempt customers when you should actually be deducting it, plus I suspect that your invoices will be showing a different amount anyway as they will work properly i;d hope.

 

If anyone wants a proper solution to this issue I have bodged together a script than recalculates the cart values for tax exempt customers..

 

Replace the following in your viewcart.tpl

 

{if $taxrate}
     <tr class="carttablesummary">
       <td align="right">{$taxname} @ {$taxrate}%:  </td>
       <td align="center">{$taxtotal}</td>
     </tr>
     {/if}
     {if $taxrate2}
     <tr class="carttablesummary">
       <td align="right">{$taxname2} @ {$taxrate2}%:  </td>
       <td align="center">{$taxtotal2}</td>
     </tr>
     {/if}
     <tr class="carttabledue">
       <td align="right">{$LANG.ordertotalduetoday}:  </td>
       <td align="center">{$total}</td>
     </tr>
     {if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
     <tr class="carttablerecurring">
       <td align="right">{$LANG.ordertotalrecurring}:  </td>
       <td align="center">{if $totalrecurringmonthly}{$totalrecurringmonthly} {$LANG.orderpaymenttermmonthly}<br />
         {/if}
         {if $totalrecurringquarterly}{$totalrecurringquarterly} {$LANG.orderpaymenttermquarterly}<br />
         {/if}
         {if $totalrecurringsemiannually}{$totalrecurringsemiannually} {$LANG.orderpaymenttermsemiannually}<br />
         {/if}
         {if $totalrecurringannually}{$totalrecurringannually} {$LANG.orderpaymenttermannually}<br />
         {/if}
         {if $totalrecurringbiennially}{$totalrecurringbiennially} {$LANG.orderpaymenttermbiennially}<br />
         {/if}</td>
     </tr>
     {/if}

 

with

 

{if $clientsdetails.taxexempt eq "on"}
 		{php}
      		function scur($val,$c){
           	$val = str_replace($c["code"],"", $val);
               $val = str_replace($c["prefix"],"", $val);
               return $val;
           }
           function fcur($val,$c,$r){
          	  $val = ($val * 100) / ($r+100);
          	  $val = $c["prefix"] . number_format($val, 2) . $c["code"];
             return $val;
           }

       	$c = $this->get_template_vars('currency');
    		$r = $this->get_template_vars('taxrate');

 			$total_lesstax = fcur(scur($this->get_template_vars('total'),$c),$c,$r);
 			$totalrecurringmonthly_lesstax = fcur(scur($this->get_template_vars('totalrecurringmonthly'),$c),$c,$r);
           $totalrecurringquarterly_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r);
           $totalrecurringsemiannually_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r);
           $totalrecurringannually_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r);
           $totalrecurringbiennially_lesstax = fcur(scur($this->get_template_vars('totalrecurringbiennially'),$c),$c,$r);
 		{/php}
     <tr class="carttabledue">
       <td align="right">{$LANG.ordertotalduetoday}:  </td>
       <td align="center">{php}echo $total_lesstax;{/php}</td>
     </tr>
     {if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
     <tr class="carttablerecurring">
       <td align="right">{$LANG.ordertotalrecurring}:  </td>
       <td align="center">{if $totalrecurringmonthly}{php}echo $totalrecurringmonthly_lesstax;{/php} {$LANG.orderpaymenttermmonthly}<br />
         {/if}
         {if $totalrecurringquarterly}{php}echo $totalrecurringquarterly_lesstax;{/php} {$LANG.orderpaymenttermquarterly}<br />
         {/if}
         {if $totalrecurringsemiannually}{php}echo $totalrecurringsemiannually_lesstax;{/php} {$LANG.orderpaymenttermsemiannually}<br />
         {/if}
         {if $totalrecurringannually}{php}echo $totalrecurringannually_lesstax;{/php} {$LANG.orderpaymenttermannually}<br />
         {/if}
         {if $totalrecurringbiennially}{php}echo $totalrecurringbiennially_lesstax;{/php} {$LANG.orderpaymenttermbiennially}<br />
         {/if}</td>
     </tr>
     {/if}
 {else}
     {if $taxrate}
     <tr class="carttablesummary">
       <td align="right">{$taxname} @ {$taxrate}%:  </td>
       <td align="center">{$taxtotal}</td>
     </tr>
     {/if}
     {if $taxrate2}
     <tr class="carttablesummary">
       <td align="right">{$taxname2} @ {$taxrate2}%:  </td>
       <td align="center">{$taxtotal2}</td>
     </tr>
     {/if}
     <tr class="carttabledue">
       <td align="right">{$LANG.ordertotalduetoday}:  </td>
       <td align="center">{$total}</td>
     </tr>
     {if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
     <tr class="carttablerecurring">
       <td align="right">{$LANG.ordertotalrecurring}:  </td>
       <td align="center">{if $totalrecurringmonthly}{$totalrecurringmonthly} {$LANG.orderpaymenttermmonthly}<br />
         {/if}
         {if $totalrecurringquarterly}{$totalrecurringquarterly} {$LANG.orderpaymenttermquarterly}<br />
         {/if}
         {if $totalrecurringsemiannually}{$totalrecurringsemiannually} {$LANG.orderpaymenttermsemiannually}<br />
         {/if}
         {if $totalrecurringannually}{$totalrecurringannually} {$LANG.orderpaymenttermannually}<br />
         {/if}
         {if $totalrecurringbiennially}{$totalrecurringbiennially} {$LANG.orderpaymenttermbiennially}<br />
         {/if}</td>
     </tr>
     {/if}
   {/if}

 

Hope that helps although idealy WHMCS will fix this soon.

Link to comment
Share on other sites

As small update to include the second tax rate if any of you guys use it.

 

I'm not sure how compound taxation should be applied so I just added the rates and removed them from the inclusive price. Someone might want to test it fully although seems to work on my setup.

 


{if $clientsdetails.taxexempt eq "on"}
 		{php}
      		function scur($val,$c){
           	$val = str_replace($c["code"],"", $val);
               $val = str_replace($c["prefix"],"", $val);
               return $val;
           }
           function fcur($val,$c,$r1,$r2){
          	  $val = ($val * 100) / ($r2+$r1+100);
          	  $val = $c["prefix"] . number_format($val, 2) . $c["code"];
             return $val;
           }

       	$c = $this->get_template_vars('currency');
    		$r1 = $this->get_template_vars('taxrate');
           $r2 = $this->get_template_vars('taxrate2');

 			$total_lesstax = fcur(scur($this->get_template_vars('total'),$c),$c,$r1,$r2);
 			$totalrecurringmonthly_lesstax = fcur(scur($this->get_template_vars('totalrecurringmonthly'),$c),$c,$r1,$r2);
           $totalrecurringquarterly_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r1,$r2);
           $totalrecurringsemiannually_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r1,$r2);
           $totalrecurringannually_lesstax = fcur(scur($this->get_template_vars('totalrecurringquarterly'),$c),$c,$r1,$r2);
           $totalrecurringbiennially_lesstax = fcur(scur($this->get_template_vars('totalrecurringbiennially'),$c),$c,$r1,$r2);
 		{/php}
     <tr class="carttabledue">
       <td align="right">{$LANG.ordertotalduetoday}:  </td>
       <td align="center">{php}echo $total_lesstax;{/php}</td>
     </tr>
     {if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
     <tr class="carttablerecurring">
       <td align="right">{$LANG.ordertotalrecurring}:  </td>
       <td align="center">{if $totalrecurringmonthly}{php}echo $totalrecurringmonthly_lesstax;{/php} {$LANG.orderpaymenttermmonthly}<br />
         {/if}
         {if $totalrecurringquarterly}{php}echo $totalrecurringquarterly_lesstax;{/php} {$LANG.orderpaymenttermquarterly}<br />
         {/if}
         {if $totalrecurringsemiannually}{php}echo $totalrecurringsemiannually_lesstax;{/php} {$LANG.orderpaymenttermsemiannually}<br />
         {/if}
         {if $totalrecurringannually}{php}echo $totalrecurringannually_lesstax;{/php} {$LANG.orderpaymenttermannually}<br />
         {/if}
         {if $totalrecurringbiennially}{php}echo $totalrecurringbiennially_lesstax;{/php} {$LANG.orderpaymenttermbiennially}<br />
         {/if}</td>
     </tr>
     {/if}
 {else}
     {if $taxrate}
     <tr class="carttablesummary">
       <td align="right">{$taxname} @ {$taxrate}%:  </td>
       <td align="center">{$taxtotal}</td>
     </tr>
     {/if}
     {if $taxrate2}
     <tr class="carttablesummary">
       <td align="right">{$taxname2} @ {$taxrate2}%:  </td>
       <td align="center">{$taxtotal2}</td>
     </tr>
     {/if}
     <tr class="carttabledue">
       <td align="right">{$LANG.ordertotalduetoday}:  </td>
       <td align="center">{$total}</td>
     </tr>
     {if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
     <tr class="carttablerecurring">
       <td align="right">{$LANG.ordertotalrecurring}:  </td>
       <td align="center">{if $totalrecurringmonthly}{$totalrecurringmonthly} {$LANG.orderpaymenttermmonthly}<br />
         {/if}
         {if $totalrecurringquarterly}{$totalrecurringquarterly} {$LANG.orderpaymenttermquarterly}<br />
         {/if}
         {if $totalrecurringsemiannually}{$totalrecurringsemiannually} {$LANG.orderpaymenttermsemiannually}<br />
         {/if}
         {if $totalrecurringannually}{$totalrecurringannually} {$LANG.orderpaymenttermannually}<br />
         {/if}
         {if $totalrecurringbiennially}{$totalrecurringbiennially} {$LANG.orderpaymenttermbiennially}<br />
         {/if}</td>
     </tr>
     {/if}
   {/if}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated