Like i said in the main subject, adding product with dynamic price (included vat) handled with rules does not recalculate taxes.
I did a simple sample with kickstart:
Adjust the price of some product of type Top to enable "included vat"
And include a pricing rule to simply change the price to 100€
Rule:
{ "rules_another_price" : {
"LABEL" : "Another price",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "commerce_line_item", "commerce_product_reference" ],
"ON" : { "commerce_product_calculate_sell_price" : [] },
"IF" : [
{ "entity_is_of_bundle" : {
"entity" : [ "commerce-line-item" ],
"type" : "commerce_line_item",
"bundle" : { "value" : { "product" : "product" } }
}
},
{ "data_is" : {
"data" : [ "commerce-line-item:commerce-product:type" ],
"value" : "tops"
}
}
],
"DO" : [
{ "commerce_line_item_unit_price_amount" : {
"commerce_line_item" : [ "commerce_line_item" ],
"amount" : "10000",
"component_name" : "base_price",
"round_mode" : "1"
}
}
]
}
}
Another consideration was to change de weight of the rules and flush the caches, but in my case was the same.
Taxes does not recalculate the modified price, any ideas?
Comments
Comment #2
7thkey commentedComment #3
rszrama commentedThis is really just how the system works - including VAT in the purchase price means that calculation happens on product load, which precedes the sell price calculation process. Might be we need a better solution for this, but can you use the action to clear out included taxes first, adjust the price, and then re-apply tax?
Comment #4
7thkey commentedThanks for the input @rszrama, finally found a solution like you said removing the included tax.
Something like this:
The unit_price_no_vat removes 21% of VAT translated to 1.21
Next to it I have another rule adjusting the price and later the rule "Calculate taxes: VAT".
Hope this helps anyone having similar problem.