Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Taylor 873 posts 2086 karma points
    Jan 19, 2012 @ 20:55
    Matt Taylor
    0

    Dynamic VAT

    I'm hoping to implement dynamic VAT as illustrated in this blog entry however setting the order.VATGroupID is having no effect.

    I've two VAT groups defined:

    1) VAT = 20%
    2) 0% = 0%

    Setting the order's VATGroupID = 2 is still adding VAT of 20%.

    Regards,

    Matt

  • Anders Burla 2560 posts 8256 karma points
    Jan 19, 2012 @ 21:49
    Anders Burla
    0

    Hi Matt

    Do you have a VAT group defined for your products? Sounds weird as the code in the blog is actually some code we use in production :)
    Is your new vatgroup id saved in the db?

    Kind regards
    Anders

  • Matt Taylor 873 posts 2086 karma points
    Jan 19, 2012 @ 22:47
    Matt Taylor
    0

    The VAT group is set on the Master product only. Set as group 1 (VAT).

    Yes the new group is in the DB.

    I can now see that the orders VAT Group is getting set correctly (I've written it to the screen) and, the ManipulatedVATGroupID field on the order is being set to 2 (0%) in the DB.

    The ManipulatedVATGroupID field on the order lines remain as 1 (VAT).

    What's confusing me is although the order's VAT has been set to group 2 (0% = 0% for all countries) the value of order.TotalVATFormatted is 158,33 Euro as shown below.

    Cheers, Matt

     

  • Anders Burla 2560 posts 8256 karma points
    Jan 20, 2012 @ 08:34
    Anders Burla
    0

    Hi Matt

    You also have to set the VAT group for the orderlines - because an orderlines can have its own special VAT group. Try and set it and see if it works. Did you somewhere in your code previous set the VAT group id for the orderlines - because these should "inherit" from the order if not specific is set for the orderline.

    Kind regards
    Anders

  • Matt Taylor 873 posts 2086 karma points
    Jan 20, 2012 @ 14:26
    Matt Taylor
    0

    Hi Anders,

    I understand more about how the VAT Group stuff works now.
    Each product had its VAT Group configured to 1 (VAT) in the content so that was overriding the VAT Group on the order.
    I thought every product needed this to be set but now that I know it will inherit its value from the order if it's not I can see that it is best left blank in most cases.

    Anyway, deselecting the VAT Group from the products has produced the required results.

    Cheers,

    Matt

     

Please Sign in or register to post replies

Write your reply to:

Draft