IDEMPIERE-5018 Vendor changed to customer when edited using Quick Entry (#950)
IDEMPIERE-3705
This commit is contained in:
parent
22c09368e6
commit
9abc2c09e2
|
@ -0,0 +1,15 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- IDEMPIERE-5018 Vendor changed to customer when edited using Quick Entry
|
||||
-- Oct 27, 2021, 12:54:13 PM CEST
|
||||
UPDATE AD_Field SET DisplayLogic='@_ParentIsSOTrx_@=N & @C_BPartner_ID@>0 | @_QUICK_ENTRY_MODE_@!Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@_ParentIsSOTrx_@=N & @IsVendor@=Y', IsToolbarButton=NULL,Updated=TO_DATE('2021-10-27 12:54:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9623
|
||||
;
|
||||
|
||||
-- Oct 27, 2021, 12:54:47 PM CEST
|
||||
UPDATE AD_Field SET DisplayLogic='@_ParentIsSOTrx_@=Y & @C_BPartner_ID@>0 | @_QUICK_ENTRY_MODE_@!Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@_ParentIsSOTrx_@=Y & @IsCustomer@=Y', IsToolbarButton=NULL,Updated=TO_DATE('2021-10-27 12:54:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9614
|
||||
;
|
||||
|
||||
SELECT register_migration_script('202110271258_IDEMPIERE-5018.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
-- IDEMPIERE-5018 Vendor changed to customer when edited using Quick Entry
|
||||
-- Oct 27, 2021, 12:54:13 PM CEST
|
||||
UPDATE AD_Field SET DisplayLogic='@_ParentIsSOTrx_@=N & @C_BPartner_ID@>0 | @_QUICK_ENTRY_MODE_@!Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@_ParentIsSOTrx_@=N & @IsVendor@=Y', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-10-27 12:54:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9623
|
||||
;
|
||||
|
||||
-- Oct 27, 2021, 12:54:47 PM CEST
|
||||
UPDATE AD_Field SET DisplayLogic='@_ParentIsSOTrx_@=Y & @C_BPartner_ID@>0 | @_QUICK_ENTRY_MODE_@!Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, ReadOnlyLogic='@_ParentIsSOTrx_@=Y & @IsCustomer@=Y', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-10-27 12:54:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9614
|
||||
;
|
||||
|
||||
SELECT register_migration_script('202110271258_IDEMPIERE-5018.sql') FROM dual
|
||||
;
|
||||
|
|
@ -23,7 +23,7 @@ import org.compiere.model.MBPartner;
|
|||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Util;
|
||||
|
||||
@Callout(tableName = MBPartner.Table_Name, columnName = "*")
|
||||
@Callout(tableName = MBPartner.Table_Name, columnName = MBPartner.COLUMNNAME_C_BPartner_ID)
|
||||
public class CalloutBPartnerQuickEntry implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
|
@ -36,8 +36,13 @@ public class CalloutBPartnerQuickEntry implements IColumnCallout {
|
|||
|
||||
if (!Util.isEmpty(docSOTrx)) {
|
||||
boolean isSOTrx = "Y".equals(docSOTrx);
|
||||
mTab.setValue(MBPartner.COLUMNNAME_IsCustomer, isSOTrx);
|
||||
mTab.setValue(MBPartner.COLUMNNAME_IsVendor, !isSOTrx);
|
||||
// set _ParentIsSOTrx_ used in DisplayLogic and ReadOnlyLogic of C_BPartner.IsCustomer and IsVendor
|
||||
Env.setContext(ctx, WindowNo, "_ParentIsSOTrx_", isSOTrx);
|
||||
Env.setContext(ctx, WindowNo, mTab.getTabNo(), "_ParentIsSOTrx_", isSOTrx);
|
||||
if (value == null || ((Integer) value) == 0) { // new record
|
||||
mTab.setValue(MBPartner.COLUMNNAME_IsCustomer, isSOTrx);
|
||||
mTab.setValue(MBPartner.COLUMNNAME_IsVendor, !isSOTrx);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue