Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030292
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2015-06-30 18:472015-08-20 23:16
ReportermaiteView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision219fa2d8cb3d
ProjectionnoneETAnoneTarget Version3.0PR15Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030292: Wrong Document Type calculation when there are types configured in the legal entity and the store (generic child organization)

DescriptionWhen doing a Payment In from a Sales Invoice. If there are default document types
defined in the generic organization and the legal entity the application can return the doctype of the legal entity instead of prioritize the doctype of the generic.
Steps To Reproduce1. Create a new autonumeric sequence in F&B España, set a prefix for example "RN".
2. Create a new document type for Payment Ins:
* Organization: F&B Región Norte
* Document Category: AR Receipt
* Sequenced document: Yes
* Sequence: the seq created on step 1.
* Sales Trx: Yes
* Default: Yes
3. Access database and ensure that c_doctype_id of the legal is higher than c_doctype_id of the generic (if necessary, update c_doctype_id to reproduce the issue)
4. Check that the equivalent document type for F&B España is also default: Y.
5. Create a new Sales Invoice in organization F&B España Norte and complete it.
6. Click on Add Payment and check the Document Number proposed. It should always use the doc type of Region Norte (as the document type is hidden in the popup it is possible to notice the error checking the prefix of the document number)
Proposed SolutionWhen the payment is generated it is using the java function
FIN_Utility.getDocumentType(organization, strCategory). This function does a query considering the parent tree of the organization. It sorts the result by the default flag and the document type id. The sorting should be changed to include the org parent level so it first returns the default types of the base org.
The db function AD_GET_DOCTYPE used in stored procedures is already sorting first by the org parent level.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0078761)
AtulOpenbravo (developer)
2015-07-13 07:50

Test Plan
- Create a new auto numeric sequence in F&B España, set a prefix for example "RN".
- Create a new document type for Payment In:
  * Organization: F&B Región Norte
  * Document Category: AR Receipt
  * Sequenced document: Yes
  * Sequence: the seq created on step 1.
  * Sales Trx: Yes
  * Default: Yes
- Check into database and ensure that c_doctype_id of the legal (F&B España) is higher than c_doctype_id of the generic (F&B España Norte). If required update c_doctype_id to reproduce the issue.
- Check that the equivalent document type for F&B España is also default: Y.
- Create a new Sales Invoice in organization F&B España Norte and complete it.
- Click on Add Payment and check the Document Number proposed. It uses the document type defined for Region Norte having prefix 'RN'.
(0078771)
hgbot (developer)
2015-07-13 13:16
edited on: 2015-07-16 12:02

Repository: erp/devel/pi
Changeset: 219fa2d8cb3d
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Sat Jul 11 10:35:43 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/219fa2d8cb3d [^]

Fixes Issue 30292:Wrong Document Type calculation when there are types
configured in the legal entity and the store (generic child organization)

Instead of OBCriteria, OBQuery is implemented in order to sort record by
organization parent level using ad_isorgincluded function prior to default
flag and id.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
---

(0078772)
hgbot (developer)
2015-07-13 13:16
edited on: 2015-07-16 12:02

Repository: erp/devel/pi
Changeset: c0e8945c69fa
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Jul 13 13:15:38 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c0e8945c69fa [^]

Related to issue 30292: code review improvements

1. Ordered by dt.default desc to get first the records with default = Y
2. Ordered by dt.id desc as it was in the original code.
Note that this order is different from the one used at AD_GET_DOCTYPE. However I have kept this order to to get the same records as in the past (otherwise it could be considered as a functional regression)
3. Limit query to just 1 record to improve performance

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
---

(0078773)
vmromanos (manager)
2015-07-13 13:17

Code review + testing OK
(0079490)
hudsonbot (developer)
2015-08-20 23:16

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8c91718397a5 [^]
Maturity status: Test
(0079491)
hudsonbot (developer)
2015-08-20 23:16

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8c91718397a5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-06-30 18:47 maite New Issue
2015-06-30 18:47 maite Assigned To => Triage Finance
2015-06-30 18:47 maite Modules => Core
2015-06-30 18:47 maite Resolution time => 1438639200
2015-06-30 18:47 maite Triggers an Emergency Pack => No
2015-06-30 18:47 maite Issue Monitored: networkb
2015-07-10 09:03 AtulOpenbravo Assigned To Triage Finance => AtulOpenbravo
2015-07-10 09:03 AtulOpenbravo Status new => scheduled
2015-07-13 07:50 AtulOpenbravo Note Added: 0078761
2015-07-13 13:16 hgbot Checkin
2015-07-13 13:16 hgbot Note Added: 0078771
2015-07-13 13:16 hgbot Status scheduled => resolved
2015-07-13 13:16 hgbot Resolution open => fixed
2015-07-13 13:16 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3ae7799bc9344084635a04597b3da9e6cc576e55 [^]
2015-07-13 13:16 hgbot Checkin
2015-07-13 13:16 hgbot Note Added: 0078772
2015-07-13 13:17 vmromanos Review Assigned To => vmromanos
2015-07-13 13:17 vmromanos Note Added: 0078773
2015-07-13 13:17 vmromanos Status resolved => closed
2015-07-16 12:02 gorka_gil Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/3ae7799bc9344084635a04597b3da9e6cc576e55 [^] => http://code.openbravo.com/erp/devel/pi/rev/219fa2d8cb3d [^]
2015-07-16 12:02 gorka_gil Note Edited: 0078771 View Revisions
2015-07-16 12:02 gorka_gil Note Edited: 0078772 View Revisions
2015-08-20 23:16 hudsonbot Checkin
2015-08-20 23:16 hudsonbot Note Added: 0079490
2015-08-20 23:16 hudsonbot Checkin
2015-08-20 23:16 hudsonbot Note Added: 0079491


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker