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.
Kind regards,
Sergei |
Administrator
|
Which version are you using?
Jacques From: "biletnikov" <[hidden email]> > 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 > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
OFBiz 9.04 (last stable release)
On Tue, Jan 25, 2011 at 12:23 AM, Jacques Le Roux [via OFBiz] <[hidden email]> wrote: Which version are you using? -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
Administrator
|
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]<ml-node%[hidden email]> >> 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> >>> 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 >> To unsubscribe from VAT is not applied for the shipping, click >> here< >> >> > > > > -- > Best regards, > Sergei Biletnikov |
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]> wrote: Did you look at http://ofbiz.markmail.org/search/shipping+vat ? -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
In reply to this post by Jacques Le Roux
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]> wrote: I have read mails. -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
Administrator
|
I wil have a look when I will get a chance...
Thanks Jacques From: "biletnikov" <[hidden email]> 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]>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]<ml-node%[hidden email]> > > 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>> >> >> >>> 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> >> >> To unsubscribe from VAT is not applied for the shipping, click >> >> here< >> href="" target="_top" rel="nofollow" link="external"> >> >> >> >> >> >> > >> > >> > >> > -- >> > 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 >> To unsubscribe from VAT is not applied for the shipping, click >> here< >> >> > > > > -- > 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 Sent from the OFBiz - User mailing list archive at Nabble.com. |
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] <[hidden email]> wrote: I wil have a look when I will get a chance... -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
In reply to this post by Jacques Le Roux
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 <[hidden email]> wrote: Thank you for your assistance. -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
Administrator
|
Sorry, I just began to look at it when I realized/remembered that you were using R9.04. I have not enough time to support all
versions in my spare time, only trunk... Jacques biletnikov wrote: > 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 <[hidden email]>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] < >> [hidden email]<ml-node%[hidden email]> >>> 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< >>>>> >>> href="" target="_top" rel="nofollow" link="external"> >>> < >>> href="" target="_top" rel="nofollow" link="external"> >>> >>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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< >>> href="" target="_top" rel="nofollow" link="external"> >>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> 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< >>> >>> >> >> >> >> -- >> Best regards, >> Sergei Biletnikov >> > > > > -- > Best regards, > Sergei Biletnikov |
Hi Sergei and Jacques,
I have encountered and fixed a problem that I think is the same as this. The calcTax service is called for shipping and promotional amounts, with no product id. The search of the TaxAuthorityRateProduct table assumes that if there is no product we only need to find TARP rows with a ProductCategory of null. Not so! We also need to find rows with taxShipping and taxPromotions set to Y. I have created a Jira issue with a patch at https://issues.apache.org/jira/browse/OFBIZ-4160. Cheers Paul Foxworthy
--
Coherent Software Australia Pty Ltd http://www.coherentsoftware.com.au/ Bonsai ERP, the all-inclusive ERP system http://www.bonsaierp.com.au/ |
Administrator
|
Hi Paul,
Great, thanks for letting us know. Sergei , I know you are using R9.04. I think the snippet Paul submitted can be inserted easily there also (maybe by hand). Could you please try and confirm it works for you? Thanks Jacques From: "Paul Foxworthy" <[hidden email]> > Hi Sergei and Jacques, > > I have encountered and fixed a problem that I think is the same as this. The > calcTax service is called for shipping and promotional amounts, with no > product id. The search of the TaxAuthorityRateProduct table assumes that if > there is no product we only need to find TARP rows with a ProductCategory of > null. Not so! We also need to find rows with taxShipping and taxPromotions > set to Y. > > I have created a Jira issue with a patch at > https://issues.apache.org/jira/browse/OFBIZ-4160. > > Cheers > > Paul Foxworthy > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3250627.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
Hello all,
thank you for your participation,
yes, it is very easy to insert this code by hand that was done by me. I've tested my case, the sales tax (VAT) is calculated for the shipping but twice!!
I started to investigate this problem, and in my case I have 2 product categories and 2 Tax Authority Product Rates with specified VAT 19% I have remove one of the category from the Tax Rate list, and my shipping tax was calculated correctly (one time).
As I understand, something was missed, because wrong Tax Authority Product Rates are used regardless of the product relates to another category. Best regards, Sergei
On Tue, Feb 1, 2011 at 1:34 PM, Jacques Le Roux [via OFBiz] <[hidden email]> wrote: Hi Paul, -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
Hi Sergei,
The trouble is that in the rateProductTaxCalc method, getTaxAdjustments is called once per product, plus once for shipping and once for adjustments. In trunk these are lines 218, 244 and 228 in https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?hb=true When we call getTaxAdjustments for shipping and promotion, there's no product, so the product category matching won't work. My change was to look for rows with taxShipping of Y when there's no product. If your shipping is always calculated for an order and not by individual order items, you could set taxShipping to Y for one row in TaxAuthorityRateProduct (TARP) and N for the others. A bit of a hack, but it would work. Another possibility is to define a new TAXABLE product category independent of any other, so you only need one row in TARP. The problem with this is you need to assign a product to the TAXABLE category as you create the product. For me in Australia, pretty well everything is taxed, so most products would need the category set. A third way, again a hack, is to create a dummy product category that no product has, and add a row to TARP with taxShipping of Y. All other TARP rows would have taxShipping of N. A better fix would need more consideration and more work. Some possibilities I can think of: - Add a new column to TARP, perhaps called something like taxRuleType or taxScope. It would have values PRODUCT, SHIPPING, PROMOTION. You would add separate rows for tax rules for shipping and promotion. Each of the three calls to getTaxAdjustment would supply a parameter to say which taxRuleType to search for. - Define entirely separate entities for tax rules for shipping and promotions rather than overload TARP Cheers Paul Foxworthy
--
Coherent Software Australia Pty Ltd http://www.coherentsoftware.com.au/ Bonsai ERP, the all-inclusive ERP system http://www.bonsaierp.com.au/ |
Hello Paul,
thank you very much for your detailed explanation and solutions. I think the first way is the more appropriate for us for the first time, but I'm confused what we should do if we had in an order some items with shippable tax and some with free shipping tax? Also the each our product relates to the appropriate category.
Is this problem actual only for 9.04 release, or the current trunk has it too? Best regards, Sergei
On Wed, Feb 2, 2011 at 8:57 AM, Paul Foxworthy [via OFBiz] <[hidden email]> wrote: Hi Sergei, -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
Administrator
|
It's the same in trunk
Jacques From: "biletnikov" <[hidden email]> > Hello Paul, > > thank you very much for your detailed explanation and solutions. > I think the first way is the more appropriate for us for the first time, > but I'm confused what we should do if we had in an order some items with > shippable tax and some with free shipping tax? Also the each our product > relates to the appropriate category. > > Is this problem actual only for 9.04 release, or the current trunk has it > too? > > Best regards, > Sergei > > On Wed, Feb 2, 2011 at 8:57 AM, Paul Foxworthy [via OFBiz] < > [hidden email]<ml-node%[hidden email]> >> wrote: > >> Hi Sergei, >> >> The trouble is that in the rateProductTaxCalc method, getTaxAdjustments is >> called once per product, plus once for shipping and once for adjustments. In >> trunk these are lines 218, 244 and 228 in >> https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?hb=true >> >> When we call getTaxAdjustments for shipping and promotion, there's no >> product, so the product category matching won't work. My change was to look >> for rows with taxShipping of Y when there's no product. >> >> If your shipping is always calculated for an order and not by individual >> order items, you could set taxShipping to Y for one row in >> TaxAuthorityRateProduct (TARP) and N for the others. A bit of a hack, but it >> would work. >> >> Another possibility is to define a new TAXABLE product category independent >> of any other, so you only need one row in TARP. The problem with this is you >> need to assign a product to the TAXABLE category as you create the product. >> For me in Australia, pretty well everything is taxed, so most products would >> need the category set. >> >> A third way, again a hack, is to create a dummy product category that no >> product has, and add a row to TARP with taxShipping of Y. All other TARP >> rows would have taxShipping of N. >> >> A better fix would need more consideration and more work. >> >> Some possibilities I can think of: >> >> - Add a new column to TARP, perhaps called something like taxRuleType or >> taxScope. It would have values PRODUCT, SHIPPING, PROMOTION. You would add >> separate rows for tax rules for shipping and promotion. Each of the three >> calls to getTaxAdjustment would supply a parameter to say which taxRuleType >> to search for. >> >> - Define entirely separate entities for tax rules for shipping and >> promotions rather than overload TARP >> >> Cheers >> >> Paul Foxworthy >> >> ------------------------------ >> 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-tp3234699p3253480.html >> To unsubscribe from VAT is not applied for the shipping, click >> here< >> >> > > > > -- > Best regards, > Sergei Biletnikov > > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3253536.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
Administrator
|
To be more clear, what have changed in trunk is the possibilit to have prices with VAT included and code was changed accordingly.
So the ProductPrice and OrderAdjustment entities have changed but not The TaxAuthority data model, see http://svn.apache.org/viewvc?view=revision&revision=1042542 IIRW there have been some code amendements after Jacques From: "Jacques Le Roux" <[hidden email]> > It's the same in trunk > > Jacques > > From: "biletnikov" <[hidden email]> >> Hello Paul, >> >> thank you very much for your detailed explanation and solutions. >> I think the first way is the more appropriate for us for the first time, >> but I'm confused what we should do if we had in an order some items with >> shippable tax and some with free shipping tax? Also the each our product >> relates to the appropriate category. >> >> Is this problem actual only for 9.04 release, or the current trunk has it >> too? >> >> Best regards, >> Sergei >> >> On Wed, Feb 2, 2011 at 8:57 AM, Paul Foxworthy [via OFBiz] < >> [hidden email]<ml-node%[hidden email]> >>> wrote: >> >>> Hi Sergei, >>> >>> The trouble is that in the rateProductTaxCalc method, getTaxAdjustments is >>> called once per product, plus once for shipping and once for adjustments. In >>> trunk these are lines 218, 244 and 228 in >>> https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?hb=true >>> >>> When we call getTaxAdjustments for shipping and promotion, there's no >>> product, so the product category matching won't work. My change was to look >>> for rows with taxShipping of Y when there's no product. >>> >>> If your shipping is always calculated for an order and not by individual >>> order items, you could set taxShipping to Y for one row in >>> TaxAuthorityRateProduct (TARP) and N for the others. A bit of a hack, but it >>> would work. >>> >>> Another possibility is to define a new TAXABLE product category independent >>> of any other, so you only need one row in TARP. The problem with this is you >>> need to assign a product to the TAXABLE category as you create the product. >>> For me in Australia, pretty well everything is taxed, so most products would >>> need the category set. >>> >>> A third way, again a hack, is to create a dummy product category that no >>> product has, and add a row to TARP with taxShipping of Y. All other TARP >>> rows would have taxShipping of N. >>> >>> A better fix would need more consideration and more work. >>> >>> Some possibilities I can think of: >>> >>> - Add a new column to TARP, perhaps called something like taxRuleType or >>> taxScope. It would have values PRODUCT, SHIPPING, PROMOTION. You would add >>> separate rows for tax rules for shipping and promotion. Each of the three >>> calls to getTaxAdjustment would supply a parameter to say which taxRuleType >>> to search for. >>> >>> - Define entirely separate entities for tax rules for shipping and >>> promotions rather than overload TARP >>> >>> Cheers >>> >>> Paul Foxworthy >>> >>> ------------------------------ >>> 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-tp3234699p3253480.html >>> To unsubscribe from VAT is not applied for the shipping, click >>> here< >>> >>> >> >> >> >> -- >> Best regards, >> Sergei Biletnikov >> >> -- >> View this message in context: http://ofbiz.135035.n4.nabble.com/VAT-is-not-applied-for-the-shipping-tp3234699p3253536.html >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> > > |
Yes, that is understandable.
However, the shipping tax is not working for the standard use cases (without any hack solutions) and it seems the situation is not going to be changed in the next release, is it?
On Wed, Feb 2, 2011 at 11:53 AM, Jacques Le Roux [via OFBiz] <[hidden email]> wrote: To be more clear, what have changed in trunk is the possibilit to have prices with VAT included and code was changed accordingly. -- Best regards, Sergei Biletnikov
Kind regards,
Sergei |
In reply to this post by biletnikov
Sergei wrote:
> but I'm confused what we should do if we had in an order some items with shippable tax and some with free shipping tax? > Also the each our product relates to the appropriate category. > Is this problem actual only for 9.04 release, or the current trunk has it too? I think a mixture of taxed and untaxed shipping charges is unlikely. Shipping is just a service and a tax authority would charge a tax on that, or not, regardless of the product. If that's not right, you would need to manually add adjustments to the order for particular shipping services belonging to particular categories with particular taxation rules. Ofbiz doesn't handle this situation at the moment and I don't think it's a high priority. You probably already know this, Sergei, but just in case - you can have more than one hierarchy of product categories, so you can add a new TAXABLE product category without disrupting the categories you want for other purposes such as enabling users to browse for a product. The problem is in trunk, yes. Cheers Paul Foxworthy
--
Coherent Software Australia Pty Ltd http://www.coherentsoftware.com.au/ Bonsai ERP, the all-inclusive ERP system http://www.bonsaierp.com.au/ |
In reply to this post by biletnikov
Hi Sergei,
Shipping tax *does* work for the simple situation where you have one row in the TaxAuthorityRateProduct table with a product category of null (i.e. "don't care"). Individual products can opt out of that rule in TARP because they have a taxable attribute that can be set to N. For the more complex situation where you have different taxation rules for different product categories, yes, we have a problem. Version 10.04 is now done, and 11.x approaches. I am very new here and in no way do I speak for the Ofbiz community as a whole, or the project management committee. That said, I don't expect this problem to be improved in the near future. Anyone out there working on this area? Last week I was at a talk at linux.conf.au by Noirin Shirley of the Apache Software Foundation. One thing she said is that in the ASF they have a phrase "well volunteered!". If it's important to you, you could work on (or pay for!) a fix for this. Cheers Paul Foxworthy Sergei wrote: However, the shipping tax is not working for the standard use cases (without any hack solutions) and it seems the situation is not going to be changed in the next release, is it? On Wed, Feb 2, 2011 at 11:53 AM, Jacques Le Roux [via OFBiz] < ml-node+3253694-2070429451-170824@n4.nabble.com<ml-node%2B3253694-2070429451-170824@n4.nabble.com> > wrote: > To be more clear, what have changed in trunk is the possibilit to have > prices with VAT included and code was changed accordingly. > So the ProductPrice and OrderAdjustment entities have changed but not The > TaxAuthority data model, see > http://svn.apache.org/viewvc?view=revision&revision=1042542
--
Coherent Software Australia Pty Ltd http://www.coherentsoftware.com.au/ Bonsai ERP, the all-inclusive ERP system http://www.bonsaierp.com.au/ |
Free forum by Nabble | Edit this page |