Fixed: Tax calculation not considering productStoreGroup
As reported by Ingo the productStoreId field does not exist in the ProductPrice
entity, it's productStoreGroupId. This fixes it
Thanks: Ingo for issue report
@@ -656,22 +656,13 @@ public class TaxAuthorityServices {
*/
private static GenericValue getProductPrice(Delegator delegator, GenericValue product, GenericValue productStore, String taxAuthGeoId,
String taxAuthPartyId) throws GenericEntityException {
- if (UtilValidate.isNotEmpty(productStore.getString("primaryStoreGroupId"))) {
return EntityQuery.use(delegator).from("ProductPrice")
.where("productId", product.get("productId"),
"taxAuthPartyId", taxAuthPartyId,
"taxAuthGeoId", taxAuthGeoId,
"productPricePurposeId", "PURCHASE",
- "productStoreId", productStore.get("primaryStoreGroupId"))
+ "productStoreGroupId", productStore.get("primaryStoreGroupId"))
.orderBy("-fromDate").filterByDate().queryFirst();
- } else {
- return EntityQuery.use(delegator).from("ProductPrice")
- .where("productId", product.get("productId"),
- "taxAuthPartyId", taxAuthPartyId,
- "taxAuthGeoId", taxAuthGeoId,
- "productPricePurposeId", "PURCHASE")
- .orderBy("-fromDate").filterByDate().queryFirst();
- }
}
/**
