Author Topic: [fixed] Tax by State  (Read 6018 times)

arcticsoft

  • Beginner
  • *
  • Posts: 7
[fixed] Tax by State
« on: October 19, 2011, 02:36:28 am »
Hi,
I am trying to set up a tax rule to calculate tax per state but have encountered a problem. If the user hasn't logged in or if user hasn't provided billing address I was expecting to see no tax but it is actually adding the tax for all states.
For instance.
If the product price is 100.00 and tax for state1 is 5% and for state2 is 7% then calculated tax is 12%. As soon as I pick state1 or state2 in the billing address, the tax calculates as it should.

Am I missing something?

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9856
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Tax by State
« Reply #1 on: October 19, 2011, 13:16:49 pm »
no, you did afaik everthing right, interesting behaviour, I need to take a look on it.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

arcticsoft

  • Beginner
  • *
  • Posts: 7
Re: Tax by State
« Reply #2 on: October 25, 2011, 03:21:45 am »
Tried with the latest release (2.0.0-RC-2j) and still having the problem.
I have different tax rates by state. If the bill to address is not in any of the states I have rules for, it is applying all tax rates (sum of all rates).

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9856
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Tax by State
« Reply #3 on: October 27, 2011, 13:50:59 pm »
I have fixed it. Is in the svn, this evening
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

cas

  • Jr. Member
  • **
  • Posts: 487
Re: [fixed] Tax by State
« Reply #4 on: November 09, 2011, 08:23:09 am »
Hi Milbo,

I'm using version M, and in the shopping cart it is still showing the tax amount when the user is not logged in.  Shouldn't the tax be zero when not logged in?

Thanks,
Chuck 

arcticsoft

  • Beginner
  • *
  • Posts: 7
Re: [fixed] Tax by State
« Reply #5 on: November 11, 2011, 03:56:56 am »
The same here.  If not logged in, it is still showing all taxes
What was the fix mentioned in the previous post?

chancehoggan

  • Beginner
  • *
  • Posts: 38
    • http://www.escocian.ca/
Re: [fixed] Tax by State
« Reply #6 on: November 20, 2011, 04:21:40 am »
Hi,

Firstly thanks for all the hardwork put into VM2!

I have upgraded to the latest version and it seems all the tax rules are applied. If i select 1 default tax rule for the companies local province and the user enters an address outside this province it will apply no taxes.

If I do not define a specific tax code it still adds all the taxes for all provinces and countries together and creates a rather expensive tax price!

chancehoggan

  • Beginner
  • *
  • Posts: 38
    • http://www.escocian.ca/
Re: [fixed] Tax by State
« Reply #7 on: November 20, 2011, 04:22:47 am »
If I modify the core the system will break on updates.

Any info you can provide on the fix above would be a big help.

ptogel

  • Jr. Member
  • **
  • Posts: 61
    • Keux Galleries, LLC
Re: [fixed] Tax by State
« Reply #8 on: January 05, 2012, 18:36:23 pm »
I still have that problem. Taxes are calculated if the user is not registered or when registered. They should calculate only if in South Carolina. What doe we miss? I have VM 2.0.0.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9856
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [fixed] Tax by State
« Reply #9 on: January 05, 2012, 21:01:00 pm »
I need backend access to understand this.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

agaudreau

  • Beginner
  • *
  • Posts: 4
Re: [fixed] Tax by State
« Reply #10 on: January 08, 2012, 21:19:43 pm »
I have the same problem.. All taxes are being added in the cart and once I log in to a user, they are all still there even though my tax codes are set up per province, using VM 2.0.0 on Joomla 1.7.3

I will provide backend access for you via PM.

cas

  • Jr. Member
  • **
  • Posts: 487
Re: [fixed] Tax by State
« Reply #11 on: January 08, 2012, 21:43:11 pm »
I had this same problem, and I fixed it by going into the Tax & Calculation Rules and editing the Tax rule by selecting 'default' for the Shopper Group.    This way users who are not logged in get assigned the 'anonymous' Shopper Group and no tax is calculated for them.  When a user is logged in, they get assigned the 'default' Shopper Group and the tax rule is appropriately applied if the user is from that state/province.   

I agree the system should check if the user is not logged in and just skip the tax rules for users not logged in, but until that gets changed someday, for now you can simply assign the 'default' user to the Shopper Group in the tax rule, and it will work properly.

agaudreau

  • Beginner
  • *
  • Posts: 4
Re: [fixed] Tax by State
« Reply #12 on: January 08, 2012, 23:24:51 pm »
That did the trick. Thanks Cas!


cas

  • Jr. Member
  • **
  • Posts: 487
Re: [fixed] Tax by State
« Reply #13 on: January 08, 2012, 23:35:59 pm »
Glad to help!  I know I suffered a long time with this one too.   After seeing how many of us are having this same problem, I hope the VM developers will add the simple logic to not calculate tax if no one is logged in, or at least set the Tax rule Shopper Group to 'default' when it's created. 

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10352
  • VirtueMart Version: 3+
Re: [fixed] Tax by State
« Reply #14 on: January 20, 2012, 21:52:39 pm »
Shopper group fix did not work for me, because I let some checkout as guest.

This will hide something if a user has not put in their address yet. (IN THE CART VIEW)

<?php if (!empty($this->cart->BT)){

}

Just wrap whatever with that.

For example

if (!empty($this->cart->BT)){
      foreach($this->cart->cartData['DATaxRulesBill'] as $rule){ ?>
         <tr class="sectiontableentry<?php $i ?>">
            <td colspan="4" align="right"><?php echo   $rule['calc_name'] ?> </td>

                                     <?php if ( VmConfig::get('show_tax')) { ?>
            <td align="right"><?php  ?> </td>
                                <?php } ?>
            <td align="right"><?php echo  $this->cart->prices[$rule['virtuemart_calc_id'].'Diff'];   ?> </td>
            <td align="right"><?php echo $this->cart->prices[$rule['virtuemart_calc_id'].'Diff'];   ?> </td>
         </tr>
         <?php
         if($i) $i=1; else $i=0;
      } }?>


^^^^^

PLEASE dont forget that the total is going to be wrong. BECAUSE the tax will be added to it.

hide the total when address is not filled in. default_pricelist.php


      <?php if (!empty($this->cart->BT)){ ?>  <tr class="sectiontableentry2">
         <td colspan="4" align="right"><?php echo JText::_('COM_VIRTUEMART_CART_TOTAL') ?>: </td>

                        <?php if ( VmConfig::get('show_tax')) { ?>
         <td align="right"> <?php echo "<span  style='color:gray'>".$this->cart->prices['billTaxAmount']."</span>" ?>

</td>
                        <?php } ?>
         <td align="right"> <?php echo "<span  style='color:gray'>".$this->cart->prices

['billDiscountAmount']."</span>" ?> </td>
         <td align="right"><strong><?php echo $this->cart->prices['billTotal'] ?></strong></td>
        </tr> <?php } ?>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)