IDEMPIERE-975 Issue in populating BP location for new sales order

This commit is contained in:
Carlos Ruiz 2013-06-04 15:14:18 -05:00
parent 6299a01f1d
commit f1fe920b97
4 changed files with 208 additions and 6 deletions

View File

@ -0,0 +1,76 @@
-- Jun 4, 2013 2:54:56 PM COT
-- IDEMPIERE-975 Issue in populating BP location for new sales order
UPDATE AD_InfoColumn SET SeqNo=50,Updated=TO_DATE('2013-06-04 14:54:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200038
;
-- Jun 4, 2013 2:55:01 PM COT
UPDATE AD_InfoColumn SET SeqNo=60,Updated=TO_DATE('2013-06-04 14:55:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200026
;
-- Jun 4, 2013 2:55:08 PM COT
UPDATE AD_InfoColumn SET SeqNo=70,Updated=TO_DATE('2013-06-04 14:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200027
;
-- Jun 4, 2013 2:55:14 PM COT
UPDATE AD_InfoColumn SET SeqNo=80,Updated=TO_DATE('2013-06-04 14:55:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200028
;
-- Jun 4, 2013 2:55:19 PM COT
UPDATE AD_InfoColumn SET SeqNo=90,Updated=TO_DATE('2013-06-04 14:55:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200029
;
-- Jun 4, 2013 2:55:23 PM COT
UPDATE AD_InfoColumn SET SeqNo=100,Updated=TO_DATE('2013-06-04 14:55:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200030
;
-- Jun 4, 2013 2:55:28 PM COT
UPDATE AD_InfoColumn SET SeqNo=110,Updated=TO_DATE('2013-06-04 14:55:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200031
;
-- Jun 4, 2013 2:55:43 PM COT
UPDATE AD_InfoColumn SET SeqNo=120,Updated=TO_DATE('2013-06-04 14:55:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200032
;
-- Jun 4, 2013 2:55:48 PM COT
UPDATE AD_InfoColumn SET SeqNo=130,Updated=TO_DATE('2013-06-04 14:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200033
;
-- Jun 4, 2013 2:55:53 PM COT
UPDATE AD_InfoColumn SET SeqNo=140,Updated=TO_DATE('2013-06-04 14:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200034
;
-- Jun 4, 2013 2:55:58 PM COT
UPDATE AD_InfoColumn SET SeqNo=150,Updated=TO_DATE('2013-06-04 14:55:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200035
;
-- Jun 4, 2013 2:56:04 PM COT
UPDATE AD_InfoColumn SET SeqNo=160,Updated=TO_DATE('2013-06-04 14:56:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200036
;
-- Jun 4, 2013 2:56:10 PM COT
UPDATE AD_InfoColumn SET SeqNo=170,Updated=TO_DATE('2013-06-04 14:56:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200037
;
-- Jun 4, 2013 2:56:20 PM COT
UPDATE AD_InfoColumn SET IsDisplayed='N',Updated=TO_DATE('2013-06-04 14:56:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200025
;
-- Jun 4, 2013 2:56:58 PM COT
INSERT INTO AD_InfoColumn (AD_InfoWindow_ID,Help,SeqNo,AD_InfoColumn_UU,AD_Reference_ID,AD_InfoColumn_ID,IsQueryCriteria,EntityType,Description,Created,CreatedBy,Updated,AD_Org_ID,UpdatedBy,Name,IsCentrallyMaintained,ColumnName,IsDisplayed,IsActive,AD_Element_ID,QueryOperator,SelectClause,SeqNoSelection,IsIdentifier,AD_Client_ID) VALUES (200001,'The User identifies a unique user in the system. This could be an internal user or a business partner contact',40,'d5b8ddfa-b7d1-4f78-b1ca-b964ba3d71e5',30,200114,'N','D','User within the system - Internal or Business Partner Contact',TO_DATE('2013-06-04 14:56:57','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-06-04 14:56:57','YYYY-MM-DD HH24:MI:SS'),0,100,'User/Contact','Y','AD_User_ID','Y','Y',138,'=','c.AD_User_ID',0,'N',0)
;
-- Jun 4, 2013 2:56:58 PM COT
INSERT INTO AD_InfoColumn_Trl (AD_Language,AD_InfoColumn_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_InfoColumn_Trl_UU ) SELECT l.AD_Language,t.AD_InfoColumn_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_InfoColumn t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_InfoColumn_ID=200114 AND NOT EXISTS (SELECT * FROM AD_InfoColumn_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_InfoColumn_ID=t.AD_InfoColumn_ID)
;
-- Jun 4, 2013 2:57:29 PM COT
INSERT INTO AD_InfoColumn (AD_InfoWindow_ID,Help,SeqNo,AD_InfoColumn_UU,AD_Reference_ID,AD_InfoColumn_ID,IsQueryCriteria,EntityType,Description,Created,CreatedBy,Updated,AD_Org_ID,UpdatedBy,Name,IsCentrallyMaintained,ColumnName,IsDisplayed,IsActive,AD_Element_ID,QueryOperator,SelectClause,SeqNoSelection,IsIdentifier,AD_Client_ID) VALUES (200001,'The Partner address indicates the location of a Business Partner',180,'927e1423-37d6-4930-b8b1-524ce3d53c74',30,200115,'N','D','Identifies the (ship to) address for this Business Partner',TO_DATE('2013-06-04 14:57:28','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-06-04 14:57:28','YYYY-MM-DD HH24:MI:SS'),0,100,'Partner Location','Y','C_BPartner_Location_ID','Y','Y',189,'=','l.C_BPartner_Location_ID',0,'N',0)
;
-- Jun 4, 2013 2:57:29 PM COT
INSERT INTO AD_InfoColumn_Trl (AD_Language,AD_InfoColumn_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_InfoColumn_Trl_UU ) SELECT l.AD_Language,t.AD_InfoColumn_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_InfoColumn t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_InfoColumn_ID=200115 AND NOT EXISTS (SELECT * FROM AD_InfoColumn_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_InfoColumn_ID=t.AD_InfoColumn_ID)
;
SELECT register_migration_script('201306041510_IDEMPIERE-975.sql') FROM dual
;

View File

@ -0,0 +1,76 @@
-- Jun 4, 2013 2:54:56 PM COT
-- IDEMPIERE-975 Issue in populating BP location for new sales order
UPDATE AD_InfoColumn SET SeqNo=50,Updated=TO_TIMESTAMP('2013-06-04 14:54:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200038
;
-- Jun 4, 2013 2:55:01 PM COT
UPDATE AD_InfoColumn SET SeqNo=60,Updated=TO_TIMESTAMP('2013-06-04 14:55:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200026
;
-- Jun 4, 2013 2:55:08 PM COT
UPDATE AD_InfoColumn SET SeqNo=70,Updated=TO_TIMESTAMP('2013-06-04 14:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200027
;
-- Jun 4, 2013 2:55:14 PM COT
UPDATE AD_InfoColumn SET SeqNo=80,Updated=TO_TIMESTAMP('2013-06-04 14:55:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200028
;
-- Jun 4, 2013 2:55:19 PM COT
UPDATE AD_InfoColumn SET SeqNo=90,Updated=TO_TIMESTAMP('2013-06-04 14:55:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200029
;
-- Jun 4, 2013 2:55:23 PM COT
UPDATE AD_InfoColumn SET SeqNo=100,Updated=TO_TIMESTAMP('2013-06-04 14:55:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200030
;
-- Jun 4, 2013 2:55:28 PM COT
UPDATE AD_InfoColumn SET SeqNo=110,Updated=TO_TIMESTAMP('2013-06-04 14:55:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200031
;
-- Jun 4, 2013 2:55:43 PM COT
UPDATE AD_InfoColumn SET SeqNo=120,Updated=TO_TIMESTAMP('2013-06-04 14:55:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200032
;
-- Jun 4, 2013 2:55:48 PM COT
UPDATE AD_InfoColumn SET SeqNo=130,Updated=TO_TIMESTAMP('2013-06-04 14:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200033
;
-- Jun 4, 2013 2:55:53 PM COT
UPDATE AD_InfoColumn SET SeqNo=140,Updated=TO_TIMESTAMP('2013-06-04 14:55:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200034
;
-- Jun 4, 2013 2:55:58 PM COT
UPDATE AD_InfoColumn SET SeqNo=150,Updated=TO_TIMESTAMP('2013-06-04 14:55:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200035
;
-- Jun 4, 2013 2:56:04 PM COT
UPDATE AD_InfoColumn SET SeqNo=160,Updated=TO_TIMESTAMP('2013-06-04 14:56:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200036
;
-- Jun 4, 2013 2:56:10 PM COT
UPDATE AD_InfoColumn SET SeqNo=170,Updated=TO_TIMESTAMP('2013-06-04 14:56:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200037
;
-- Jun 4, 2013 2:56:20 PM COT
UPDATE AD_InfoColumn SET IsDisplayed='N',Updated=TO_TIMESTAMP('2013-06-04 14:56:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200025
;
-- Jun 4, 2013 2:56:58 PM COT
INSERT INTO AD_InfoColumn (AD_InfoWindow_ID,Help,SeqNo,AD_InfoColumn_UU,AD_Reference_ID,AD_InfoColumn_ID,IsQueryCriteria,EntityType,Description,Created,CreatedBy,Updated,AD_Org_ID,UpdatedBy,Name,IsCentrallyMaintained,ColumnName,IsDisplayed,IsActive,AD_Element_ID,QueryOperator,SelectClause,SeqNoSelection,IsIdentifier,AD_Client_ID) VALUES (200001,'The User identifies a unique user in the system. This could be an internal user or a business partner contact',40,'d5b8ddfa-b7d1-4f78-b1ca-b964ba3d71e5',30,200114,'N','D','User within the system - Internal or Business Partner Contact',TO_TIMESTAMP('2013-06-04 14:56:57','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-06-04 14:56:57','YYYY-MM-DD HH24:MI:SS'),0,100,'User/Contact','Y','AD_User_ID','Y','Y',138,'=','c.AD_User_ID',0,'N',0)
;
-- Jun 4, 2013 2:56:58 PM COT
INSERT INTO AD_InfoColumn_Trl (AD_Language,AD_InfoColumn_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_InfoColumn_Trl_UU ) SELECT l.AD_Language,t.AD_InfoColumn_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_InfoColumn t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_InfoColumn_ID=200114 AND NOT EXISTS (SELECT * FROM AD_InfoColumn_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_InfoColumn_ID=t.AD_InfoColumn_ID)
;
-- Jun 4, 2013 2:57:29 PM COT
INSERT INTO AD_InfoColumn (AD_InfoWindow_ID,Help,SeqNo,AD_InfoColumn_UU,AD_Reference_ID,AD_InfoColumn_ID,IsQueryCriteria,EntityType,Description,Created,CreatedBy,Updated,AD_Org_ID,UpdatedBy,Name,IsCentrallyMaintained,ColumnName,IsDisplayed,IsActive,AD_Element_ID,QueryOperator,SelectClause,SeqNoSelection,IsIdentifier,AD_Client_ID) VALUES (200001,'The Partner address indicates the location of a Business Partner',180,'927e1423-37d6-4930-b8b1-524ce3d53c74',30,200115,'N','D','Identifies the (ship to) address for this Business Partner',TO_TIMESTAMP('2013-06-04 14:57:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-06-04 14:57:28','YYYY-MM-DD HH24:MI:SS'),0,100,'Partner Location','Y','C_BPartner_Location_ID','Y','Y',189,'=','l.C_BPartner_Location_ID',0,'N',0)
;
-- Jun 4, 2013 2:57:29 PM COT
INSERT INTO AD_InfoColumn_Trl (AD_Language,AD_InfoColumn_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_InfoColumn_Trl_UU ) SELECT l.AD_Language,t.AD_InfoColumn_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_InfoColumn t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_InfoColumn_ID=200115 AND NOT EXISTS (SELECT * FROM AD_InfoColumn_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_InfoColumn_ID=t.AD_InfoColumn_ID)
;
SELECT register_migration_script('201306041510_IDEMPIERE-975.sql') FROM dual
;

View File

@ -6,6 +6,7 @@ package org.adempiere.webui.info;
import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.editor.WEditor;
import org.adempiere.webui.panel.InvoiceHistory; import org.adempiere.webui.panel.InvoiceHistory;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Util; import org.compiere.util.Util;
/** /**
@ -13,11 +14,13 @@ import org.compiere.util.Util;
* *
*/ */
public class InfoBPartnerWindow extends InfoWindow { public class InfoBPartnerWindow extends InfoWindow {
/** /**
* *
*/ */
private static final long serialVersionUID = -8994747783253141939L; private static final long serialVersionUID = -7970170769665110830L;
private int m_AD_User_ID_index = -1;
private int m_C_BPartner_Location_ID_index = -1;
/** /**
* @param WindowNo * @param WindowNo
@ -105,4 +108,51 @@ public class InfoBPartnerWindow extends InfoWindow {
} }
} }
} }
@Override
protected void saveSelectionDetail() {
int row = contentPanel.getSelectedRow();
if (row == -1)
return;
int AD_User_ID = 0;
int C_BPartner_Location_ID = 0;
if (m_AD_User_ID_index != -1)
{
Object data =contentPanel.getValueAt(row, m_AD_User_ID_index);
if (data instanceof KeyNamePair)
AD_User_ID = ((KeyNamePair)data).getKey();
}
//
if (m_C_BPartner_Location_ID_index != -1)
{
Object data =contentPanel.getValueAt(row, m_C_BPartner_Location_ID_index);
if (data instanceof KeyNamePair)
C_BPartner_Location_ID = ((KeyNamePair)data).getKey();
}
// publish for Callout to read
Integer ID = getSelectedRowKey();
Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_ID", ID == null ? "0" : ID.toString());
Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "AD_User_ID", String.valueOf(AD_User_ID));
Env.setContext(Env.getCtx(), p_WindowNo, Env.TAB_INFO, "C_BPartner_Location_ID", String.valueOf(C_BPartner_Location_ID));
super.saveSelectionDetail();
}
@Override
protected void prepareTable() {
super.prepareTable();
// Get indexes
for (int i = 0; i < p_layout.length; i++)
{
if (p_layout[i].getKeyPairColSQL().indexOf("AD_User_ID") != -1)
m_AD_User_ID_index = i;
//
if (p_layout[i].getKeyPairColSQL().indexOf("C_BPartner_Location_ID") != -1)
m_C_BPartner_Location_ID_index = i;
}
}
} }

View File

@ -70,11 +70,11 @@ import org.zkoss.zul.Vbox;
* *
*/ */
public class InfoWindow extends InfoPanel implements ValueChangeListener, EventListener<Event> { public class InfoWindow extends InfoPanel implements ValueChangeListener, EventListener<Event> {
/** /**
* generated serial id *
*/ */
private static final long serialVersionUID = -6235804178650786285L; private static final long serialVersionUID = -2133132636255923989L;
protected Grid parameterGrid; protected Grid parameterGrid;
private Borderlayout layout; private Borderlayout layout;
private Vbox southBody; private Vbox southBody;
@ -243,7 +243,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
} }
} }
private void prepareTable() { protected void prepareTable() {
List<ColumnInfo> list = new ArrayList<ColumnInfo>(); List<ColumnInfo> list = new ArrayList<ColumnInfo>();
String keyTableAlias = tableInfos[0].getSynonym() != null && tableInfos[0].getSynonym().trim().length() > 0 String keyTableAlias = tableInfos[0].getSynonym() != null && tableInfos[0].getSynonym().trim().length() > 0
? tableInfos[0].getSynonym() ? tableInfos[0].getSynonym()