[jira] [Commented] (OFBIZ-4940) TaxAuthorityServices try to filter by date without getting date fields

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4940) TaxAuthorityServices try to filter by date without getting date fields

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598623#comment-13598623 ]

Paul Foxworthy commented on OFBIZ-4940:
---------------------------------------

Hi Alexander,

Thanks for your reply, and many thanks for your report. I have now reproduced the problem in trunk with the demo data. The bug is to do with an expired Product-ProductCategory relationship, not an expired TaxAuthorityRateProduct.

Here's a procedure to make it happen:

Go to Applications-Catalog-Categories (catalog/control/FindCategory) and enter
    Category ID: FOOD-001
    Click Find

Click on the FOOD-001 link in the results

Click on the Products tab.
In the row for the Pizza product, set the Thru date for 1 Jan 2013, and click Update. The Pizza will disappear, but if you click Active and Inactive, you will see it with the Thru date in red.

Go to Accounting-Tax Authorities and click the Edit for UT_TAXMAN (accounting/control/EditTaxAuthorityCategories?taxAuthPartyId=UT_TAXMAN&taxAuthGeoId=UT)

Click on the Categories tab, and add a new Tax Authority Product Category of FOOD-001

Click on Product Rates tab, and enter:
    Type: Sales Tax
    Category: FOOD-001
    Tax Percentage: 12.5
    From Date: (Use calendar, choose date, then edit to 1 Jan 2013)
    To Date: (leave blank)
    Click Add

Go to Order-Order Entry (ordermgr/control/orderentry) and enter
    Customer: DemoCustomer
    Click Continue
    Click Continue again

Enter:
    Product ID: PIZZA
    Quantity: 1
    Click Add To Order
    Click Add To Cart

Click Finalize Order With Default Options
Leave Terms blank, and click Continue
Choose Offline Payment, and click Continue
In Additional Party Entry, leave the radio button "I do not wish..." and click Continue
See Sales Tax of 12.5%, even though the relationship between PIZZA and FOOD-001 has been expired.

Apply Alexander's change, and the Sales Tax is not added. I will upload his change as a patch soon.

Could someone walk through this and verify the problem?

Thanks

Paul Foxworthy

               

> TaxAuthorityServices try to filter by date without getting date fields
> ----------------------------------------------------------------------
>
>                 Key: OFBIZ-4940
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4940
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Alexander Reelsen
>            Priority: Minor
>
> The TaxAuthorityServices try to get product category members and filter by date. However they do not get the fromDate/thruDate fields and therefore EntityUtil.filterByDate() fails silently. This can lead to accumulated tax when two different tax rates were active on two totally different time ranges.
> Fix is changing line 329 from
> List<GenericValue> pcmList = delegator.findList("ProductCategoryMember", productIdCond, UtilMisc.toSet("productCategoryId"), null, null, true);
> to
> List<GenericValue> pcmList = delegator.findList("ProductCategoryMember", productIdCond, UtilMisc.toSet("productCategoryId", "fromDate", "thruDate"), null, null, true);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira