You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2024/02/22 11:48:56 UTC
(ofbiz-framework) branch release18.12 updated (efeb87ff9c -> 549910411e)
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a change to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
from efeb87ff9c Improved: Add CHANGELOG.adoc file (OFBIZ-11839)
new 59e2a8e4fe Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
new c419a774cb Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
new 1f40d4c81b Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
new 549910411e Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../ofbiz/accounting/tax/TaxAuthorityServices.java | 24 +++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
(ofbiz-framework) 01/04: Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 59e2a8e4fe0eb0fc57f409c0a60d73a6e983ac2d
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Fri Aug 26 19:28:21 2022 +0200
Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
For one product I have different prices according to the product store:
B2C store: taxinPrice = Y
B2B store: taxinPrice = N
The tax calc service takes the most current price and ignores the product store.
Therefore it may happen that SALES_TAX is calculated instead of VAT_TAX.
Thanks: Ingo Wolfmayr for the initial patch
Conflicts handled by hand in TaxAuthorityServices.java
---
.../main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
index abc0e64a1a..cbc12da540 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
@@ -664,7 +664,7 @@ public class TaxAuthorityServices {
"taxAuthPartyId", taxAuthPartyId,
"taxAuthGeoId", taxAuthGeoId,
"productPricePurposeId", "PURCHASE",
- "productStoreGroupId", productStore.get("primaryStoreGroupId"))
+ "productStoreId", productStore.get("primaryStoreGroupId"))
.orderBy("-fromDate").filterByDate().queryFirst();
}
(ofbiz-framework) 02/04: Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit c419a774cb9504452ca6fd2f4efcd4d79b53d45c
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Sat Aug 27 10:13:23 2022 +0200
Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
By default OOTB there is no primaryStoreGroupId. So a test fails because of that.
This checks that it's present before searching for it.
I did not check it's related but maybe a look at how it's handled in
PriceServices::calculateProductPrice might help to possibly enhance.
---
.../ofbiz/accounting/tax/TaxAuthorityServices.java | 23 +++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
index cbc12da540..0704c2e07b 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
@@ -659,13 +659,22 @@ public class TaxAuthorityServices {
*/
private static GenericValue getProductPrice(Delegator delegator, GenericValue product, GenericValue productStore, String taxAuthGeoId,
String taxAuthPartyId) throws GenericEntityException {
- return EntityQuery.use(delegator).from("ProductPrice")
- .where("productId", product.get("productId"),
- "taxAuthPartyId", taxAuthPartyId,
- "taxAuthGeoId", taxAuthGeoId,
- "productPricePurposeId", "PURCHASE",
- "productStoreId", productStore.get("primaryStoreGroupId"))
- .orderBy("-fromDate").filterByDate().queryFirst();
+ 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"))
+ .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();
+ }
}
/**
(ofbiz-framework) 03/04: Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 1f40d4c81befd0d80ba47e781a219f94a127f946
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Sat Aug 27 12:14:48 2022 +0200
Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
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
---
.../ofbiz/accounting/tax/TaxAuthorityServices.java | 23 +++++++---------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
index 0704c2e07b..abc0e64a1a 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
@@ -659,22 +659,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"))
- .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();
- }
+ return EntityQuery.use(delegator).from("ProductPrice")
+ .where("productId", product.get("productId"),
+ "taxAuthPartyId", taxAuthPartyId,
+ "taxAuthGeoId", taxAuthGeoId,
+ "productPricePurposeId", "PURCHASE",
+ "productStoreGroupId", productStore.get("primaryStoreGroupId"))
+ .orderBy("-fromDate").filterByDate().queryFirst();
}
/**
(ofbiz-framework) 04/04: Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 549910411eb68b75f8657e176102b6ef861e7448
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Mon Sep 5 12:09:38 2022 +0200
Fixed: Tax calculation not considering productStoreGroup (OFBIZ-12686)
For Purchase Orders we need to check for the productstore.
Thanks: Ingo
---
.../ofbiz/accounting/tax/TaxAuthorityServices.java | 24 +++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
index abc0e64a1a..cb191b5f98 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/tax/TaxAuthorityServices.java
@@ -659,13 +659,23 @@ public class TaxAuthorityServices {
*/
private static GenericValue getProductPrice(Delegator delegator, GenericValue product, GenericValue productStore, String taxAuthGeoId,
String taxAuthPartyId) throws GenericEntityException {
- return EntityQuery.use(delegator).from("ProductPrice")
- .where("productId", product.get("productId"),
- "taxAuthPartyId", taxAuthPartyId,
- "taxAuthGeoId", taxAuthGeoId,
- "productPricePurposeId", "PURCHASE",
- "productStoreGroupId", productStore.get("primaryStoreGroupId"))
- .orderBy("-fromDate").filterByDate().queryFirst();
+ if (productStore != null && UtilValidate.isNotEmpty(productStore.getString("primaryStoreGroupId"))) {
+ return EntityQuery.use(delegator).from("ProductPrice")
+ .where("productId", product.get("productId"),
+ "taxAuthPartyId", taxAuthPartyId,
+ "taxAuthGeoId", taxAuthGeoId,
+ "productPricePurposeId", "PURCHASE",
+ "productStoreGroupId", productStore.get("primaryStoreGroupId"))
+ .orderBy("-fromDate").filterByDate().queryFirst();
+ } else {
+ // Purchase order case
+ return EntityQuery.use(delegator).from("ProductPrice")
+ .where("productId", product.get("productId"),
+ "taxAuthPartyId", taxAuthPartyId,
+ "taxAuthGeoId", taxAuthGeoId,
+ "productPricePurposeId", "PURCHASE")
+ .orderBy("-fromDate").filterByDate().queryFirst();
+ }
}
/**