From 326d210665cba7a938c69aea1f17dee566969a00 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Thu, 7 Jan 2021 18:48:25 +0100 Subject: [PATCH] IDEMPIERE-4616 : Lead : add IsVendorLead (#500) * IDEMPIERE-4616 : Lead : add IsVendorLead * IDEMPIERE-4616 : Lead : add IsVendorLead Fix description for Lead window Add Display Logic for Opportunity parameters (now hidden if no opportunity) Set BPartner.IsCustomer/IsVendor according to Lead.IsSales/VendorLead * IDEMPIERE-4616 : Lead : add IsVendorLead Move scripts from 8.2 to 8.2z --- .../oracle/202012311000_IDEMPIERE-4616.sql | 130 ++++++++++++++++++ .../202012311000_IDEMPIERE-4616.sql | 127 +++++++++++++++++ .../src/org/compiere/process/ConvertLead.java | 5 +- .../src/org/compiere/model/I_AD_User.java | 13 ++ .../src/org/compiere/model/X_AD_User.java | 28 +++- 5 files changed, 301 insertions(+), 2 deletions(-) create mode 100644 migration/i8.2z/oracle/202012311000_IDEMPIERE-4616.sql create mode 100644 migration/i8.2z/postgresql/202012311000_IDEMPIERE-4616.sql diff --git a/migration/i8.2z/oracle/202012311000_IDEMPIERE-4616.sql b/migration/i8.2z/oracle/202012311000_IDEMPIERE-4616.sql new file mode 100644 index 0000000000..15d29bebe0 --- /dev/null +++ b/migration/i8.2z/oracle/202012311000_IDEMPIERE-4616.sql @@ -0,0 +1,130 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4616 : Lead : add IsVendorLead +-- 2020-12-31 09:47:20 +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203450,0,0,'Y',TO_DATE('2020-12-31 09:47:20','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-12-31 09:47:20','YYYY-MM-DD HH24:MI:SS'),0,'IsVendorLead','Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.','Vendor Lead','D','78171db5-d69e-4afa-a384-8d36641ab6b1') +; + +-- 2020-12-31 09:47:52 +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214342,0,'Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.',114,'IsVendorLead','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_DATE('2020-12-31 09:47:52','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-12-31 09:47:52','YYYY-MM-DD HH24:MI:SS'),0,203450,'Y','N','D','Y','N','N','Y','f446cbfd-ada5-4d5c-a984-3ff62a4161ad','Y','N','N','N','N') +; + +-- 2020-12-31 09:47:54 +ALTER TABLE AD_User ADD IsVendorLead CHAR(1) DEFAULT 'N' CHECK (IsVendorLead IN ('Y','N')) NOT NULL +; + +-- 2020-12-31 09:48:14 +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (206543,'Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.',53429,214342,'Y',0,250,0,'N','N','N','N',0,0,'Y',TO_DATE('2020-12-31 09:48:14','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2020-12-31 09:48:14','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','cc661c8b-945d-4b76-a62a-a3258aa51f5d','Y',240,1,1,1,'N','N','N') +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=5, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62151 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=6, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206543 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62133 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62134 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62132 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62135 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62143 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62140 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62725 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62724 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62139 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62144 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62155 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62147 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62148 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62149 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62150 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62130 +; + +-- 2020-12-31 09:49:07 +UPDATE AD_Tab SET WhereClause='(AD_User.IsSalesLead=''Y'' OR AD_User.IsVendorLead=''Y'')',Updated=TO_DATE('2020-12-31 09:49:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=53429 +; + +-- 2021-01-04 10:34:12 +UPDATE AD_Window SET Help='The Lead Window allows you to maintain Leads (can be Sales or Purchase). These are unqualified contacts to who you wish to recruit or market to. ',Updated=TO_DATE('2021-01-04 10:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53153 +; + +-- 2021-01-04 10:34:37 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53583 +; + +-- 2021-01-04 10:34:40 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53584 +; + +-- 2021-01-04 10:34:46 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53585 +; + +-- 2021-01-04 10:34:48 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53586 +; + +-- 2021-01-04 10:34:51 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53587 +; + +-- 2021-01-04 10:34:53 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_DATE('2021-01-04 10:34:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53588 +; + +-- 2021-01-04 10:35:09 +UPDATE AD_Process_Para SET DefaultValue='@IsSalesLead@',Updated=TO_DATE('2021-01-04 10:35:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53582 +; + +SELECT register_migration_script('202012311000_IDEMPIERE-4616.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i8.2z/postgresql/202012311000_IDEMPIERE-4616.sql b/migration/i8.2z/postgresql/202012311000_IDEMPIERE-4616.sql new file mode 100644 index 0000000000..aa5ae37d1b --- /dev/null +++ b/migration/i8.2z/postgresql/202012311000_IDEMPIERE-4616.sql @@ -0,0 +1,127 @@ +-- IDEMPIERE-4616 : Lead : add IsVendorLead +-- 2020-12-31 09:47:20 +INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203450,0,0,'Y',TO_TIMESTAMP('2020-12-31 09:47:20','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-12-31 09:47:20','YYYY-MM-DD HH24:MI:SS'),0,'IsVendorLead','Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.','Vendor Lead','D','78171db5-d69e-4afa-a384-8d36641ab6b1') +; + +-- 2020-12-31 09:47:52 +INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,Help,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,IsToolbarButton,IsSecure,FKConstraintType,IsHtml) VALUES (214342,0,'Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.',114,'IsVendorLead','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2020-12-31 09:47:52','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-12-31 09:47:52','YYYY-MM-DD HH24:MI:SS'),0,203450,'Y','N','D','Y','N','N','Y','f446cbfd-ada5-4d5c-a984-3ff62a4161ad','Y','N','N','N','N') +; + +-- 2020-12-31 09:47:54 +ALTER TABLE AD_User ADD COLUMN IsVendorLead CHAR(1) DEFAULT 'N' CHECK (IsVendorLead IN ('Y','N')) NOT NULL +; + +-- 2020-12-31 09:48:14 +INSERT INTO AD_Field (AD_Field_ID,Name,Description,Help,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,SortNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines,IsQuickEntry,IsDefaultFocus,IsAdvancedField) VALUES (206543,'Vendor Lead','This contact is a vendor lead','Vendor leads can be converted into full contacts with Business Partners.',53429,214342,'Y',0,250,0,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2020-12-31 09:48:14','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2020-12-31 09:48:14','YYYY-MM-DD HH24:MI:SS'),0,'N','Y','D','cc661c8b-945d-4b76-a62a-a3258aa51f5d','Y',240,1,1,1,'N','N','N') +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=90, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=5, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62151 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=100, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, XPosition=6, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=206543 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=110, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62133 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=120, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62134 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=130, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62132 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=140, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62135 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=150, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62143 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=160, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62140 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=170, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62725 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=180, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62724 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=190, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62139 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=200, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62144 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=210, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62155 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=220, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62147 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=230, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62148 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=240, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62149 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=250, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62150 +; + +-- 2020-12-31 09:48:39 +UPDATE AD_Field SET SeqNo=260, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-12-31 09:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=62130 +; + +-- 2020-12-31 09:49:07 +UPDATE AD_Tab SET WhereClause='(AD_User.IsSalesLead=''Y'' OR AD_User.IsVendorLead=''Y'')',Updated=TO_TIMESTAMP('2020-12-31 09:49:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Tab_ID=53429 +; + +-- 2021-01-04 10:34:12 +UPDATE AD_Window SET Help='The Lead Window allows you to maintain Leads (can be Sales or Purchase). These are unqualified contacts to who you wish to recruit or market to. ',Updated=TO_TIMESTAMP('2021-01-04 10:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Window_ID=53153 +; + +-- 2021-01-04 10:34:37 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53583 +; + +-- 2021-01-04 10:34:40 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53584 +; + +-- 2021-01-04 10:34:46 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53585 +; + +-- 2021-01-04 10:34:48 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53586 +; + +-- 2021-01-04 10:34:51 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53587 +; + +-- 2021-01-04 10:34:53 +UPDATE AD_Process_Para SET DisplayLogic='@CreateOpportunity@ = Y',Updated=TO_TIMESTAMP('2021-01-04 10:34:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53588 +; + +-- 2021-01-04 10:35:09 +UPDATE AD_Process_Para SET DefaultValue='@IsSalesLead@',Updated=TO_TIMESTAMP('2021-01-04 10:35:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Process_Para_ID=53582 +; + +SELECT register_migration_script('202012311000_IDEMPIERE-4616.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java b/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java index 3b486f202c..8a4dee96c3 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java +++ b/org.adempiere.base.process/src/org/compiere/process/ConvertLead.java @@ -60,7 +60,7 @@ public class ConvertLead extends SvrProcess { throw new FillMandatoryException("AD_User_ID"); MUser lead = new MUser(getCtx(), p_AD_User_ID, get_TrxName()); - if (!lead.isSalesLead() && lead.getC_BPartner_ID() != 0) + if (!lead.isSalesLead() && !lead.isVendorLead() && lead.getC_BPartner_ID() != 0) throw new AdempiereUserError("Lead already converted"); MBPartner bp = MBPartner.getTemplate(getCtx(), Env.getAD_Client_ID(getCtx())); @@ -71,6 +71,8 @@ public class ConvertLead extends SvrProcess { bp.setName(lead.getName()); bp.setIsActive(true); + bp.setIsCustomer(lead.isSalesLead()); + bp.setIsVendor(lead.isVendorLead()); bp.saveEx(); addBufferLog(bp.getC_BPartner_ID(), null, null, "@C_BPartner_ID@ @Created@", MBPartner.Table_ID, bp.getC_BPartner_ID()); @@ -159,6 +161,7 @@ public class ConvertLead extends SvrProcess { } lead.setIsSalesLead(false); + lead.setIsVendorLead(false); lead.setLeadStatus(MUser.LEADSTATUS_Converted); lead.saveEx(); diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_User.java b/org.adempiere.base/src/org/compiere/model/I_AD_User.java index 106f90660b..bdd772cb82 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_User.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_User.java @@ -551,6 +551,19 @@ public interface I_AD_User /** Get Support User */ public boolean isSupportUser(); + /** Column name IsVendorLead */ + public static final String COLUMNNAME_IsVendorLead = "IsVendorLead"; + + /** Set Vendor Lead. + * This contact is a vendor lead + */ + public void setIsVendorLead (boolean IsVendorLead); + + /** Get Vendor Lead. + * This contact is a vendor lead + */ + public boolean isVendorLead(); + /** Column name LastContact */ public static final String COLUMNNAME_LastContact = "LastContact"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_User.java b/org.adempiere.base/src/org/compiere/model/X_AD_User.java index 19489fbb41..21648dc3fe 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_User.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_User.java @@ -31,7 +31,7 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent /** * */ - private static final long serialVersionUID = 20201220L; + private static final long serialVersionUID = 20201231L; /** Standard Constructor */ public X_AD_User (Properties ctx, int AD_User_ID, String trxName) @@ -63,6 +63,8 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent setIsShipTo (false); // N setIsSupportUser (false); +// N + setIsVendorLead (false); // N setName (null); setNotificationType (null); @@ -890,6 +892,30 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent return false; } + /** Set Vendor Lead. + @param IsVendorLead + This contact is a vendor lead + */ + public void setIsVendorLead (boolean IsVendorLead) + { + set_Value (COLUMNNAME_IsVendorLead, Boolean.valueOf(IsVendorLead)); + } + + /** Get Vendor Lead. + @return This contact is a vendor lead + */ + public boolean isVendorLead () + { + Object oo = get_Value(COLUMNNAME_IsVendorLead); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Last Contact. @param LastContact Date this individual was last contacted