Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022499Openbravo ERP02. Master data managementpublic2012-12-10 17:322013-02-13 19:05
vmromanos 
vmromanos 
normalminorN/A
newopen 
20Debian 5.0
pi 
3.0MP19 
mirurita
Core
No
0022499: Add Billing Contact and Default Billing Contact to Business Partner | Contact
We need 2 new flags inside Business Partner | Contact tab:
* Billing Contact: Indicates whether the contact should be used for billing purposes
* Default Billing Contact: The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes. The default billing contact should be unique per business partner.

The contact when creating an invoice must be automatically set to the default billing contact for the business partner (is any), or to any billing contact in case the business partner doesn't have a default billing contact.
This selector must only show contacts with billing contact = 'Y'

When sending email for invoices, the "To" field must be automatically set to a comma-separated list of the business partner's billing contacts.
In case we select several invoices from different business partners, the To field is hidden (as usual), and the invoices must be sent to the right billing contacts for each business partner (i.e., not mixing billing contacts from different business partners)

NA
See attached patch
Coworking
related to defect 0022809 closed vmromanos Revert fix for feature request 0022499 
related to defect 00228283.0MP20 closed dmiguelez API Change after reverting billing contact feature 
diff billing_contact.diff (29,057) 2012-12-11 09:44
https://issues.openbravo.com/file_download.php?file_id=5812&type=bug
diff issue22499.diff (40,242) 2012-12-27 15:54
https://issues.openbravo.com/file_download.php?file_id=5865&type=bug
Issue History
2012-12-10 17:32vmromanosNew Issue
2012-12-10 17:32vmromanosAssigned To => vmromanos
2012-12-10 17:32vmromanosModules => Core
2012-12-10 17:32vmromanosTriggers an Emergency Pack => No
2012-12-10 17:32vmromanosTag Attached: Coworking
2012-12-10 18:20vmromanosFile Added: billing_contact.diff
2012-12-10 18:24vmromanosNote Added: 0054820
2012-12-11 09:43vmromanosFile Deleted: billing_contact.diff
2012-12-11 09:44vmromanosFile Added: billing_contact.diff
2012-12-19 07:26eintelauIssue Monitored: eintelau
2012-12-27 13:18vmromanosDescription Updatedbug_revision_view_page.php?rev_id=4234#r4234
2012-12-27 13:27vmromanosStatusnew => scheduled
2012-12-27 13:27vmromanosNote Added: 0055244
2012-12-27 13:27vmromanosfix_in_branch => pi
2012-12-27 15:54vmromanosFile Added: issue22499.diff
2012-12-28 08:24hgbotCheckin
2012-12-28 08:24hgbotNote Added: 0055259
2012-12-28 08:24hgbotStatusscheduled => resolved
2012-12-28 08:24hgbotResolutionopen => fixed
2012-12-28 08:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3414d3437d81f6648d7907948fc26a972ec19d91 [^]
2012-12-28 11:28hgbotCheckin
2012-12-28 11:28hgbotNote Added: 0055264
2012-12-28 11:28hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3414d3437d81f6648d7907948fc26a972ec19d91 [^] => http://code.openbravo.com/erp/devel/pi/rev/8087f8dd86c9bfbd59844fbd0833e721df27d043 [^]
2013-01-03 13:12hudsonbotCheckin
2013-01-03 13:12hudsonbotNote Added: 0055334
2013-01-03 13:12hudsonbotCheckin
2013-01-03 13:12hudsonbotNote Added: 0055337
2013-01-09 17:56miruritaReview Assigned To => mirurita
2013-01-09 17:56miruritaNote Added: 0055431
2013-01-09 17:56miruritaStatusresolved => closed
2013-01-09 17:56miruritaFixed in Version => 3.0MP19
2013-01-16 16:30vmromanosRelationship addedrelated to 0022809
2013-01-17 17:13vmromanosRelationship addedrelated to 0022828
2013-02-13 19:05dmitry_mezentsevNote Added: 0056419
2013-02-13 19:05dmitry_mezentsevStatusclosed => new
2013-02-13 19:05dmitry_mezentsevResolutionfixed => open
2013-02-13 19:05dmitry_mezentsevFixed in Version3.0MP19 =>

Notes
(0054820)
vmromanos   
2012-12-10 18:24   
Test Plan:
1. Go to Business Partner. Select any record
2. Go to contact tab.
3. Select any record (or create a new one)
4. Set Billing Contact = 'Y'
5. Default Billing Contact is displayed. Set Default Billing Contact='Y'
6. Create a new contact
7. Set Billing Contact = 'Y'
8. Default Billing Contact is displayed. Set Default Billing Contact='Y'
9. An Error is displayed informing there is a previous default billing contact for this business partner
10. Select any other business partner in the header
11. Repeat steps 2 to 9
(0055244)
vmromanos   
2012-12-27 13:27   
Test plan II (update):
From an older MP, update to PI and ensure previous contacts are automatically set to isbillingcontact = 'Y' and isdefaultbillingcontact='N'

Test plan III (invoice):
1. Display the field associated to the ad_user_id column inside the Sales Invoice header (hidden by default)
2. For any bp create several contacts: some of them set as billing contact = 'N' and 'Y'. Set any of the contacts as default billing contact = 'Y'. Fill the email address
3. Create a sales invoice header for that bp
4. Ensure the default billing contact has been automatically set.
5. Change the bp. Ensure the contact has been updated.
6. Change once again to the previous bp. Ensure the default billing contact has been automatically set.
7. Create some lines and complete the invoice.


Test plan IV (send invoice):
1. Press the send email button. You should previously create the right configuration in the Client window
2. Ensure the To field contains the list of contacts in the popup
3. Close the popup
4. Now select 2 or more invoices from the same bp
5. Press the send email button.
6. Ensure the To field contains the list of contacts in the popup
7. Send the email and check it has been properly sent
8. Now select several invoices from different bp.
9. Press the send email button. The To field is hidden
10. Send the emails.
11. Ensure the emails are sent to the right contacts for each business partner
(0055259)
hgbot   
2012-12-28 08:24   
Repository: erp/devel/pi
Changeset: 3414d3437d81f6648d7907948fc26a972ec19d91
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Dec 27 15:52:27 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3414d3437d81f6648d7907948fc26a972ec19d91 [^]

Fixed issue 22499: Billing Contact for Business Partner
Added Billing Contact and Default Billing Contact to Business Partner | Contact
A callout controls only one contact is set as default billing contact per business partner
In Sales/Purchase Invoice window, we only show billing contact = 'Y'. By default is set to the default billing contact (if any)
The sending email process automatically sets the To field with the list of billing contacts for each business partner

---
M src-db/database/model/tables/AD_USER.xml
M src-db/database/sourcedata/AD_CALLOUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M src-db/database/sourcedata/AD_VAL_RULE.xml
M src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
M src/org/openbravo/erpCommon/businessUtility/BpartnerMisc_data.xsql
M src/org/openbravo/erpCommon/utility/reporting/printing/Poc_data.xsql
M src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
A src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
---
(0055264)
hgbot   
2012-12-28 11:28   
Repository: erp/devel/pi
Changeset: 8087f8dd86c9bfbd59844fbd0833e721df27d043
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Dec 28 11:27:40 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8087f8dd86c9bfbd59844fbd0833e721df27d043 [^]

Fixed issue 22499: applied code review

---
M src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
---
(0055334)
hudsonbot   
2013-01-03 13:12   
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/792728467ed0 [^]

Maturity status: Test
(0055337)
hudsonbot   
2013-01-03 13:12   
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/792728467ed0 [^]

Maturity status: Test
(0055431)
mirurita   
2013-01-09 17:56   
code review + testing OK.

Test Plan 1: ok
Test Plan 2: ok
Test Plan 3: ok
Test Plan 4: ok
(0056419)
dmitry_mezentsev   
2013-02-13 19:05   
It was long time ago but I am reopening this ticket because for core it was not working well.

I think the feature should work the following way.
We have 2 topics here.
1. Now there is a problem that BP can have several contacts but there is no way to define which one to use for documents by default.
* New "Primary Contact" field that is unique but optional should be added to the Contacts. If it is not selected application works as it is now. If it is - Contact used in the documents (all documents where it is applicable) is defaulted to Primary Contact.

2. When sending documents by email there is no way to put other BP´s contacts in the copy.
* New "Copy Emails to Contact" field that is optional should be added to the Contacts. If it is not selected application works as it is now. If it is when email is send it is copied to this contact´s email (shown in CC field in the pop-up or just copied in mass mailing).