You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by di...@apache.org on 2016/07/04 18:07:11 UTC

svn commit: r1751362 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java

Author: diveshdutta
Date: Mon Jul  4 18:07:11 2016
New Revision: 1751362

URL: http://svn.apache.org/viewvc?rev=1751362&view=rev
Log:
[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"))) {