IDEMPIERE-3532 Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx)

This commit is contained in:
Nicolas Micoud 2017-11-08 10:58:09 +01:00
parent 6a76072a43
commit 6950087449
4 changed files with 36 additions and 58 deletions

View File

@ -0,0 +1,18 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-3532 - Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx)
-- Oct 27, 2017 5:16:11 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@C_BPartner_ID@',Updated=TO_DATE('2017-10-27 17:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200052
;
-- Oct 27, 2017 5:16:25 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_DATE('2017-10-27 17:16:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200066
;
-- Oct 27, 2017 5:17:29 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_DATE('2017-10-27 17:17:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200085
;
SELECT register_migration_script('201705041136_IDEMPIERE-3338.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- IDEMPIERE-3532 - Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx)
-- Oct 27, 2017 5:16:12 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@C_BPartner_ID@',Updated=TO_TIMESTAMP('2017-10-27 17:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200052
;
-- Oct 27, 2017 5:16:25 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2017-10-27 17:16:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200066
;
-- Oct 27, 2017 5:17:29 PM CEST
UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2017-10-27 17:17:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200085
;
SELECT register_migration_script('201705041136_IDEMPIERE-3338.sql') FROM dual
;

View File

@ -3,9 +3,7 @@
*/
package org.adempiere.webui.info;
import org.adempiere.webui.editor.WEditor;
import org.compiere.util.Env;
import org.compiere.util.Util;
/**
* @author hengsin
@ -15,7 +13,7 @@ public class InfoInvoiceWindow extends InfoWindow {
/**
*
*/
private static final long serialVersionUID = -3169476148884310274L;
private static final long serialVersionUID = -5175983673145977830L;
/**
* @param WindowNo
@ -49,37 +47,6 @@ public class InfoInvoiceWindow extends InfoWindow {
super(WindowNo, tableName, keyColumn, queryValue, multipleSelection,
whereClause, AD_InfoWindow_ID, lookup);
}
/**
* {@inheritDoc}
*/
@Override
protected void initParameters() {
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
if (!isLookup() && Util.isEmpty(isSOTrx)) {
isSOTrx = "Y";
}
//Set Defaults
String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID");
if (!Util.isEmpty(bp)) {
for (WEditor editor : editors) {
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("C_BPartner_ID")) {
editor.setValue(new Integer(bp));
break;
}
}
}
if (!Util.isEmpty(isSOTrx)) {
for (WEditor editor : editors) {
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsSOTrx")) {
editor.setValue(isSOTrx);
break;
}
}
}
}
@Override
protected void saveSelectionDetail() {

View File

@ -3,10 +3,6 @@
*/
package org.adempiere.webui.info;
import org.adempiere.webui.editor.WEditor;
import org.compiere.util.Env;
import org.compiere.util.Util;
/**
* @author hengsin
*
@ -15,7 +11,7 @@ public class InfoPaymentWindow extends InfoWindow {
/**
*
*/
private static final long serialVersionUID = -3556977962189259779L;
private static final long serialVersionUID = 1322780214387328688L;
/**
* @param WindowNo
@ -50,23 +46,4 @@ public class InfoPaymentWindow extends InfoWindow {
whereClause, AD_InfoWindow_ID, lookup);
}
/**
* {@inheritDoc}
*/
@Override
protected void initParameters() {
String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx");
if (!isLookup() && Util.isEmpty(isSOTrx)) {
isSOTrx = "Y";
}
if (!Util.isEmpty(isSOTrx)) {
for (WEditor editor : editors) {
if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsReceipt")) {
editor.setValue(isSOTrx);
break;
}
}
}
}
}