Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013495Openbravo ERP09. Financial managementpublic2010-06-01 16:392011-01-27 11:08
adrianromero 
adrianromero 
urgentmajoralways
closedfixed 
5
2.40MP12 
2.40MP13 
Core
No
0013495: C_GETTAX doesn't order properly when there are more than one tax rates defined for one tax category
I you define more than one tax rates for the same tax category setting different "Valid from date", when creating documents Tax set is not the correct one
1. Financial Management || Accounting || Setup || Tax Rate || Tax : create a new record with
*Valid from date= 01/01/2010
Sales/Purchase=both
*Tax category=VAT 16 (already created for SmallBazar)

2. Sales Management || Transactions || Sales Order || Header : create new record with date > 01/01/2010
3. Create line with product=beer (which has Tax category=VAT 16) and realize that tax assigned is VAT16% ant not the new one
No tags attached.
related to defect 00119482.50MP11 closed rafaroda C_GETTAX doesn't order properly when there are more than one tax rates defined for one tax category 
Issue History
2010-06-01 16:39adrianromeroNew Issue
2010-06-01 16:39adrianromeroAssigned To => rafaroda
2010-06-01 16:39adrianromeroIssue generated from0011948
2010-06-01 16:39adrianromeroRelationship addedrelated to 0011948
2010-06-01 16:40adrianromeroStatusnew => scheduled
2010-06-01 16:40adrianromeroNote Added: 0027862
2010-06-01 16:40adrianromeroAssigned Torafaroda => adrianromero
2010-06-01 16:40adrianromerofix_in_branch => pi
2010-06-11 15:47hgbotCheckin
2010-06-11 15:47hgbotNote Added: 0028309
2010-06-11 15:47hgbotStatusscheduled => resolved
2010-06-11 15:47hgbotResolutionopen => fixed
2010-06-11 15:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c12f5119b43a741774b943801281b37f2b83fe6e [^]
2010-06-11 15:54adrianromeroNote Deleted: 0028309
2010-06-11 15:55adrianromeroStatusresolved => new
2010-06-11 15:55adrianromeroResolutionfixed => open
2010-06-11 15:59adrianromeroStatusnew => scheduled
2010-06-11 15:59adrianromeroversion2.50MP9 => 2.40MP12
2010-06-11 15:59adrianromeroFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/c12f5119b43a741774b943801281b37f2b83fe6e [^] =>
2010-06-11 15:59adrianromerofix_in_branchpi =>
2010-06-11 16:09hgbotCheckin
2010-06-11 16:09hgbotNote Added: 0028310
2010-06-11 16:09hgbotStatusscheduled => resolved
2010-06-11 16:09hgbotResolutionopen => fixed
2010-06-11 16:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.40/rev/7076c8328ca120f81d56ba575a5e6c6df4236ae6 [^]
2010-06-11 16:12adrianromeroNote Added: 0028311
2010-06-12 22:49hudsonbotCheckin
2010-06-12 22:49hudsonbotNote Added: 0028330
2010-06-14 11:38hgbotCheckin
2010-06-14 11:38hgbotNote Added: 0028352
2010-06-14 11:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/stable/2.40/rev/7076c8328ca120f81d56ba575a5e6c6df4236ae6 [^] => http://code.openbravo.com/erp/stable/2.40/rev/5d2a83efafc665ecc76e40b59100d580f3d10b87 [^]
2010-06-16 16:05adrianromeroNote Added: 0028507
2011-01-27 11:08psarobeNote Added: 0033903
2011-01-27 11:08psarobeStatusresolved => closed

Notes
(0027862)
adrianromero   
2010-06-01 16:40   
Backport required by GPS. The solution has been resolved in pi in the related issue.
(0028310)
hgbot   
2010-06-11 16:09   
Repository: erp/stable/2.40
Changeset: 7076c8328ca120f81d56ba575a5e6c6df4236ae6
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Fri Jun 11 16:08:48 2010 +0200
URL: http://code.openbravo.com/erp/stable/2.40/rev/7076c8328ca120f81d56ba575a5e6c6df4236ae6 [^]

Fixes issue 0013495: C_GETTAX doesn't order properly when there are more than one tax rates defined for one tax category
The ORDER BY clause has been modified in order to take into account first the field Valid From Date

---
M src-db/database/model/functions/C_GETTAX.xml
---
(0028311)
adrianromero   
2010-06-11 16:12   
* Test the issue
Follow the steps to test and verify that now the new tax is selected.

* Other areas affected
All windows that call the C_GETTAX function are affected but only the behavior of what tax is selected first depending on the ValidFrom value is affected no other possibles changes can appear.
(0028330)
hudsonbot   
2010-06-12 22:49   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/c12f5119b43a [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/0b85119b92bc [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17589.obx [^]
(0028352)
hgbot   
2010-06-14 11:38   
Repository: erp/stable/2.40
Changeset: 5d2a83efafc665ecc76e40b59100d580f3d10b87
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Jun 14 11:37:12 2010 +0200
URL: http://code.openbravo.com/erp/stable/2.40/rev/5d2a83efafc665ecc76e40b59100d580f3d10b87 [^]

Fixes issue 0013495: C_GETTAX doesn't order properly when there are more than one tax rates defined for one tax category
Reverting last change it was incorrect

---
M src-db/database/model/functions/C_GETTAX.xml
---
(0028507)
adrianromero   
2010-06-16 16:05   
To test that the C_GETTAX function works properly generate a new tax with the same tax category as another tax, for example VAT 16%, modifying only the ValidFrom date, and check that the new tax is applied only when the invoice or order is created after the new tax date.
(0033903)
psarobe   
2011-01-27 11:08   
Works fine