Copied to clipboard

Flag this post as spam?

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


  • Sam Flanagan 47 posts 147 karma points
    Nov 20, 2017 @ 11:32
    Sam Flanagan
    0

    Coupon discounts not included in product based tax calculation

    Hi

    We are setting up a UK store with taxes applied to > Product and taxes > included in product pricing.

    We have swapped to the ProductBasedTaxationInvoiceItemazationStrategy in merchello.config and can see how the ProductBasedTaxationVisitor is splitting the product price and the tax, which looks OK.

    Up to this point, everything is working as we would expect.

    However, when a discount coupon is added, the total tax (VAT) appears to be calculated on the full product price and not on the discount price after the coupon is applied. This results in the total VAT calculation being incorrect.

    We've noticed that the ProductBasedTaxationVisitor has a comment saying "// TODO merchCouponAdjustedProductPreTaxTotal" - is this the missing step that would result in the correct tax calculation when there is a discount coupon?

    We've made our own copy of the ProductBasedTaxationInvoiceItemazationStrategy and ProductBasedTaxationVisitor so we can implement a custom version, as required. However, we can't see any way to lookup the value for merchCouponAdjustedProductPreTaxTotal from within the ProductBasedTaxationVisitor. For example, how could we pass in the merchCouponAdjustedProductPreTaxTotal to clone.Price = ConvertToDecimal(item.ExtendedData.GetValue(priceKey))? Would this be the recommended approach?

    Many thanks

    Sam

  • Lee 1113 posts 3047 karma points
    Nov 22, 2017 @ 06:42
    Lee
    0

    You will need to work out the calculation yourself in the visitor. I haven't looked at this yet myself, but would check in the extended data collection for the incoming ILineItem. There will be something in there for either the discount line item or the product line item. It may not be called merchCouponAdjustedProductPreTaxTotal but I would expect something to be there.

  • Sam Flanagan 47 posts 147 karma points
    Nov 22, 2017 @ 08:38
    Sam Flanagan
    0

    Hi Lee.

    For Product type ILineItems in the Visitor, we're not seeing merchCouponAdjustedProductPreTaxTotal or any other value in extended data that corresponds to a discount adjusted price.

    However, if we inspect ILineItems of type Discount we can see a value for merchCouponAdjustedProductPreTaxTotal. The problem then, is that we can't see any relationship between the Discount ILineItem and the Product ILineItem that would allow us to lookup/reference the discount adjusted product price. The ProductBasedTaxationVisitor in the Merchello source code doesn't process ILineItems of type Discount and we can't seem to lookup a related discount from on a product from within the visitor.

    I think the question is - how would we implement the "// TODO merchCouponAdjustedProductPreTaxTotal" in the ProductBasedTaxationVisitor?

    Many thanks

    Sam

  • Puck Holshuijsen 79 posts 298 karma points
    Apr 26, 2018 @ 10:03
    Puck Holshuijsen
    0

    Hi Sam,

    Did you figure this out? I am running into the same problems at the moment!

    Thanks

    Puck

  • Sam Flanagan 47 posts 147 karma points
    Apr 26, 2018 @ 18:04
    Sam Flanagan
    0

    Hi Puck

    Unfortunately, no. In the end this was a show stopper for the project.

    Sorry I couldn't help further.

    Cheers

    Sam

  • Puck Holshuijsen 79 posts 298 karma points
    Apr 30, 2018 @ 06:29
    Puck Holshuijsen
    0

    Hi Sam,

    Damn! Thanks anyway

    Puck

  • Dan 1243 posts 3708 karma points admin c-trib
    Jul 10, 2018 @ 14:43
    Dan
    0

    Another one here for whom this is a show-stopper.

Please Sign in or register to post replies

Write your reply to:

Draft