Shipping Tax design flaw? We are having a huge problem here!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Apologies if that was reported earlier, I could not find any entry.
We are using v4.00

We have products prices tax-exclusive, so the Tax display type is "Excluding tax" and Prices include tax checkbox is NOT ticked.

Shipping estimates are received from Australia Post API, and those are tax-inclusive. Therefore we tick Shipping is taxable and tick Shipping price includes tax.

The shipping still shows excl tax and the checkout also puts tax on top of shipping charge.

I've done some debugging and see that Libraries\Nop.Services\Catalog\PriceFormatter.cs line Line 290 as well as other components do not have parameter telling what they are doing calculation for. Instead they rely on _workContext which is obviously not concerned with shipping tax settings.

Please tell me I don't understand how to configure the taxation properly, otherwise our project is in big trouble!
5 years ago
Set a breakpoint here in TaxService.cs, and see if it follows the expected path:
public virtual decimal GetShippingPrice(...
5 years ago
Hello New York.

I clicked the Estimate Shipping button and hit the breakpoint. When doing quick watch I see exactly same settings as in UI (see the end of this message).

In my view, the design flaw is that the TaxService.cs is clueless about what the tax is for and assumes var includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax; rather than conditionally applying it to either TaxDisplayType or ShippingPriceIncludesTax.

May be I don't understand the grand-design of the product, please advise. So far I can only think of a horrible hack like switch based on HttpContext.Request.Path=="/cart/estimateshipping" but that would require knowledge of every webpage that might use the service and surely there are pages that might require both TaxDisplayType and ShippingPriceIncludesTax for the same Request.

What do we do?

Best regards
Nick

-    _taxSettings  {Nop.Core.Domain.Tax.TaxSettings}  Nop.Core.Domain.Tax.TaxSettings
    ActiveTaxProviderSystemName  "Tax.FixedOrByCountryStateZip"  string
    AllowCustomersToSelectTaxDisplayType  false  bool
    DefaultTaxAddressId  2  int
    DefaultTaxCategoryId  2  int
    DisplayTaxRates  false  bool
    DisplayTaxSuffix  true  bool
    EuVatAllowVatExemption  false  bool
    EuVatAssumeValid  false  bool
    EuVatEmailAdminWhenNewVatSubmitted  false  bool
    EuVatEnabled  false  bool
    EuVatShopCountryId  6  int
    EuVatUseWebService  false  bool
    ForceTaxExclusionFromOrderSubtotal  false  bool
    HideTaxInOrderSummary  false  bool
    HideZeroTax  false  bool
    LogErrors  true  bool
    PaymentMethodAdditionalFeeIncludesTax  false  bool
    PaymentMethodAdditionalFeeIsTaxable  false  bool
    PaymentMethodAdditionalFeeTaxClassId  0  int
    PricesIncludeTax  false  bool
    ShippingIsTaxable  true  bool
    ShippingPriceIncludesTax  true  bool
    ShippingTaxClassId  2  int
    TaxBasedOn  DefaultAddress  Nop.Core.Domain.Tax.TaxBasedOn
    TaxBasedOnPickupPointAddress  false  bool
    TaxDisplayType  ExcludingTax  Nop.Core.Domain.Tax.TaxDisplayType
5 years ago
Yes, but _taxSettings.ShippingPriceIncludesTax is referenced later and passed as a parameter, so you need to step through the other method calls to see if it is being considered correctly.

        public virtual decimal GetShippingPrice(decimal price, bool includingTax, Customer customer, out decimal taxRate)
        {
...
            var priceIncludesTax = _taxSettings.ShippingPriceIncludesTax;
            return GetProductPrice(null, taxClassId, price, includingTax, customer,
                priceIncludesTax, out taxRate);
5 years ago
Yep, found the overload you were talking about, it is line 509, set breakpoint there. When the breakpoint is hit, the includingTax parameter value is false. Navigated up the call stack to line 498 with same includingTax parameter value. Going up call stack I am getting to the same line 483 overload which states "var includingTax = _workContext.TaxDisplayType == TaxDisplayType.IncludingTax;"

As I wrote before, my guess is that instead of _workContext.TaxDisplayType shipping should be using _workContext._taxSettings.ShippingPriceIncludesTax and perhaps ShippingIsTaxable.

_taxSettings is a private member, so the developer of GetShippingPrice method could not use it. Taken that the developer uses var even for bool, I am not surprised with the implementation.

The question is, how do we fix it? Can we even rely on substring Shipping in method names to assume that nothing but shipping uses the methods. Due to the architecture of nopCommerce Shift+F12 is of little help.
5 years ago
In the absence of any other suggestion should we declare that Shipping Tax Design/Implementation is officially defective?

I am not hearing anything to the contrary from the development team. I am also mot hearing whether there is intention to fix it or those using the product are on their own?
5 years ago
You set the Tax Display Type = Excluding Tax and have the display tax suffix checked. So all prices will show the excl tax, and if you have the shipping is taxable checked it will also show the shipping rate as excl tax.

You said that the Australia Post API returns the shipping estimates as tax-inclusive. So the rate that is returned includes the shipping charge and tax.

Now that shipping rate already includes the tax you don't want NopCommerce to tax the shipping again, so you uncheck Shipping is Taxable.
5 years ago
Hello daroker22,

The tax I am talking about is Goods and Services Tax (GST), similar to VAT. It is a legal requirement for it to be shown in invoices and other docs. What you are suggesting will not show GST included into the shipping component, but every Tax/Invoice I've seen in Australia has that.

Let's not confuse a service being taxable and whether the tax is included or excluded from the price. Shipping is taxable and in nopCommerce implementation tax inclusion/exclusion from price does not care what you set in the configuration, that's the fact you can see in the code yourselves.

Clearly it is a defect in nopCommerce product which puts users in serious trouble with law!
5 years ago
Hi fellow Aussi :)
You are correct, in Australia if you are GST Registered then you need to change GST on all services provided.
So the Shipping should also include GST (except where where you are selling products internationally then there is no GST on Shipping)
So the problem is about correctly reporting the GST paid by the Customer on the Invoice

Product $9.00
Shipping $1.00
-----------
Total $10.00
GST @ 10% = $1.00
Total (inc GST) = $11.00
5 years ago
Thank you for your support Yidna!

I would even include a snapshot of how GST looks at real invoice, but inserting images into posts here is difficult. If prices include GST, then it looks like:
Subtotal: $9.90
Shipping: $1.10
GST Included: 1.00
Order Total: $11.00

Anyway, the goods for sale may be priced before tax and shipping service priced as after tax. nopCommerce has settings to address that, but those settings are not implemented when shipping calculation is made.

commercerouter.com
Integration, EDI and bulk email messages routing

.
.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.