ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques Le Roux <jacques.le.r...@les7arts.com>
Subject Re: VAT Setup
Date Tue, 11 Aug 2015 07:44:37 GMT
Did you check how prices are created? It depends on parameters you pass
You can read the createProductPrice description in its definition:

             <<Create a Product Price.

             If taxAuthGeoId and taxAuthPartyId are (or taxAuthCombinedId is) passed in then
the price will be considered a price
             with tax included (the priceWithoutTax, priceWithTax, taxAmount, and taxPercentage
fields will also be populated).

             If the taxInPrice field is 'Y' then the price field will be left with the tax
included (price will be equal to priceWithTax),
             otherwise tax will be removed from the passed in price and the price field will
be equal to the priceWithoutTax field.

             If taxAuthGeoId or taxAuthPartyId empty, and taxAuthCombinedId is empty, then
the taxInPrice field will be ignored.>>



Le 11/08/2015 07:00, Peter Arnold a écrit :
> The VAT tax seems to be added to the price because of following code in TaxAuthorityServices.java:
> TaxAuthorityServices.java
> // add up amounts from adjustments (amount OR exemptAmount, sourcePercentage)
>                  for (GenericValue taxAdjustment : taxAdustmentList) {
>                      if ("SALES_TAX".equals(taxAdjustment.getString("orderAdjustmentTypeId")))
>                          taxPercentage = taxPercentage.add(taxAdjustment.getBigDecimal("sourcePercentage"));
>                          BigDecimal adjAmount = taxAdjustment.getBigDecimal("amount");
>                          taxTotal = taxTotal.add(adjAmount);
>                          priceWithTax = priceWithTax.add(adjAmount.divide(quantity,salestaxCalcDecimals,salestaxRounding));
>                          Debug.logInfo("For productId [" + productId + "] added [" +
adjAmount.divide(quantity,salestaxCalcDecimals,salestaxRounding) + "] of tax to price for
geoId [" + taxAdjustment.getString("taxAuthGeoId") + "], new price is [" + priceWithTax +
"]", module);
> Somehow, somewhere "orderAdjustmentTypeId" is set to "SALES_TAX" eventhough I am not
aware where this might be done as I have created the tax as a VAT-Tax.
> Since above code detects:      if ("SALES_TAX".equals(taxAdjustment.getString("orderAdjustmentTypeId)))
as true, subsequently the line
> 				priceWithTax = priceWithTax.add(adjAmount.divide(quantity,salestaxCalcDecimals,salestaxRounding));
 is executed which is responsible for adding the VAT tax.
> I have tracked this by using "verbose" - logging.
> By comenting out above code the prices are correctly indicated when the product is displayed
in the ecommerce shop.
> Nevertheless when performing Quick Check-Out and shipping the order to a Chilean address
once again a Sales Tax of 19% is added.
> So far I have not found out which part of the code is responsible for adding the Sales
> Help on this subject is much appreciated.
> Regards,
> Peter
> ---
> El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
> http://www.avast.com

View raw message