David,
I understand what you mean. I looked around, The calcTax service is
implemented in TaxAuthorityServices.java::rateProductTaxCalc. At line #
148 it checks for Postal address for Shipping. This means even if I
implemented as you suggested we'll still get problem.
Regards
Anil Patel
David E Jones wrote:
I see what you're looking at. This change is fine then, but
incomplete. Before skipping tax calc we need to make sure that both
the shipping and billing addresses are empty. To check this you can
use the cart.getBillingAddress() method.
-David
Anil K Patel wrote:
In E-Commerce site (or its custom impl), When user click on ShowCart,
I'll like to route request through the process of calculating
Shipping and Tax and set then in cart so that we can show it to
Customer.
In case if user has not yet logged in or is anonymous then Shipping
and Tax calc services fail because of missing Address details. By
doing this change and another change that I did few days back, We
attempt of calc these things only if we have data to work with else
do nothing.
Regards
Anil Patel
David E Jones wrote:
Actually if there is not shipping address we should use the billing
address.
I thought there was something in place that did that already.
Could you describe the process where this is becoming a problem?
-David
[EMAIL PROTECTED] wrote:
Author: apatel
Date: Thu Jul 26 16:56:18 2007
New Revision: 560035
URL: http://svn.apache.org/viewvc?view=rev&rev=560035
Log:
if there is no shipping contact mech in shoppingcart then do not
attempt to calc tax.
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?view=diff&rev=560035&r1=560034&r2=560035
==============================================================================
---
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
Thu Jul 26 16:56:18 2007
@@ -714,7 +714,7 @@
}
public void calcAndAddTax(GenericValue shipAddress) throws
GeneralException {
- if (!"SALES_ORDER".equals(cart.getOrderType())) {
+ if (!"SALES_ORDER".equals(cart.getOrderType()) ||
UtilValidate.isEmpty(cart.getShippingContactMechId())) {
return;
}