Hello,
after my investigation I found the following:
the tax is calculated here - *TaxAuthorityService.rateProductTaxCalc*
*
*
Firstly there is a loop through all product items:
for (int i = 0; i < itemProductList.size(); i++) {
GenericValue product = (GenericValue) itemProductList.get(i);
BigDecimal itemAmount = (BigDecimal) itemAmountList.get(i);
BigDecimal itemPrice = (BigDecimal) itemPriceList.get(i);
BigDecimal shippingAmount = (BigDecimal) *itemShippingList*
.get(i);
List taxList = null;
if (shippingAddress != null) {
taxList = getTaxAdjustments(delegator, product,
productStore, payToPartyId, billToPartyId, taxAuthoritySet, itemPrice,
itemAmount, *shippingAmount*, ZERO_BASE);
}
// this is an add and not an addAll because we want a List of
Lists of GenericValues, one List of Adjustments per item
*itemAdjustments*.add(taxList);
}
The *itemShippingList *contains 0 amount per any product item in any case,
because of
*Map serviceContext = this.makeTaxContext(i, shipAddress,
shoppingCartItemIndexMap);*
where
product.add(i, cartItem.getProduct());
amount.add(i, cartItem.getItemSubTotal(itemInfo.quantity));
price.add(i, cartItem.getBasePrice());
* shipAmt.add(i, BigDecimal.ZERO); // no per item shipping yet*
shoppingCartItemIndexMap.put(Integer.valueOf(i), cartItem);
and I do not see any sense in shipping amount per product item, because I
have shipping amount per shipping group.
So, secondly:
there is another possible way to add the shipping tax
if (orderShippingAmount != null &&
orderShippingAmount.compareTo(BigDecimal.ZERO) > 0) {
List taxList = getTaxAdjustments(delegator, *null*,
productStore, payToPartyId, billToPartyId, taxAuthoritySet, ZERO_BASE,
ZERO_BASE, orderShippingAmount, ZERO_BASE);
orderAdjustments.addAll(taxList);
}
and orderShippingAmount has value in my case (9 EUR), let's go to
the getTaxAdjustments (notice that product specified as null, because this
call does not relate to any product)
getTaxAdjustments tries to get all necessary TaxAuthorityRateProduct to
calc the tax,
*List lookupList = delegator.findList("TaxAuthorityRateProduct",
mainCondition, null, orderList, null, false);*
* List filteredList = EntityUtil.filterByDate(lookupList, true);*
*
*
* if (filteredList.size() == 0) {*
* Debug.logWarning("In TaxAuthority Product Rate no records
were found for condition:" + mainCondition.toString(), module);*
* return adjustments;*
* }*
but in the case of the product == null, the following is used
productCategoryCond = EntityCondition.makeCondition("productCategoryId",
EntityOperator.EQUALS, null);
and that I do not understand. It tries to find TaxAuthorityRateProduct to
calc the tax , which are not assigned on any product category.
Could you help me to understand the idea of this calculation?
Why the ordering shipping amount depends on TaxAuthorityRateProduct .
To have a TaxAuthorityRateProduct without Category specified is illegal and
it is not possible to add it do via UI.
Thank you.
On Tue, Jan 25, 2011 at 10:11 PM, Sergei Biletnikov <[email protected]>wrote:
Thank you for your assistance.
I'm looking forward for any new step or idea.
On Tue, Jan 25, 2011 at 11:16 AM, Jacques Le Roux [via OFBiz] <
[email protected]<ml-node%[email protected]>
wrote:
I wil have a look when I will get a chance...
Thanks
Jacques
From: "biletnikov" <[hidden
email]<http://user/SendEmail.jtp?type=node&node=3235733&i=0>>
The method is called ok, and passes the validation.
Just remind you, the shipping cost is added, but without VAT.... that is
the
problem.
On Tue, Jan 25, 2011 at 12:55 AM, Sergei Biletnikov <[hidden
email]<http://user/SendEmail.jtp?type=node&node=3235733&i=1>>wrote:
I have read mails.
In my case, I use "admin" login as OFBiz administrator to make an order,
and a customer login is created by me and has Origin and Destination
addresses.
I'll try to debug
*"public void calcAndAddTax(GenericValue shipAddress) throws*
*GeneralException"*
*
*
method.*
*
On Tue, Jan 25, 2011 at 12:30 AM, Jacques Le Roux [via OFBiz] <
[hidden email] <http://user/SendEmail.jtp?type=node&node=3235733&i=2><[hidden
email] <http://user/SendEmail.jtp?type=node&node=3235733&i=3>>
wrote:
Did you look at http://ofbiz.markmail.org/search/shipping+vat ?
This could help, maybe you are in a special case. Are you using admin
for
testing? Have you a shipping address for the login you use
for testing?
Jacques
biletnikov wrote:
OFBiz 9.04 (last stable release)
On Tue, Jan 25, 2011 at 12:23 AM, Jacques Le Roux [via OFBiz] <
[hidden email] <http://user/SendEmail.jtp?type=node&node=3235084&i=0><[hidden
email] <http://user/SendEmail.jtp?type=node&node=3235084&i=1>>
wrote:
Which version are you using?
Jacques
From: "biletnikov" <[hidden email]<
http://user/SendEmail.jtp?type=node&node=3235075&i=0>>
Hello all,
we need to apply VAT 19% to order items and shipping price.
VAT is successfully applied to the order item prices, but not for
the
shipment.
Example:
Items SubTotal
€63.74
Total Other Order Adjustments
€0.00
Total Shipping and Handling
€5.00
Total Sales Tax
€12.11
Total Due
€80.85
-------------------------------------------------------
Shipping cost is 5 euro, but it must be 5 * 1.19 = 5.95 euro.
The order is created via OFBiz (Order entry), we do not use
e-commerce.
We have a TaxAuthority, which is bundled with Tax Authority Product
Rates
(for each product category), Tax Shipping = 'Y'
A product has Charge Shipping = 'Y', Taxable = 'Y'.
However, the VAT is calculated, but not for the shipment.
Why it is so?
Where is the problem? As I understand, it should be possible to
have
VAT
for
the shipment.
Thanks.
--
View this message in context:
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t>
<
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t&by-user=t>>
<
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t&by-user=t>
<
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t&by-user=t<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3234699.html?by-user=t&by-user=t&by-user=t>>>
Sent from the OFBiz - User mailing list archive at Nabble.com.
------------------------------
If you reply to this email, your message will be added to the
discussion
below:
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235075.html<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235075.html?by-user=t>
<
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235075.html?by-user=t<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235075.html?by-user=t&by-user=t>>
To unsubscribe from VAT is not applied for the shipping, click
here<
http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4<http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4&by-user=t>
<
http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4&by-user=t<http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4&by-user=t&by-user=t>>>.
--
Best regards,
Sergei Biletnikov
------------------------------
If you reply to this email, your message will be added to the
discussion
below:
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235084.html<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235084.html?by-user=t>
To unsubscribe from VAT is not applied for the shipping, click
here<
http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4<http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4&by-user=t>>.
--
Best regards,
Sergei Biletnikov
--
Best regards,
Sergei Biletnikov
--
View this message in context:
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235150.html<http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235150.html?by-user=t>
Sent from the OFBiz - User mailing list archive at Nabble.com.
------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3235733.html
To unsubscribe from VAT is not applied for the shipping, click
here<http://ofbiz.135035.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3234699&code=YmlsZXRuaWtvdkBnbWFpbC5jb218MzIzNDY5OXwyMDcwNzk3NDQ4>.
--
Best regards,
Sergei Biletnikov
--
Best regards,
Sergei Biletnikov