Attached Files | billing_contact.diff [^] (29,057 bytes) 2012-12-11 09:44 [Show Content] [Hide Content]# HG changeset patch
# User Víctor Martínez Romanos <victor.martinez@openbravo.com>
# Date 1355215347 -3600
# Node ID 249513189e14e5fab0f2967cb28ebab6f0aa495e
# Parent abfb4daeb91831dbb6796c3587f6857a8ed358f2
Fixed issue 22499: Billing Contact and Default Billing Contact
Added Billing Contact and Default Billing Contact flags to Business Partner | Contact
diff --git a/src-db/database/model/tables/AD_USER.xml b/src-db/database/model/tables/AD_USER.xml
--- a/src-db/database/model/tables/AD_USER.xml
+++ b/src-db/database/model/tables/AD_USER.xml
@@ -153,6 +153,14 @@
<default/>
<onCreateDefault/>
</column>
+ <column name="ISBILLINGCONTACT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+ <default><![CDATA[N]]></default>
+ <onCreateDefault><![CDATA['N']]></onCreateDefault>
+ </column>
+ <column name="ISDEFAULTBILLINGCONTACT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+ <default><![CDATA[N]]></default>
+ <onCreateDefault><![CDATA['N']]></onCreateDefault>
+ </column>
<foreign-key foreignTable="AD_ORG" name="AD_USER_AD_ORGTRX">
<reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
</foreign-key>
@@ -207,5 +215,7 @@
</unique>
<check name="AD_USER_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
<check name="AD_USER_ISLOCKED_CHECK"><![CDATA[ISLOCKED IN ('Y', 'N')]]></check>
+ <check name="ISBILLINGCONTACT_CHK"><![CDATA[ISBILLINGCONTACT IN ('N', 'Y')]]></check>
+ <check name="ISDEFAULTBILLINGCONTACT_CHK"><![CDATA[ISDEFAULTBILLINGCONTACT IN ('Y', 'N')]]></check>
</table>
</database>
diff --git a/src-db/database/sourcedata/AD_CALLOUT.xml b/src-db/database/sourcedata/AD_CALLOUT.xml
--- a/src-db/database/sourcedata/AD_CALLOUT.xml
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml
@@ -1036,6 +1036,15 @@
<!--DF9F61C8E2274735932F195DCF9CE949--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--DF9F61C8E2274735932F195DCF9CE949--></AD_CALLOUT>
+<!--DFE3C328ABF74F2188A55430812D3675--><AD_CALLOUT>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DFE3C328ABF74F2188A55430812D3675--> <NAME><![CDATA[SE_IsDefaultBillingContact]]></NAME>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--></AD_CALLOUT>
+
<!--E361D3C5088C46708474F2C6F1EC1EAE--><AD_CALLOUT>
<!--E361D3C5088C46708474F2C6F1EC1EAE--> <AD_CALLOUT_ID><![CDATA[E361D3C5088C46708474F2C6F1EC1EAE]]></AD_CALLOUT_ID>
<!--E361D3C5088C46708474F2C6F1EC1EAE--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_COLUMN.xml b/src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml
+++ b/src-db/database/sourcedata/AD_COLUMN.xml
@@ -295960,6 +295960,43 @@
<!--E77EF36212334A4391AAD490E6C261EE--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
<!--E77EF36212334A4391AAD490E6C261EE--></AD_COLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--><AD_COLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_COLUMN_ID><![CDATA[E793DF58F3914E0E844379B3D84154BF]]></AD_COLUMN_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <NAME><![CDATA[IsDefaultBillingContact]]></NAME>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--E793DF58F3914E0E844379B3D84154BF--> <COLUMNNAME><![CDATA[IsDefaultBillingContact]]></COLUMNNAME>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISKEY><![CDATA[N]]></ISKEY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E793DF58F3914E0E844379B3D84154BF--> <SEQNO><![CDATA[141]]></SEQNO>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_ELEMENT_ID><![CDATA[2B9BAAAB22D9436A882AABAF8D42E2C3]]></AD_ELEMENT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <POSITION><![CDATA[40]]></POSITION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E793DF58F3914E0E844379B3D84154BF--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E793DF58F3914E0E844379B3D84154BF--></AD_COLUMN>
+
<!--E7E1777671FD476A86073668B12CEF1E--><AD_COLUMN>
<!--E7E1777671FD476A86073668B12CEF1E--> <AD_COLUMN_ID><![CDATA[E7E1777671FD476A86073668B12CEF1E]]></AD_COLUMN_ID>
<!--E7E1777671FD476A86073668B12CEF1E--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -298059,6 +298096,43 @@
<!--FAA1FEF24A804354AF4FA092F219E375--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
<!--FAA1FEF24A804354AF4FA092F219E375--></AD_COLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--><AD_COLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_COLUMN_ID><![CDATA[FAD6ACCE29CD401BA1BFC928E816A2D8]]></AD_COLUMN_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <NAME><![CDATA[IsBillingContact]]></NAME>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <COLUMNNAME><![CDATA[IsBillingContact]]></COLUMNNAME>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISKEY><![CDATA[N]]></ISKEY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <SEQNO><![CDATA[131]]></SEQNO>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_ELEMENT_ID><![CDATA[C54DC8A126324BADAB1E747D316737CB]]></AD_ELEMENT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <POSITION><![CDATA[39]]></POSITION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--></AD_COLUMN>
+
<!--FAE30104BB194A8F9F11299FD81E3B95--><AD_COLUMN>
<!--FAE30104BB194A8F9F11299FD81E3B95--> <AD_COLUMN_ID><![CDATA[FAE30104BB194A8F9F11299FD81E3B95]]></AD_COLUMN_ID>
<!--FAE30104BB194A8F9F11299FD81E3B95--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_ELEMENT.xml b/src-db/database/sourcedata/AD_ELEMENT.xml
--- a/src-db/database/sourcedata/AD_ELEMENT.xml
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml
@@ -21071,6 +21071,20 @@
<!--22A76EB58F264A7BA616198175C3E4C5--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--22A76EB58F264A7BA616198175C3E4C5--></AD_ELEMENT>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--><AD_ELEMENT>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_ELEMENT_ID><![CDATA[2B9BAAAB22D9436A882AABAF8D42E2C3]]></AD_ELEMENT_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <COLUMNNAME><![CDATA[IsDefaultBillingContact]]></COLUMNNAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <NAME><![CDATA[Default Billing Contact]]></NAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <PRINTNAME><![CDATA[Default Billing Contact]]></PRINTNAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--></AD_ELEMENT>
+
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--><AD_ELEMENT>
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--> <AD_ELEMENT_ID><![CDATA[2D2C180E4B004B76AA0CE7C2ABA651A3]]></AD_ELEMENT_ID>
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -29070,6 +29084,20 @@
<!--C4EEB8D909BE8483E040007F01001710--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--C4EEB8D909BE8483E040007F01001710--></AD_ELEMENT>
+<!--C54DC8A126324BADAB1E747D316737CB--><AD_ELEMENT>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_ELEMENT_ID><![CDATA[C54DC8A126324BADAB1E747D316737CB]]></AD_ELEMENT_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C54DC8A126324BADAB1E747D316737CB--> <COLUMNNAME><![CDATA[IsBillingContact]]></COLUMNNAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <NAME><![CDATA[Billing Contact]]></NAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <PRINTNAME><![CDATA[Billing Contact]]></PRINTNAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--C54DC8A126324BADAB1E747D316737CB--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--C54DC8A126324BADAB1E747D316737CB--></AD_ELEMENT>
+
<!--C6ACAA689C7EBBDEE040007F01005838--><AD_ELEMENT>
<!--C6ACAA689C7EBBDEE040007F01005838--> <AD_ELEMENT_ID><![CDATA[C6ACAA689C7EBBDEE040007F01005838]]></AD_ELEMENT_ID>
<!--C6ACAA689C7EBBDEE040007F01005838--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_FIELD.xml b/src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml
+++ b/src-db/database/sourcedata/AD_FIELD.xml
@@ -214764,6 +214764,35 @@
<!--899BABCDEC0243A6B83473DE13AC1494--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--899BABCDEC0243A6B83473DE13AC1494--></AD_FIELD>
+<!--89E399E929F242379A51B358A2505AF8--><AD_FIELD>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_FIELD_ID><![CDATA[89E399E929F242379A51B358A2505AF8]]></AD_FIELD_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--89E399E929F242379A51B358A2505AF8--> <NAME><![CDATA[Billing Contact]]></NAME>
+<!--89E399E929F242379A51B358A2505AF8--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--89E399E929F242379A51B358A2505AF8--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--89E399E929F242379A51B358A2505AF8--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_TAB_ID><![CDATA[496]]></AD_TAB_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_COLUMN_ID><![CDATA[FAD6ACCE29CD401BA1BFC928E816A2D8]]></AD_COLUMN_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--89E399E929F242379A51B358A2505AF8--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--89E399E929F242379A51B358A2505AF8--> <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--89E399E929F242379A51B358A2505AF8--> <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--89E399E929F242379A51B358A2505AF8--> <SEQNO><![CDATA[170]]></SEQNO>
+<!--89E399E929F242379A51B358A2505AF8--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--89E399E929F242379A51B358A2505AF8--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--89E399E929F242379A51B358A2505AF8--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--89E399E929F242379A51B358A2505AF8--> <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--89E399E929F242379A51B358A2505AF8--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <GRID_SEQNO><![CDATA[110]]></GRID_SEQNO>
+<!--89E399E929F242379A51B358A2505AF8--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--89E399E929F242379A51B358A2505AF8--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--89E399E929F242379A51B358A2505AF8--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--89E399E929F242379A51B358A2505AF8--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--89E399E929F242379A51B358A2505AF8--></AD_FIELD>
+
<!--89FAD90840794836B8942FF1691B50C4--><AD_FIELD>
<!--89FAD90840794836B8942FF1691B50C4--> <AD_FIELD_ID><![CDATA[89FAD90840794836B8942FF1691B50C4]]></AD_FIELD_ID>
<!--89FAD90840794836B8942FF1691B50C4--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -244301,6 +244330,36 @@
<!--F3B4EB362BFD4277B79591C0AE3B7D9E--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--F3B4EB362BFD4277B79591C0AE3B7D9E--></AD_FIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--><AD_FIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_FIELD_ID><![CDATA[F3F1A68D87864A6788362AE11E47EA00]]></AD_FIELD_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <NAME><![CDATA[Default Billing Contact]]></NAME>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_TAB_ID><![CDATA[496]]></AD_TAB_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_COLUMN_ID><![CDATA[E793DF58F3914E0E844379B3D84154BF]]></AD_COLUMN_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DISPLAYLOGIC><![CDATA[@IsBillingContact@='Y']]></DISPLAYLOGIC>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <SEQNO><![CDATA[180]]></SEQNO>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <GRID_SEQNO><![CDATA[120]]></GRID_SEQNO>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F3F1A68D87864A6788362AE11E47EA00--></AD_FIELD>
+
<!--F40D332DCFD040E8BDB5D0CA208166B3--><AD_FIELD>
<!--F40D332DCFD040E8BDB5D0CA208166B3--> <AD_FIELD_ID><![CDATA[F40D332DCFD040E8BDB5D0CA208166B3]]></AD_FIELD_ID>
<!--F40D332DCFD040E8BDB5D0CA208166B3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MESSAGE.xml b/src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml
@@ -20261,6 +20261,17 @@
<!--D118FC6BB9A94833B758CC4A736B4A96--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--D118FC6BB9A94833B758CC4A736B4A96--></AD_MESSAGE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--><AD_MESSAGE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_MESSAGE_ID><![CDATA[D1EC5F6829234ABA88B23CE1DC5CD3A9]]></AD_MESSAGE_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <VALUE><![CDATA[DuplicatedBillingContactDefaults]]></VALUE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <MSGTEXT><![CDATA[%s has been previously defined as the Default Billing Contact. Only one contact per business partner can be set as the default billing contact.]]></MSGTEXT>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--></AD_MESSAGE>
+
<!--D250BF3879A44BED8CF73995F508F1FF--><AD_MESSAGE>
<!--D250BF3879A44BED8CF73995F508F1FF--> <AD_MESSAGE_ID><![CDATA[D250BF3879A44BED8CF73995F508F1FF]]></AD_MESSAGE_ID>
<!--D250BF3879A44BED8CF73995F508F1FF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
@@ -4088,6 +4088,18 @@
<!--BB540F2CEA514936B5E60216ACE844B3--> <NAME><![CDATA[ShowLogFile]]></NAME>
<!--BB540F2CEA514936B5E60216ACE844B3--></AD_MODEL_OBJECT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--><AD_MODEL_OBJECT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_MODEL_OBJECT_ID><![CDATA[BB5A41E6B65346AFAEFE9CECE735E1A5]]></AD_MODEL_OBJECT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ACTION><![CDATA[C]]></ACTION>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SE_IsDefaultBillingContact]]></CLASSNAME>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--></AD_MODEL_OBJECT>
+
<!--C020D3065FCC48C7BF34238EDBB6A45B--><AD_MODEL_OBJECT>
<!--C020D3065FCC48C7BF34238EDBB6A45B--> <AD_MODEL_OBJECT_ID><![CDATA[C020D3065FCC48C7BF34238EDBB6A45B]]></AD_MODEL_OBJECT_ID>
<!--C020D3065FCC48C7BF34238EDBB6A45B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
@@ -4160,6 +4160,16 @@
<!--8FFBEAE4CF644D3D98B19722BAE14E64--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
<!--8FFBEAE4CF644D3D98B19722BAE14E64--></AD_MODEL_OBJECT_MAPPING>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--><AD_MODEL_OBJECT_MAPPING>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[953F9CE76D364F0799BC3F3B20FD46A3]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_MODEL_OBJECT_ID><![CDATA[BB5A41E6B65346AFAEFE9CECE735E1A5]]></AD_MODEL_OBJECT_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <MAPPINGNAME><![CDATA[/ad_callouts/SE_IsDefaultBillingContact.html]]></MAPPINGNAME>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--></AD_MODEL_OBJECT_MAPPING>
+
<!--9C7DDC171D20464A9FA79C71B1516DE3--><AD_MODEL_OBJECT_MAPPING>
<!--9C7DDC171D20464A9FA79C71B1516DE3--> <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9C7DDC171D20464A9FA79C71B1516DE3]]></AD_MODEL_OBJECT_MAPPING_ID>
<!--9C7DDC171D20464A9FA79C71B1516DE3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java b/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
new file mode 100644
--- /dev/null
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
@@ -0,0 +1,90 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.1 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2012 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_callouts;
+
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.openbravo.base.filter.IsIDFilter;
+import org.openbravo.base.filter.RequestFilter;
+import org.openbravo.base.filter.ValueListFilter;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.ad.access.User;
+
+public class SE_IsDefaultBillingContact extends SimpleCallout {
+ private static final long serialVersionUID = 1L;
+ private static final RequestFilter filterYesNo = new ValueListFilter("Y", "N");
+
+ public void init(ServletConfig config) {
+ super.init(config);
+ boolHist = false;
+ }
+
+ @Override
+ protected void execute(CalloutInfo info) throws ServletException {
+ final String lastFieldChanged = info.getStringParameter("inpLastFieldChanged", null);
+ final String strValue = info.getStringParameter(lastFieldChanged, filterYesNo);
+ if ("inpisbillingcontact".equals(lastFieldChanged)) {
+ if ("N".equals(strValue)) {
+ info.addResult("inpisdefaultbillingcontact", "N");
+ }
+ } else if ("inpisdefaultbillingcontact".equals(lastFieldChanged)) {
+ if ("Y".equals(strValue)) {
+ final String cbpartnerId = info.getStringParameter("inpcBpartnerId", IsIDFilter.instance);
+ final String adUserId = info.getStringParameter("inpadUserId", IsIDFilter.instance);
+
+ OBContext.setAdminMode();
+ try {
+ final List<User> defaultBillingContacts = getDefaultBillingContacts(cbpartnerId, adUserId);
+ if (defaultBillingContacts != null && defaultBillingContacts.size() > 0) {
+ final String msg = String.format(
+ OBMessageUtils.messageBD("DuplicatedBillingContactDefaults"),
+ defaultBillingContacts.get(0).getIdentifier());
+ info.addResult("ERROR", msg);
+ info.addResult(info.getLastFieldChanged(), "N");
+ }
+ } finally {
+ OBContext.restorePreviousMode();
+ }
+ }
+ } else {
+ log4j.error("SE_IsDefaultBillingContact doesn't work for column: " + lastFieldChanged);
+ }
+ }
+
+ protected List<User> getDefaultBillingContacts(final String cbpartnerId,
+ final String currentUserId) {
+ final StringBuffer hql = new StringBuffer();
+ hql.append(" as u ");
+ hql.append(" where u.businessPartner.id = :c_bpartner_id ");
+ hql.append(" and u.id != :current_user_id");
+ hql.append(" and u.isBillingContact = true ");
+ hql.append(" and u.isDefaultBillingContact = true ");
+
+ final OBQuery<User> query = OBDal.getInstance().createQuery(User.class, hql.toString());
+ query.setNamedParameter("c_bpartner_id", cbpartnerId);
+ query.setNamedParameter("current_user_id", currentUserId);
+ return query.list();
+ }
+}
issue22499.diff [^] (40,242 bytes) 2012-12-27 15:54 [Show Content] [Hide Content]# HG changeset patch
# User Víctor Martínez Romanos <victor.martinez@openbravo.com>
# Date 1356619947 -3600
# Node ID fcf74b385c47e6f004630a3beb98721cc06a7653
# Parent a9605441d9c9ffcf76eaef82dfec97efeb20cbd5
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
diff --git a/src-db/database/model/tables/AD_USER.xml b/src-db/database/model/tables/AD_USER.xml
--- a/src-db/database/model/tables/AD_USER.xml
+++ b/src-db/database/model/tables/AD_USER.xml
@@ -153,6 +153,14 @@
<default/>
<onCreateDefault/>
</column>
+ <column name="ISBILLINGCONTACT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+ <default><![CDATA[Y]]></default>
+ <onCreateDefault><![CDATA['Y']]></onCreateDefault>
+ </column>
+ <column name="ISDEFAULTBILLINGCONTACT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+ <default><![CDATA[N]]></default>
+ <onCreateDefault><![CDATA['N']]></onCreateDefault>
+ </column>
<foreign-key foreignTable="AD_ORG" name="AD_USER_AD_ORGTRX">
<reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
</foreign-key>
@@ -206,6 +214,8 @@
<unique-column name="USERNAME"/>
</unique>
<check name="AD_USER_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+ <check name="AD_USER_ISBILLINGCONTACT_CHK"><![CDATA[ISBILLINGCONTACT IN ('N', 'Y')]]></check>
+ <check name="AD_USER_ISDEFBILLCONTACT_CHK"><![CDATA[ISDEFAULTBILLINGCONTACT IN ('Y', 'N')]]></check>
<check name="AD_USER_ISLOCKED_CHECK"><![CDATA[ISLOCKED IN ('Y', 'N')]]></check>
</table>
</database>
diff --git a/src-db/database/sourcedata/AD_CALLOUT.xml b/src-db/database/sourcedata/AD_CALLOUT.xml
--- a/src-db/database/sourcedata/AD_CALLOUT.xml
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml
@@ -1054,6 +1054,15 @@
<!--DF9F61C8E2274735932F195DCF9CE949--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--DF9F61C8E2274735932F195DCF9CE949--></AD_CALLOUT>
+<!--DFE3C328ABF74F2188A55430812D3675--><AD_CALLOUT>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DFE3C328ABF74F2188A55430812D3675--> <NAME><![CDATA[SE_IsDefaultBillingContact]]></NAME>
+<!--DFE3C328ABF74F2188A55430812D3675--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DFE3C328ABF74F2188A55430812D3675--></AD_CALLOUT>
+
<!--E361D3C5088C46708474F2C6F1EC1EAE--><AD_CALLOUT>
<!--E361D3C5088C46708474F2C6F1EC1EAE--> <AD_CALLOUT_ID><![CDATA[E361D3C5088C46708474F2C6F1EC1EAE]]></AD_CALLOUT_ID>
<!--E361D3C5088C46708474F2C6F1EC1EAE--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_COLUMN.xml b/src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml
+++ b/src-db/database/sourcedata/AD_COLUMN.xml
@@ -55655,7 +55655,7 @@
<!--3513--> <COLUMNNAME><![CDATA[AD_User_ID]]></COLUMNNAME>
<!--3513--> <AD_TABLE_ID><![CDATA[318]]></AD_TABLE_ID>
<!--3513--> <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
-<!--3513--> <AD_VAL_RULE_ID><![CDATA[123]]></AD_VAL_RULE_ID>
+<!--3513--> <AD_VAL_RULE_ID><![CDATA[6E743C8E42964321B89D23B12FCCA5B8]]></AD_VAL_RULE_ID>
<!--3513--> <FIELDLENGTH><![CDATA[22]]></FIELDLENGTH>
<!--3513--> <ISKEY><![CDATA[N]]></ISKEY>
<!--3513--> <ISPARENT><![CDATA[N]]></ISPARENT>
@@ -307329,6 +307329,43 @@
<!--E77EF36212334A4391AAD490E6C261EE--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
<!--E77EF36212334A4391AAD490E6C261EE--></AD_COLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--><AD_COLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_COLUMN_ID><![CDATA[E793DF58F3914E0E844379B3D84154BF]]></AD_COLUMN_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <NAME><![CDATA[IsDefaultBillingContact]]></NAME>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--E793DF58F3914E0E844379B3D84154BF--> <COLUMNNAME><![CDATA[IsDefaultBillingContact]]></COLUMNNAME>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISKEY><![CDATA[N]]></ISKEY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E793DF58F3914E0E844379B3D84154BF--> <SEQNO><![CDATA[141]]></SEQNO>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_ELEMENT_ID><![CDATA[2B9BAAAB22D9436A882AABAF8D42E2C3]]></AD_ELEMENT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E793DF58F3914E0E844379B3D84154BF--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E793DF58F3914E0E844379B3D84154BF--> <POSITION><![CDATA[40]]></POSITION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E793DF58F3914E0E844379B3D84154BF--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E793DF58F3914E0E844379B3D84154BF--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E793DF58F3914E0E844379B3D84154BF--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E793DF58F3914E0E844379B3D84154BF--></AD_COLUMN>
+
<!--E7C58E88594B4EAC96633F0C847C7D82--><AD_COLUMN>
<!--E7C58E88594B4EAC96633F0C847C7D82--> <AD_COLUMN_ID><![CDATA[E7C58E88594B4EAC96633F0C847C7D82]]></AD_COLUMN_ID>
<!--E7C58E88594B4EAC96633F0C847C7D82--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -310084,6 +310121,43 @@
<!--FAA1FEF24A804354AF4FA092F219E375--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
<!--FAA1FEF24A804354AF4FA092F219E375--></AD_COLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--><AD_COLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_COLUMN_ID><![CDATA[FAD6ACCE29CD401BA1BFC928E816A2D8]]></AD_COLUMN_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <NAME><![CDATA[IsBillingContact]]></NAME>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <COLUMNNAME><![CDATA[IsBillingContact]]></COLUMNNAME>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISKEY><![CDATA[N]]></ISKEY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <SEQNO><![CDATA[131]]></SEQNO>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_ELEMENT_ID><![CDATA[C54DC8A126324BADAB1E747D316737CB]]></AD_ELEMENT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <POSITION><![CDATA[39]]></POSITION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--FAD6ACCE29CD401BA1BFC928E816A2D8--></AD_COLUMN>
+
<!--FAE30104BB194A8F9F11299FD81E3B95--><AD_COLUMN>
<!--FAE30104BB194A8F9F11299FD81E3B95--> <AD_COLUMN_ID><![CDATA[FAE30104BB194A8F9F11299FD81E3B95]]></AD_COLUMN_ID>
<!--FAE30104BB194A8F9F11299FD81E3B95--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_ELEMENT.xml b/src-db/database/sourcedata/AD_ELEMENT.xml
--- a/src-db/database/sourcedata/AD_ELEMENT.xml
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml
@@ -21137,6 +21137,20 @@
<!--29ADAE46594E4364B62CB72C8D029D6F--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--29ADAE46594E4364B62CB72C8D029D6F--></AD_ELEMENT>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--><AD_ELEMENT>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_ELEMENT_ID><![CDATA[2B9BAAAB22D9436A882AABAF8D42E2C3]]></AD_ELEMENT_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <COLUMNNAME><![CDATA[IsDefaultBillingContact]]></COLUMNNAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <NAME><![CDATA[Default Billing Contact]]></NAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <PRINTNAME><![CDATA[Default Billing Contact]]></PRINTNAME>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--2B9BAAAB22D9436A882AABAF8D42E2C3--></AD_ELEMENT>
+
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--><AD_ELEMENT>
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--> <AD_ELEMENT_ID><![CDATA[2D2C180E4B004B76AA0CE7C2ABA651A3]]></AD_ELEMENT_ID>
<!--2D2C180E4B004B76AA0CE7C2ABA651A3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -29462,6 +29476,20 @@
<!--C4EEB8D909BE8483E040007F01001710--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--C4EEB8D909BE8483E040007F01001710--></AD_ELEMENT>
+<!--C54DC8A126324BADAB1E747D316737CB--><AD_ELEMENT>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_ELEMENT_ID><![CDATA[C54DC8A126324BADAB1E747D316737CB]]></AD_ELEMENT_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C54DC8A126324BADAB1E747D316737CB--> <COLUMNNAME><![CDATA[IsBillingContact]]></COLUMNNAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <NAME><![CDATA[Billing Contact]]></NAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <PRINTNAME><![CDATA[Billing Contact]]></PRINTNAME>
+<!--C54DC8A126324BADAB1E747D316737CB--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--C54DC8A126324BADAB1E747D316737CB--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--C54DC8A126324BADAB1E747D316737CB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C54DC8A126324BADAB1E747D316737CB--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--C54DC8A126324BADAB1E747D316737CB--></AD_ELEMENT>
+
<!--C6ACAA689C7EBBDEE040007F01005838--><AD_ELEMENT>
<!--C6ACAA689C7EBBDEE040007F01005838--> <AD_ELEMENT_ID><![CDATA[C6ACAA689C7EBBDEE040007F01005838]]></AD_ELEMENT_ID>
<!--C6ACAA689C7EBBDEE040007F01005838--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_FIELD.xml b/src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml
+++ b/src-db/database/sourcedata/AD_FIELD.xml
@@ -220573,6 +220573,35 @@
<!--899BABCDEC0243A6B83473DE13AC1494--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--899BABCDEC0243A6B83473DE13AC1494--></AD_FIELD>
+<!--89E399E929F242379A51B358A2505AF8--><AD_FIELD>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_FIELD_ID><![CDATA[89E399E929F242379A51B358A2505AF8]]></AD_FIELD_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--89E399E929F242379A51B358A2505AF8--> <NAME><![CDATA[Billing Contact]]></NAME>
+<!--89E399E929F242379A51B358A2505AF8--> <DESCRIPTION><![CDATA[Contact used for billing purposes]]></DESCRIPTION>
+<!--89E399E929F242379A51B358A2505AF8--> <HELP><![CDATA[Contact used for billing purposes]]></HELP>
+<!--89E399E929F242379A51B358A2505AF8--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_TAB_ID><![CDATA[496]]></AD_TAB_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_COLUMN_ID><![CDATA[FAD6ACCE29CD401BA1BFC928E816A2D8]]></AD_COLUMN_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--89E399E929F242379A51B358A2505AF8--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--89E399E929F242379A51B358A2505AF8--> <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--89E399E929F242379A51B358A2505AF8--> <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--89E399E929F242379A51B358A2505AF8--> <SEQNO><![CDATA[170]]></SEQNO>
+<!--89E399E929F242379A51B358A2505AF8--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--89E399E929F242379A51B358A2505AF8--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--89E399E929F242379A51B358A2505AF8--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--89E399E929F242379A51B358A2505AF8--> <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--89E399E929F242379A51B358A2505AF8--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--89E399E929F242379A51B358A2505AF8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--89E399E929F242379A51B358A2505AF8--> <GRID_SEQNO><![CDATA[110]]></GRID_SEQNO>
+<!--89E399E929F242379A51B358A2505AF8--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--89E399E929F242379A51B358A2505AF8--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--89E399E929F242379A51B358A2505AF8--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--89E399E929F242379A51B358A2505AF8--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--89E399E929F242379A51B358A2505AF8--></AD_FIELD>
+
<!--89FAD90840794836B8942FF1691B50C4--><AD_FIELD>
<!--89FAD90840794836B8942FF1691B50C4--> <AD_FIELD_ID><![CDATA[89FAD90840794836B8942FF1691B50C4]]></AD_FIELD_ID>
<!--89FAD90840794836B8942FF1691B50C4--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -256641,6 +256670,36 @@
<!--F3B4EB362BFD4277B79591C0AE3B7D9E--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
<!--F3B4EB362BFD4277B79591C0AE3B7D9E--></AD_FIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--><AD_FIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_FIELD_ID><![CDATA[F3F1A68D87864A6788362AE11E47EA00]]></AD_FIELD_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <NAME><![CDATA[Default Billing Contact]]></NAME>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DESCRIPTION><![CDATA[Default Billing Contact for the business partner]]></DESCRIPTION>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <HELP><![CDATA[The Default Billing Contact Checkbox indicates if this record will be used as the default contact for billing purposes]]></HELP>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_TAB_ID><![CDATA[496]]></AD_TAB_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_COLUMN_ID><![CDATA[E793DF58F3914E0E844379B3D84154BF]]></AD_COLUMN_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DISPLAYLOGIC><![CDATA[@IsBillingContact@='Y']]></DISPLAYLOGIC>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <SEQNO><![CDATA[180]]></SEQNO>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <GRID_SEQNO><![CDATA[120]]></GRID_SEQNO>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F3F1A68D87864A6788362AE11E47EA00--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F3F1A68D87864A6788362AE11E47EA00--></AD_FIELD>
+
<!--F40D332DCFD040E8BDB5D0CA208166B3--><AD_FIELD>
<!--F40D332DCFD040E8BDB5D0CA208166B3--> <AD_FIELD_ID><![CDATA[F40D332DCFD040E8BDB5D0CA208166B3]]></AD_FIELD_ID>
<!--F40D332DCFD040E8BDB5D0CA208166B3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MESSAGE.xml b/src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml
@@ -20712,6 +20712,17 @@
<!--D118FC6BB9A94833B758CC4A736B4A96--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--D118FC6BB9A94833B758CC4A736B4A96--></AD_MESSAGE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--><AD_MESSAGE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_MESSAGE_ID><![CDATA[D1EC5F6829234ABA88B23CE1DC5CD3A9]]></AD_MESSAGE_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <VALUE><![CDATA[DuplicatedBillingContactDefaults]]></VALUE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <MSGTEXT><![CDATA[%s has been previously defined as the Default Billing Contact. Only one contact per business partner can be set as the default billing contact.]]></MSGTEXT>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D1EC5F6829234ABA88B23CE1DC5CD3A9--></AD_MESSAGE>
+
<!--D250BF3879A44BED8CF73995F508F1FF--><AD_MESSAGE>
<!--D250BF3879A44BED8CF73995F508F1FF--> <AD_MESSAGE_ID><![CDATA[D250BF3879A44BED8CF73995F508F1FF]]></AD_MESSAGE_ID>
<!--D250BF3879A44BED8CF73995F508F1FF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
@@ -4136,6 +4136,18 @@
<!--BB540F2CEA514936B5E60216ACE844B3--> <NAME><![CDATA[ShowLogFile]]></NAME>
<!--BB540F2CEA514936B5E60216ACE844B3--></AD_MODEL_OBJECT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--><AD_MODEL_OBJECT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_MODEL_OBJECT_ID><![CDATA[BB5A41E6B65346AFAEFE9CECE735E1A5]]></AD_MODEL_OBJECT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ACTION><![CDATA[C]]></ACTION>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SE_IsDefaultBillingContact]]></CLASSNAME>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <AD_CALLOUT_ID><![CDATA[DFE3C328ABF74F2188A55430812D3675]]></AD_CALLOUT_ID>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--> <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--BB5A41E6B65346AFAEFE9CECE735E1A5--></AD_MODEL_OBJECT>
+
<!--C020D3065FCC48C7BF34238EDBB6A45B--><AD_MODEL_OBJECT>
<!--C020D3065FCC48C7BF34238EDBB6A45B--> <AD_MODEL_OBJECT_ID><![CDATA[C020D3065FCC48C7BF34238EDBB6A45B]]></AD_MODEL_OBJECT_ID>
<!--C020D3065FCC48C7BF34238EDBB6A45B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
@@ -4160,6 +4160,16 @@
<!--8FFBEAE4CF644D3D98B19722BAE14E64--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
<!--8FFBEAE4CF644D3D98B19722BAE14E64--></AD_MODEL_OBJECT_MAPPING>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--><AD_MODEL_OBJECT_MAPPING>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[953F9CE76D364F0799BC3F3B20FD46A3]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <AD_MODEL_OBJECT_ID><![CDATA[BB5A41E6B65346AFAEFE9CECE735E1A5]]></AD_MODEL_OBJECT_ID>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <MAPPINGNAME><![CDATA[/ad_callouts/SE_IsDefaultBillingContact.html]]></MAPPINGNAME>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--> <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--953F9CE76D364F0799BC3F3B20FD46A3--></AD_MODEL_OBJECT_MAPPING>
+
<!--9C7DDC171D20464A9FA79C71B1516DE3--><AD_MODEL_OBJECT_MAPPING>
<!--9C7DDC171D20464A9FA79C71B1516DE3--> <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9C7DDC171D20464A9FA79C71B1516DE3]]></AD_MODEL_OBJECT_MAPPING_ID>
<!--9C7DDC171D20464A9FA79C71B1516DE3--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_VAL_RULE.xml b/src-db/database/sourcedata/AD_VAL_RULE.xml
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml
@@ -1569,6 +1569,17 @@
<!--6BAE0C5334EE468DB58E0806C4F54FF0--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--6BAE0C5334EE468DB58E0806C4F54FF0--></AD_VAL_RULE>
+<!--6E743C8E42964321B89D23B12FCCA5B8--><AD_VAL_RULE>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <AD_VAL_RULE_ID><![CDATA[6E743C8E42964321B89D23B12FCCA5B8]]></AD_VAL_RULE_ID>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <NAME><![CDATA[AD_User C_BPartner Billing User/Contacts]]></NAME>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <TYPE><![CDATA[S]]></TYPE>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <CODE><![CDATA[AD_User.C_BPartner_ID=@C_BPartner_ID@ AND AD_User.IsBillingContact = 'Y']]></CODE>
+<!--6E743C8E42964321B89D23B12FCCA5B8--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6E743C8E42964321B89D23B12FCCA5B8--></AD_VAL_RULE>
+
<!--6ECC8AD47BD34F9790D844D5CB5EC9B6--><AD_VAL_RULE>
<!--6ECC8AD47BD34F9790D844D5CB5EC9B6--> <AD_VAL_RULE_ID><![CDATA[6ECC8AD47BD34F9790D844D5CB5EC9B6]]></AD_VAL_RULE_ID>
<!--6ECC8AD47BD34F9790D844D5CB5EC9B6--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java b/src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
@@ -255,41 +255,37 @@
resultado.append("null");
resultado.append("\n),");
- try {
- ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "AD_User_ID",
- "", "AD_User C_BPartner User/Contacts", Utility.getContext(this, vars,
- "#AccessibleOrgTree", strWindowId), Utility.getContext(this, vars, "#User_Client",
- strWindowId), 0);
- Utility.fillSQLParameters(this, vars, null, comboTableData, strWindowId, "");
- tdv = comboTableData.select(false);
- comboTableData = null;
- } catch (Exception ex) {
- throw new ServletException(ex);
- }
-
+ final BpartnerMiscData[] billingContactData = BpartnerMiscData.selectBillingContact(this,
+ strBPartner, "Y");
resultado.append("new Array(\"inpadUserId\", ");
- if (tdv != null && tdv.length > 0) {
+ if (billingContactData != null && billingContactData.length > 0) {
resultado.append("new Array(");
if (strContact.isEmpty()) {
- resultado.append("new Array(\"" + tdv[0].getField("id") + "\", \""
- + FormatUtilities.replaceJS(tdv[0].getField("name")) + "\", \"" + "true" + "\")");
- if (tdv.length > 1) {
+ resultado.append("new Array(\"" + billingContactData[0].getField("id") + "\", \""
+ + FormatUtilities.replaceJS(billingContactData[0].getField("name")) + "\", \""
+ + (billingContactData.length == 1 ? "true" : "false") + "\")");
+ if (billingContactData.length > 1) {
resultado.append(",\n");
}
- for (int i = 1; i < tdv.length; i++) {
- resultado.append("new Array(\"" + tdv[i].getField("id") + "\", \""
- + FormatUtilities.replaceJS(tdv[i].getField("name")) + "\", \"" + "false" + "\")");
- if (i < tdv.length - 1) {
+ for (int i = 1; i < billingContactData.length; i++) {
+ resultado.append("new Array(\"" + billingContactData[i].getField("id") + "\", \""
+ + FormatUtilities.replaceJS(billingContactData[i].getField("name")) + "\", \""
+ + (billingContactData.length == i ? "false" : "true") + "\")");
+ if (i < billingContactData.length - 1) {
resultado.append(",\n");
}
}
} else {
- for (int i = 0; i < tdv.length; i++) {
- resultado.append("new Array(\"" + tdv[i].getField("id") + "\", \""
- + FormatUtilities.replaceJS(tdv[i].getField("name")) + "\", \""
- + (tdv[i].getField("id").equalsIgnoreCase(strContact) ? "true" : "false") + "\")");
- if (i < tdv.length - 1) {
+ for (int i = 0; i < billingContactData.length; i++) {
+ resultado.append("new Array(\""
+ + billingContactData[i].getField("id")
+ + "\", \""
+ + FormatUtilities.replaceJS(billingContactData[i].getField("name"))
+ + "\", \""
+ + (billingContactData[i].getField("id").equalsIgnoreCase(strContact) ? "true"
+ : "false") + "\")");
+ if (i < billingContactData.length - 1) {
resultado.append(",\n");
}
}
diff --git a/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java b/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
new file mode 100644
--- /dev/null
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_IsDefaultBillingContact.java
@@ -0,0 +1,90 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.1 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2012 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_callouts;
+
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.openbravo.base.filter.IsIDFilter;
+import org.openbravo.base.filter.RequestFilter;
+import org.openbravo.base.filter.ValueListFilter;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.ad.access.User;
+
+public class SE_IsDefaultBillingContact extends SimpleCallout {
+ private static final long serialVersionUID = 1L;
+ private static final RequestFilter filterYesNo = new ValueListFilter("Y", "N");
+
+ public void init(ServletConfig config) {
+ super.init(config);
+ boolHist = false;
+ }
+
+ @Override
+ protected void execute(CalloutInfo info) throws ServletException {
+ final String lastFieldChanged = info.getStringParameter("inpLastFieldChanged", null);
+ final String strValue = info.getStringParameter(lastFieldChanged, filterYesNo);
+ if ("inpisbillingcontact".equals(lastFieldChanged)) {
+ if ("N".equals(strValue)) {
+ info.addResult("inpisdefaultbillingcontact", "N");
+ }
+ } else if ("inpisdefaultbillingcontact".equals(lastFieldChanged)) {
+ if ("Y".equals(strValue)) {
+ final String cbpartnerId = info.getStringParameter("inpcBpartnerId", IsIDFilter.instance);
+ final String adUserId = info.getStringParameter("inpadUserId", IsIDFilter.instance);
+
+ OBContext.setAdminMode();
+ try {
+ final List<User> defaultBillingContacts = getDefaultBillingContacts(cbpartnerId, adUserId);
+ if (defaultBillingContacts != null && defaultBillingContacts.size() > 0) {
+ final String msg = String.format(
+ OBMessageUtils.messageBD("DuplicatedBillingContactDefaults"),
+ defaultBillingContacts.get(0).getIdentifier());
+ info.addResult("ERROR", msg);
+ info.addResult(info.getLastFieldChanged(), "N");
+ }
+ } finally {
+ OBContext.restorePreviousMode();
+ }
+ }
+ } else {
+ log4j.error("SE_IsDefaultBillingContact doesn't work for column: " + lastFieldChanged);
+ }
+ }
+
+ protected List<User> getDefaultBillingContacts(final String cbpartnerId,
+ final String currentUserId) {
+ final StringBuffer hql = new StringBuffer();
+ hql.append(" as u ");
+ hql.append(" where u.businessPartner.id = :c_bpartner_id ");
+ hql.append(" and u.id != :current_user_id");
+ hql.append(" and u.isBillingContact = true ");
+ hql.append(" and u.isDefaultBillingContact = true ");
+
+ final OBQuery<User> query = OBDal.getInstance().createQuery(User.class, hql.toString());
+ query.setNamedParameter("c_bpartner_id", cbpartnerId);
+ query.setNamedParameter("current_user_id", currentUserId);
+ return query.list();
+ }
+}
diff --git a/src/org/openbravo/erpCommon/businessUtility/BpartnerMisc_data.xsql b/src/org/openbravo/erpCommon/businessUtility/BpartnerMisc_data.xsql
--- a/src/org/openbravo/erpCommon/businessUtility/BpartnerMisc_data.xsql
+++ b/src/org/openbravo/erpCommon/businessUtility/BpartnerMisc_data.xsql
@@ -12,7 +12,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All portions are Copyright (C) 2001-2012 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -35,7 +35,8 @@
p.InvoiceRule,p.DeliveryRule,DeliveryViaRule,
COALESCE(p.SO_CreditLimit-p.SO_CreditUsed,-1) AS CreditAvailable,
p.PO_PriceList_ID, p.PaymentRulePO, p.PO_PaymentTerm_ID, p.salesrep_Id,
- p.fin_paymentmethod_id, p.po_paymentmethod_id
+ p.fin_paymentmethod_id, p.po_paymentmethod_id,
+ '' as id, '' as name
FROM C_BPartner p
WHERE p.C_BPartner_ID=?
]]>
@@ -57,5 +58,20 @@
<Parameter name="adClientId"/>
<Parameter name="adClientId"/>
</SqlMethod>
+ <SqlMethod name="selectBillingContact" type="preparedStatement" return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ SELECT U.AD_USER_ID as id, ad_column_identifier('AD_USER', U.AD_USER_ID, 'en_US') as name
+ FROM AD_USER U
+ WHERE U.ISACTIVE='Y'
+ AND U.C_BPARTNER_ID = ?
+ AND U.ISBILLINGCONTACT = ?
+ ORDER BY U.ISDEFAULTBILLINGCONTACT ASC
+ ]]>
+ </Sql>
+ <Parameter name="cBpartnerId"/>
+ <Parameter name="isBillingContact"/>
+ </SqlMethod>
</SqlClass>
diff --git a/src/org/openbravo/erpCommon/utility/reporting/printing/Poc_data.xsql b/src/org/openbravo/erpCommon/utility/reporting/printing/Poc_data.xsql
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/Poc_data.xsql
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/Poc_data.xsql
@@ -195,6 +195,25 @@
</Sql>
<Parameter name="adUserId"/>
</SqlMethod>
+
+ <SqlMethod name="getCCContactDetailsForInvoices" type="preparedStatement" return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ select
+ customercontact.email as contact_email,
+ customercontact.name as contact_name
+ from
+ c_invoice
+ left join ad_user customercontact on c_invoice.c_bpartner_id = customercontact.c_bpartner_id
+ where customercontact.isbillingcontact = 'Y'
+ and customercontact.ad_user_id <> coalesce(?, '')
+ and c_invoice.c_invoice_id = ?
+ ]]>
+ </Sql>
+ <Parameter name="contactId" />
+ <Parameter name="cInvoiceId" />
+ </SqlMethod>
</SqlClass>
diff --git a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
@@ -79,6 +79,7 @@
private PocData[] pocData;
private boolean multiReports = false;
private boolean archivedReports = false;
+ private static final String EMAIL_SEPARATOR = ", ";
@Override
public void init(ServletConfig config) {
@@ -629,7 +630,36 @@
case SALESORDER:
return PocData.getContactDetailsForOrders(this, strDocumentId);
case SALESINVOICE:
- return PocData.getContactDetailsForInvoices(this, strDocumentId);
+ PocData[] data = PocData.getContactDetailsForInvoices(this, strDocumentId);
+ if (data != null && data.length > 0) {
+ for (final PocData d : data) {
+ final PocData[] ccData = PocData.getCCContactDetailsForInvoices(this, d.contactUserId,
+ d.documentId);
+
+ final StringBuffer ccEmail = new StringBuffer(d.contactEmail);
+ for (final PocData ccd : ccData) {
+ ccEmail.append(EMAIL_SEPARATOR);
+ ccEmail.append(ccd.contactEmail);
+ }
+ d.contactEmail = ccEmail.toString();
+ if (d.contactEmail != null && d.contactEmail.length() >= EMAIL_SEPARATOR.length()
+ && d.contactEmail.startsWith(EMAIL_SEPARATOR)) {
+ d.contactEmail = d.contactEmail.substring(EMAIL_SEPARATOR.length());
+ }
+
+ final StringBuffer ccName = new StringBuffer(d.contactName);
+ for (final PocData ccd : ccData) {
+ ccName.append(EMAIL_SEPARATOR);
+ ccName.append(ccd.contactName);
+ }
+ d.contactName = ccName.toString();
+ if (d.contactName != null && d.contactName.length() >= EMAIL_SEPARATOR.length()
+ && d.contactName.startsWith(EMAIL_SEPARATOR)) {
+ d.contactName = d.contactName.substring(EMAIL_SEPARATOR.length());
+ }
+ }
+ }
+ return data;
case SHIPMENT:
return PocData.getContactDetailsForShipments(this, strDocumentId);
case PURCHASEORDER:
|