Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041909Openbravo ERP07. Sales managementpublic2019-10-01 13:202019-12-12 23:01
francisco 
markmm82 
highmajoralways
closedfixed 
5
 
3.0PR20Q1 
Sandrahuguet
Core
No
0041909: Create sales order from expenses does not filter correctly
In the business partner selector of the create sales order from expenses window we identified the following issue

- when we have no contacts the business partner shows up
- when we have a contact but the contact is made inactive the business partner does not appear

We would expect the business partner to appear also if the contact is not active - because the business partner is active
Tested in local because it needs the license.
A)
activate the create sales order from expenses:
1) Access to the Module window as System Admin
2) Select Openbravo For Retail module
3) Disable la opton 'Apply configuration script'
4) compile application:

ant smartbuild -Dlocal=no

5) Reboot Tomcat

B)
1. Create a business partner without contacts and retrieve the business parter in the create salesorder from expense window -> see that the businessparter is apearing when searching by name
2. add a contact to this businessparter - make sure the contact is deactivated (the user is deactived)
3. retrieve the businesspartner in the create salesorder fom expense window --> the businessparter does not appear anymore
No tags attached.
Issue History
2019-10-01 13:20franciscoNew Issue
2019-10-01 13:20franciscoAssigned To => Triage Finance
2019-10-01 13:20franciscoModules => Core
2019-10-01 13:20franciscoResolution time => 1571695200
2019-10-01 13:20franciscoTriggers an Emergency Pack => No
2019-10-01 15:19SandrahuguetAssigned ToTriage Finance => markmm82
2019-10-01 15:29markmm82Statusnew => scheduled
2019-10-02 03:10markmm82Note Added: 0114881
2019-10-02 03:45markmm82Note Added: 0114882
2019-10-02 03:46markmm82Note Edited: 0114882bug_revision_view_page.php?bugnote_id=0114882#r19423
2019-10-03 17:19hgbotCheckin
2019-10-03 17:19hgbotNote Added: 0114907
2019-10-03 17:19hgbotStatusscheduled => resolved
2019-10-03 17:19hgbotResolutionopen => fixed
2019-10-03 17:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e26e7f1d7c128b4479b9c092efd85ccc82a12f28 [^]
2019-10-03 17:52SandrahuguetReview Assigned To => Sandrahuguet
2019-10-03 17:52SandrahuguetNote Added: 0114908
2019-10-03 17:52SandrahuguetStatusresolved => closed
2019-10-03 17:52SandrahuguetFixed in Version => 3.0PR20Q1
2019-12-12 23:01hudsonbotCheckin
2019-12-12 23:01hudsonbotNote Added: 0116234

Notes
(0114881)
markmm82   
2019-10-02 03:10   
Test Plan:
As System Admin:
  Activate instance

As F&B Group Admin:
  Go to Business Partner window and create a new header.
    Notice it was created as customer by default.
  Do not define any other information than default.

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice the new Business Partner is there.
    Notice there aren't any information related to the contact as we didn't define it.

  Go back to the Business Partner window.
  Go to Contact tab and a new one.
  Set as active:
    Active = Yes

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice the new Business Partner is there.
    Notice there is the information related to the contact.

  Go back to the Business Partner window.
  Go to Contact tab and a modify the existing one.
  Set as inactive:
    Active = No

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice the new Business Partner is there.
    Notice there aren't any information related to the contact as it exists but is inactive.
(0114882)
markmm82   
2019-10-02 03:45   
(edited on: 2019-10-02 03:46)
Test Plan: Business Partner with Multiple Contacts
As System Admin:
  Activate instance

As F&B Group Admin:
  Go to Business Partner window and create a new header.
    Notice it was created as customer by default.
  Go to Contact tab and create a new one.
    Name = Contact A
    Active = Yes
  Go to Contact tab and create a new one.
    Name = Contact B
    Active = Yes
  Go to Contact tab and create a new one.
    Name = Contact C
    Active = Yes

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice the are three entries with the new Business Partner.
    Each one related to each business partner contact.

  Go back to the Business Partner window.
  Go to Contact tab and set as inactive one of the contacts, for example Contact B

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice this time there are just two entries related to the Business Partner (related to Contact A and Contact C).
    Notice there isn't any information related to the "Contact B", it exists but is inactive.

  Go back to the Business Partner window.
  Go to Contact tab and set as inactive Contact A

  Open Create Sales Order from Expenses process.
  Open Customer selector.
    Notice this time there are just one entry related to the Business Partner and it is showing the information for the "Contact C", as it is the only contact that is active.

  Go back to the Business Partner window.
  Go to Contact tab and set as inactive Contact C
  Notice the business partner hasn't active contacts.

  Open Create Sales Order from Expenses process.
  Open Customer selector.
  Notice there is an entry for the Business Partner but it hasn't any contact information.

(0114907)
hgbot   
2019-10-03 17:19   
Repository: erp/devel/pi
Changeset: e26e7f1d7c128b4479b9c092efd85ccc82a12f28
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Tue Oct 01 21:51:19 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/e26e7f1d7c128b4479b9c092efd85ccc82a12f28 [^]

Fixes issue 41909: Fixed BP filtering on Create sales order from expenses

If the Business Partner had an inactive contact, query loading records of the BP
selector was not taking into account the business partner itself. It was caused
by an incorrect filtering at WHERE CLAUSE for those business partners without a
contact or with an active contact, instead of doing at join time with the AD_USER
table.

The solution was to move the condition (u.isactive is null OR u.isactive='Y') to be
validated at the JOIN with the AD_User table, so if there is a contact but it is inactive
then information of the contact will be not retrieved, but that related with the business
partner yes.

---
M src/org/openbravo/erpCommon/info/BusinessPartner_data.xsql
---
(0114908)
Sandrahuguet   
2019-10-03 17:52   
code review + testing ok
(0116234)
hudsonbot   
2019-12-12 23:01   
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/954d2b7a66fb [^]
Maturity status: Test