Author: diveshdutta
Date: Mon Jul 4 18:07:11 2016
New Revision: 1751362
URL:
http://svn.apache.org/viewvc?rev=1751362&view=revLog:
[OFBIZ-7576] Fixed: Pricing error in Variant Products when setup with VAT-Tax and price set on Virtual Product. Thanks Peter Arnold for reporting this issue and thanks Ankush Upadhyay for providing the solution
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=1751362&r1=1751361&r2=1751362&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Mon Jul 4 18:07:11 2016
@@ -430,10 +430,21 @@ public class TaxAuthorityServices {
"taxAuthPartyId", taxAuthPartyId, "taxAuthGeoId", taxAuthGeoId,
"productPricePurposeId", "PURCHASE")
.orderBy("-fromDate").filterByDate().queryFirst();
+
+
+ if (productPrice == null) {
+ GenericValue virtualProduct = ProductWorker.getParentProduct(product.getString("productId"), delegator);
+ if (virtualProduct != null) {
+ productPrice = EntityQuery.use(delegator).from("ProductPrice")
+ .where("productId", virtualProduct.get("productId"),
+ "taxAuthPartyId", taxAuthPartyId, "taxAuthGeoId", taxAuthGeoId,
+ "productPricePurposeId", "PURCHASE")
+ .orderBy("-fromDate").filterByDate().queryFirst();
+ }
+ }
//Debug.logInfo("=================== productId=" + product.getString("productId"), module);
//Debug.logInfo("=================== productPrice=" + productPrice, module);
}
-
GenericValue taxAdjValue = delegator.makeValue("OrderAdjustment");
if (productPrice != null && "Y".equals(productPrice.getString("taxInPrice"))) {