Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||
View Issue Details | |||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0041639 | Openbravo ERP | 09. Financial management | public | 2019-08-13 10:23 | 2019-08-13 10:31 | ||||||||
Reporter | guillermogil | ||||||||||||
Assigned To | Triage Omni OMS | ||||||||||||
Priority | high | Severity | major | Reproducibility | sometimes | ||||||||
Status | closed | Resolution | duplicate | ||||||||||
Platform | OS | 5 | OS Version | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Merge Request Status | |||||||||||||
Review Assigned To | |||||||||||||
OBNetwork customer | |||||||||||||
Web browser | |||||||||||||
Modules | Advanced Payables and Receivables Mngmt | ||||||||||||
Support ticket | |||||||||||||
Regression level | |||||||||||||
Regression date | |||||||||||||
Regression introduced in release | |||||||||||||
Regression introduced by commit | |||||||||||||
Triggers an Emergency Pack | No | ||||||||||||
Summary | 0041639: getDocumentType query is not taking into account docTypes set a isReturn | ||||||||||||
Description | Query is ordering by id and not tenking into account the return. This may have some problem while generating the shipment on the POS in the case the return one as an id higher than the not return one. We've been able to reproduce with the functionality Issue Sales Order public static DocumentType getDocumentType(Organization org, String docCategory) { Client client = null; if ("0".equals(org.getId())) { client = OBContext.getOBContext().getCurrentClient(); if ("0".equals(client.getId())) { return null; } } else { client = org.getClient(); } OBContext.setAdminMode(false); try { StringBuilder where = new StringBuilder(); where.append(" as dt"); where.append(" where dt.organization.id in (:orgIdList)"); where.append(" and dt.client.id = :clientId"); where.append(" and dt.documentCategory = :docCategory"); where.append(" order by ad_isorgincluded(:orgId, dt.organization.id, :clientId)"); where.append(" , dt.default desc"); where.append(" , dt.id desc"); OBQuery<DocumentType> dt = OBDal.getInstance() .createQuery(DocumentType.class, where.toString()); dt.setFilterOnReadableClients(false); dt.setFilterOnReadableOrganization(false); dt.setMaxResult(1); dt.setNamedParameter("orgIdList", new OrganizationStructureProvider().getParentTree(org.getId(), true)); dt.setNamedParameter("clientId", client.getId()); dt.setNamedParameter("docCategory", docCategory); dt.setNamedParameter("orgId", org.getId()); return dt.uniqueResult(); } finally { OBContext.restorePreviousMode(); } } | ||||||||||||
Steps To Reproduce | N/A | ||||||||||||
Proposed Solution | Add the filter for isReturn on the query | ||||||||||||
Additional Information | |||||||||||||
Tags | No tags attached. | ||||||||||||
Relationships |
| ||||||||||||
Attached Files | |||||||||||||
Issue History | |||||||||||||
Date Modified | Username | Field | Change | ||||||||||
2019-08-13 10:23 | guillermogil | New Issue | |||||||||||
2019-08-13 10:23 | guillermogil | Assigned To | => Triage Finance | ||||||||||
2019-08-13 10:23 | guillermogil | Modules | => Advanced Payables and Receivables Mngmt | ||||||||||
2019-08-13 10:23 | guillermogil | Triggers an Emergency Pack | => No | ||||||||||
2019-08-13 10:30 | Sandrahuguet | Relationship added | has duplicate 0041056 | ||||||||||
2019-08-13 10:31 | Sandrahuguet | Note Added: 0113962 | |||||||||||
2019-08-13 10:31 | Sandrahuguet | Status | new => closed | ||||||||||
2019-08-13 10:31 | Sandrahuguet | Resolution | open => duplicate |
Notes | |||||
|
|||||
|
|