Over the last few months, I have noticed this cropping up more and more.

Machine name: rule_apply_ca_on_gst
Parameter: Line item (line_item)
Tags: Commerce Canadian Taxes, GST, ON
Error: Data selector line-item:commerce-product:field-sales-taxes-ca:field-sales-taxes-ca-on for parameter entity is invalid

I am seeing a bunch of the conditions losing their data comparison abilities. Specifically:

rule_apply_ca_nb_tppt
rule_apply_ca_on_hst
rule_apply_ca_on_gst
rule_apply_ca_ns_hst
commerce_tax_rate_calculate_ca_nb_tppt
commerce_tax_rate_calculate_ca_gst
commerce_tax_rate_calculate_ca_ns_hst
commerce_tax_rate_calculate_ca_on_hst

I haven't done much configuration changing in the last six months (since the last time I needed to rebuild the rules).

Anyone see this?

Comments

george esper’s picture

Have you tried clearing the cache?

Shane Birley’s picture

@george esper,

I have several times. Those two fields just up and vanished. I don't have any explanation as to why they are gone. I am a little bit at a standstill and I think part of the problem is the field_collection.module is not working properly either. You are not allowed to delete anything from the cart, etc.

I am looking for any insight I can find.

Shane Birley’s picture

I am also seeing some issues with the taxes and the Shipping. There is a solution in a previous issue posting that has a solution but it didn't seem to work this time.

Shane Birley’s picture

And I have money for anyone who can help figure this out or at least help me to identify what the real issue may be.

george esper’s picture

If you have access to a development environment, try uninstalling and reinstalling the module.

Shane Birley’s picture

@george esper,

I already did that too. I will try again since I am running low on ideas.

Shane Birley’s picture

In my travels today, I found this: https://www.drupal.org/node/2403851

george esper’s picture

I've read that others are having to revert to rules 2.7 as well. Perhaps that's the source of the problem.

Shane Birley’s picture

@george esper,

I will keep you in the loop with what i find.

Shane Birley’s picture

I have done to complete reinstalls now and everything tax related appears to install except Ontario and Nova Scotia. Twice in a row now...

Shane Birley’s picture

I am so confused as to why I am unable to get this working properly, I decided to create an entirely new web site to test this module and do a fresh installation of Drupal Commerce from scratch.

This module failed entirely. Every single rule returns as having an integrity check. I am sure this is something I have done but I found it very interesting that it fails out of the gate. Indicating that either this module is not working or there is a bug somewhere hiding and waiting to drive me insane.

I am using Rules 2.7 and the latest Field Collection.

I need help to fix this. I have money and pugs. You can have both.

Shane Birley’s picture

Back to my original installation. The testing of a new site was incredibly helpful... proves there is something very wrong with Commerce / Rules / Taxes.

I have returned to the original installation and have stayed up all night to led me to this: https://www.drupal.org/node/2324587

-- which means, yay, I am not crazy. There has been something wrong with Rules and the latest dev that was submitted a few days back appears to have fixed the firing problem (where most rules were not firing at all) problem with not some crazy work around.

This leaves the fields within this rule set not working properly.

Shane Birley’s picture

I am forced to conclude that something within Field Collection and/or Rules 2.x-dev has changed which has rendered this module useless. If anyone stumbles across this, DO NOT INSTALL IT. Another solution should be found.

I have done several tests on this module and combined it with very simple demo sites and each time this module is loaded, it tanks on installation now. I blame its dependencies more than this module but, as it stands now, this entire module will fail to function/install.

If anyone has any ideas, I am willing to help, but I have spent the better part of a week trying to make this work properly, but I can't.

UPDATE: The main problem appears to be with field collections.

hommesreponse’s picture

I'm suddenly having the same issue "Error: The utilized component rule_apply_ca_on_hst fails the integrity check." Worked fine a few weeks ago and then stopped working recently.

Are there any alternatives out there?

thekenshow’s picture

You can set up your own Canadian taxes by creating and configuring a sales tax rate (not VAT) for the federal GST, and then one for each province or territory, at /admin/commerce/config/taxes. For example:

GST Canada (Machine name: gst_canada)
Rate: .05
HST Newfoundland (Machine name: hst_newfoundland)
Rate: .13
HST New Brunswick (Machine name: hst_new_brunswick)
Rate: .13
HST Nova Scotia (Machine name: hst_nova_scotia)
Rate: .15
...

A Rules component will be created for each tax rate. Click the Configure component link beside the tax and do the following:

1. Click Add condition.
2. Select Order Address components comparison.
3. Enter site:current-cart-order as the Data selector.
4. Select Shipping Address as the Address.
5. Select Administrative area as the Address component.
6. Select Is one of as the comparison Operator (You can use Equals if only one province is affected.)
7. Enter the 2-character provinces (e.g., PE, NU), one per line, to which this tax should apply in the comparison Value.
8. Save.

This was tested on a Commerce Deploy site but should work on any Commerce site with taxes and shipping addresses enabled.

hommesreponse’s picture

Hi Ken,

Thanks for posting the manual instructions for creating the tax rules! I'm creating them now and I'm wondering why I need a "GST Canada" tax rate? Is that for selling products to people outside of Canada?