From 68b122062359c60139f1394b895008bfa794ed72 Mon Sep 17 00:00:00 2001 From: yamelsenih Date: Tue, 12 Dec 2023 20:02:50 -0400 Subject: [PATCH] Add support to product --- .../core/domains/models/I_I_Product.java | 16 +- .../core/domains/models/I_M_Product.java | 178 ++++++------- .../core/domains/models/X_I_Product.java | 56 ++-- .../core/domains/models/X_M_Product.java | 248 +++++++++--------- ...g_Definition_Import_Column_for_Product.xml | 90 +++++++ 5 files changed, 339 insertions(+), 249 deletions(-) diff --git a/base/src/org/adempiere/core/domains/models/I_I_Product.java b/base/src/org/adempiere/core/domains/models/I_I_Product.java index c463e5269c..fd59e60458 100644 --- a/base/src/org/adempiere/core/domains/models/I_I_Product.java +++ b/base/src/org/adempiere/core/domains/models/I_I_Product.java @@ -679,12 +679,12 @@ public interface I_I_Product /** Set Shelf Depth. * Shelf depth required */ - public void setShelfDepth (int ShelfDepth); + public void setShelfDepth (BigDecimal ShelfDepth); /** Get Shelf Depth. * Shelf depth required */ - public int getShelfDepth(); + public BigDecimal getShelfDepth(); /** Column name ShelfHeight */ public static final String COLUMNNAME_ShelfHeight = "ShelfHeight"; @@ -692,12 +692,12 @@ public interface I_I_Product /** Set Shelf Height. * Shelf height required */ - public void setShelfHeight (int ShelfHeight); + public void setShelfHeight (BigDecimal ShelfHeight); /** Get Shelf Height. * Shelf height required */ - public int getShelfHeight(); + public BigDecimal getShelfHeight(); /** Column name ShelfWidth */ public static final String COLUMNNAME_ShelfWidth = "ShelfWidth"; @@ -705,12 +705,12 @@ public interface I_I_Product /** Set Shelf Width. * Shelf width required */ - public void setShelfWidth (int ShelfWidth); + public void setShelfWidth (BigDecimal ShelfWidth); /** Get Shelf Width. * Shelf width required */ - public int getShelfWidth(); + public BigDecimal getShelfWidth(); /** Column name SKU */ public static final String COLUMNNAME_SKU = "SKU"; @@ -838,12 +838,12 @@ public interface I_I_Product /** Set Weight. * Weight of a product */ - public void setWeight (int Weight); + public void setWeight (BigDecimal Weight); /** Get Weight. * Weight of a product */ - public int getWeight(); + public BigDecimal getWeight(); /** Column name X12DE355 */ public static final String COLUMNNAME_X12DE355 = "X12DE355"; diff --git a/base/src/org/adempiere/core/domains/models/I_M_Product.java b/base/src/org/adempiere/core/domains/models/I_M_Product.java index 51b7aef7c7..f0947cdf00 100644 --- a/base/src/org/adempiere/core/domains/models/I_M_Product.java +++ b/base/src/org/adempiere/core/domains/models/I_M_Product.java @@ -64,6 +64,61 @@ public interface I_M_Product */ public int getAD_Org_ID(); + /** Column name Classification */ + public static final String COLUMNNAME_Classification = "Classification"; + + /** Set Classification. + * Classification for grouping + */ + public void setClassification (String Classification); + + /** Get Classification. + * Classification for grouping + */ + public String getClassification(); + + /** Column name CopyFrom */ + public static final String COLUMNNAME_CopyFrom = "CopyFrom"; + + /** Set Copy From. + * Copy From Record + */ + public void setCopyFrom (String CopyFrom); + + /** Get Copy From. + * Copy From Record + */ + public String getCopyFrom(); + + /** Column name CostStandard */ + public static final String COLUMNNAME_CostStandard = "CostStandard"; + + /** Set Standard Cost. + * Standard Costs + */ + public void setCostStandard (BigDecimal CostStandard); + + /** Get Standard Cost. + * Standard Costs + */ + public BigDecimal getCostStandard(); + + /** Column name Created */ + public static final String COLUMNNAME_Created = "Created"; + + /** Get Created. + * Date this record was created + */ + public Timestamp getCreated(); + + /** Column name CreatedBy */ + public static final String COLUMNNAME_CreatedBy = "CreatedBy"; + + /** Get Created By. + * User who created this records + */ + public int getCreatedBy(); + /** Column name C_RevenueRecognition_ID */ public static final String COLUMNNAME_C_RevenueRecognition_ID = "C_RevenueRecognition_ID"; @@ -139,61 +194,6 @@ public interface I_M_Product public org.adempiere.core.domains.models.I_C_UOM getC_UOM() throws RuntimeException; - /** Column name Classification */ - public static final String COLUMNNAME_Classification = "Classification"; - - /** Set Classification. - * Classification for grouping - */ - public void setClassification (String Classification); - - /** Get Classification. - * Classification for grouping - */ - public String getClassification(); - - /** Column name CopyFrom */ - public static final String COLUMNNAME_CopyFrom = "CopyFrom"; - - /** Set Copy From. - * Copy From Record - */ - public void setCopyFrom (String CopyFrom); - - /** Get Copy From. - * Copy From Record - */ - public String getCopyFrom(); - - /** Column name CostStandard */ - public static final String COLUMNNAME_CostStandard = "CostStandard"; - - /** Set Standard Cost. - * Standard Costs - */ - public void setCostStandard (BigDecimal CostStandard); - - /** Get Standard Cost. - * Standard Costs - */ - public BigDecimal getCostStandard(); - - /** Column name Created */ - public static final String COLUMNNAME_Created = "Created"; - - /** Get Created. - * Date this record was created - */ - public Timestamp getCreated(); - - /** Column name CreatedBy */ - public static final String COLUMNNAME_CreatedBy = "CreatedBy"; - - /** Get Created By. - * User who created this records - */ - public int getCreatedBy(); - /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; @@ -794,36 +794,6 @@ public interface I_M_Product public org.adempiere.core.domains.models.I_R_MailText getR_MailText() throws RuntimeException; - /** Column name S_ExpenseType_ID */ - public static final String COLUMNNAME_S_ExpenseType_ID = "S_ExpenseType_ID"; - - /** Set Expense Type. - * Expense report type - */ - public void setS_ExpenseType_ID (int S_ExpenseType_ID); - - /** Get Expense Type. - * Expense report type - */ - public int getS_ExpenseType_ID(); - - public org.adempiere.core.domains.models.I_S_ExpenseType getS_ExpenseType() throws RuntimeException; - - /** Column name S_Resource_ID */ - public static final String COLUMNNAME_S_Resource_ID = "S_Resource_ID"; - - /** Set Resource. - * Resource - */ - public void setS_Resource_ID (int S_Resource_ID); - - /** Get Resource. - * Resource - */ - public int getS_Resource_ID(); - - public org.adempiere.core.domains.models.I_S_Resource getS_Resource() throws RuntimeException; - /** Column name SalesRep_ID */ public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; @@ -839,18 +809,33 @@ public interface I_M_Product public org.adempiere.core.domains.models.I_AD_User getSalesRep() throws RuntimeException; + /** Column name S_ExpenseType_ID */ + public static final String COLUMNNAME_S_ExpenseType_ID = "S_ExpenseType_ID"; + + /** Set Expense Type. + * Expense report type + */ + public void setS_ExpenseType_ID (int S_ExpenseType_ID); + + /** Get Expense Type. + * Expense report type + */ + public int getS_ExpenseType_ID(); + + public org.adempiere.core.domains.models.I_S_ExpenseType getS_ExpenseType() throws RuntimeException; + /** Column name ShelfDepth */ public static final String COLUMNNAME_ShelfDepth = "ShelfDepth"; /** Set Shelf Depth. * Shelf depth required */ - public void setShelfDepth (int ShelfDepth); + public void setShelfDepth (BigDecimal ShelfDepth); /** Get Shelf Depth. * Shelf depth required */ - public int getShelfDepth(); + public BigDecimal getShelfDepth(); /** Column name ShelfHeight */ public static final String COLUMNNAME_ShelfHeight = "ShelfHeight"; @@ -871,12 +856,12 @@ public interface I_M_Product /** Set Shelf Width. * Shelf width required */ - public void setShelfWidth (int ShelfWidth); + public void setShelfWidth (BigDecimal ShelfWidth); /** Get Shelf Width. * Shelf width required */ - public int getShelfWidth(); + public BigDecimal getShelfWidth(); /** Column name SKU */ public static final String COLUMNNAME_SKU = "SKU"; @@ -891,6 +876,21 @@ public interface I_M_Product */ public String getSKU(); + /** Column name S_Resource_ID */ + public static final String COLUMNNAME_S_Resource_ID = "S_Resource_ID"; + + /** Set Resource. + * Resource + */ + public void setS_Resource_ID (int S_Resource_ID); + + /** Get Resource. + * Resource + */ + public int getS_Resource_ID(); + + public org.adempiere.core.domains.models.I_S_Resource getS_Resource() throws RuntimeException; + /** Column name UnitsPerPack */ public static final String COLUMNNAME_UnitsPerPack = "UnitsPerPack"; diff --git a/base/src/org/adempiere/core/domains/models/X_I_Product.java b/base/src/org/adempiere/core/domains/models/X_I_Product.java index d89f03d92e..7987565f3b 100644 --- a/base/src/org/adempiere/core/domains/models/X_I_Product.java +++ b/base/src/org/adempiere/core/domains/models/X_I_Product.java @@ -987,60 +987,60 @@ public BigDecimal getRoyaltyAmt () @param ShelfDepth Shelf depth required */ - public void setShelfDepth (int ShelfDepth) + public void setShelfDepth (BigDecimal ShelfDepth) { - set_Value (COLUMNNAME_ShelfDepth, Integer.valueOf(ShelfDepth)); + set_Value (COLUMNNAME_ShelfDepth, ShelfDepth); } /** Get Shelf Depth. @return Shelf depth required */ - public int getShelfDepth () + public BigDecimal getShelfDepth () { - Integer ii = (Integer)get_Value(COLUMNNAME_ShelfDepth); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ShelfDepth); + if (bd == null) + return Env.ZERO; + return bd; } /** Set Shelf Height. @param ShelfHeight Shelf height required */ - public void setShelfHeight (int ShelfHeight) + public void setShelfHeight (BigDecimal ShelfHeight) { - set_Value (COLUMNNAME_ShelfHeight, Integer.valueOf(ShelfHeight)); + set_Value (COLUMNNAME_ShelfHeight, ShelfHeight); } /** Get Shelf Height. @return Shelf height required */ - public int getShelfHeight () + public BigDecimal getShelfHeight () { - Integer ii = (Integer)get_Value(COLUMNNAME_ShelfHeight); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ShelfHeight); + if (bd == null) + return Env.ZERO; + return bd; } /** Set Shelf Width. @param ShelfWidth Shelf width required */ - public void setShelfWidth (int ShelfWidth) + public void setShelfWidth (BigDecimal ShelfWidth) { - set_Value (COLUMNNAME_ShelfWidth, Integer.valueOf(ShelfWidth)); + set_Value (COLUMNNAME_ShelfWidth, ShelfWidth); } /** Get Shelf Width. @return Shelf width required */ - public int getShelfWidth () + public BigDecimal getShelfWidth () { - Integer ii = (Integer)get_Value(COLUMNNAME_ShelfWidth); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ShelfWidth); + if (bd == null) + return Env.ZERO; + return bd; } /** Set SKU. @@ -1197,20 +1197,20 @@ public BigDecimal getVolume () @param Weight Weight of a product */ - public void setWeight (int Weight) + public void setWeight (BigDecimal Weight) { - set_Value (COLUMNNAME_Weight, Integer.valueOf(Weight)); + set_Value (COLUMNNAME_Weight, Weight); } /** Get Weight. @return Weight of a product */ - public int getWeight () + public BigDecimal getWeight () { - Integer ii = (Integer)get_Value(COLUMNNAME_Weight); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Weight); + if (bd == null) + return Env.ZERO; + return bd; } /** Set UOM Code. diff --git a/base/src/org/adempiere/core/domains/models/X_M_Product.java b/base/src/org/adempiere/core/domains/models/X_M_Product.java index 25365f746f..674c2cb2e5 100644 --- a/base/src/org/adempiere/core/domains/models/X_M_Product.java +++ b/base/src/org/adempiere/core/domains/models/X_M_Product.java @@ -38,7 +38,7 @@ public class X_M_Product extends PO implements I_M_Product, I_Persistent /** * */ - private static final long serialVersionUID = 20230102L; + private static final long serialVersionUID = 20231212L; /** Standard Constructor */ public X_M_Product (Properties ctx, int M_Product_ID, String trxName) @@ -112,6 +112,59 @@ public String toString() return sb.toString(); } + /** Set Classification. + @param Classification + Classification for grouping + */ + public void setClassification (String Classification) + { + set_Value (COLUMNNAME_Classification, Classification); + } + + /** Get Classification. + @return Classification for grouping + */ + public String getClassification () + { + return (String)get_Value(COLUMNNAME_Classification); + } + + /** Set Copy From. + @param CopyFrom + Copy From Record + */ + public void setCopyFrom (String CopyFrom) + { + set_Value (COLUMNNAME_CopyFrom, CopyFrom); + } + + /** Get Copy From. + @return Copy From Record + */ + public String getCopyFrom () + { + return (String)get_Value(COLUMNNAME_CopyFrom); + } + + /** Set Standard Cost. + @param CostStandard + Standard Costs + */ + public void setCostStandard (BigDecimal CostStandard) + { + throw new IllegalArgumentException ("CostStandard is virtual column"); } + + /** Get Standard Cost. + @return Standard Costs + */ + public BigDecimal getCostStandard () + { + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_CostStandard); + if (bd == null) + return Env.ZERO; + return bd; + } + public org.adempiere.core.domains.models.I_C_RevenueRecognition getC_RevenueRecognition() throws RuntimeException { return (org.adempiere.core.domains.models.I_C_RevenueRecognition)MTable.get(getCtx(), org.adempiere.core.domains.models.I_C_RevenueRecognition.Table_Name) @@ -252,59 +305,6 @@ public int getC_UOM_ID () return ii.intValue(); } - /** Set Classification. - @param Classification - Classification for grouping - */ - public void setClassification (String Classification) - { - set_Value (COLUMNNAME_Classification, Classification); - } - - /** Get Classification. - @return Classification for grouping - */ - public String getClassification () - { - return (String)get_Value(COLUMNNAME_Classification); - } - - /** Set Copy From. - @param CopyFrom - Copy From Record - */ - public void setCopyFrom (String CopyFrom) - { - set_Value (COLUMNNAME_CopyFrom, CopyFrom); - } - - /** Get Copy From. - @return Copy From Record - */ - public String getCopyFrom () - { - return (String)get_Value(COLUMNNAME_CopyFrom); - } - - /** Set Standard Cost. - @param CostStandard - Standard Costs - */ - public void setCostStandard (BigDecimal CostStandard) - { - throw new IllegalArgumentException ("CostStandard is virtual column"); } - - /** Get Standard Cost. - @return Standard Costs - */ - public BigDecimal getCostStandard () - { - BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_CostStandard); - if (bd == null) - return Env.ZERO; - return bd; - } - /** Set Description. @param Description Optional short description of the record @@ -1330,62 +1330,6 @@ public int getR_MailText_ID () return ii.intValue(); } - public org.adempiere.core.domains.models.I_S_ExpenseType getS_ExpenseType() throws RuntimeException - { - return (org.adempiere.core.domains.models.I_S_ExpenseType)MTable.get(getCtx(), org.adempiere.core.domains.models.I_S_ExpenseType.Table_Name) - .getPO(getS_ExpenseType_ID(), get_TrxName()); } - - /** Set Expense Type. - @param S_ExpenseType_ID - Expense report type - */ - public void setS_ExpenseType_ID (int S_ExpenseType_ID) - { - if (S_ExpenseType_ID < 1) - set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, null); - else - set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, Integer.valueOf(S_ExpenseType_ID)); - } - - /** Get Expense Type. - @return Expense report type - */ - public int getS_ExpenseType_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_S_ExpenseType_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - - public org.adempiere.core.domains.models.I_S_Resource getS_Resource() throws RuntimeException - { - return (org.adempiere.core.domains.models.I_S_Resource)MTable.get(getCtx(), org.adempiere.core.domains.models.I_S_Resource.Table_Name) - .getPO(getS_Resource_ID(), get_TrxName()); } - - /** Set Resource. - @param S_Resource_ID - Resource - */ - public void setS_Resource_ID (int S_Resource_ID) - { - if (S_Resource_ID < 1) - set_ValueNoCheck (COLUMNNAME_S_Resource_ID, null); - else - set_ValueNoCheck (COLUMNNAME_S_Resource_ID, Integer.valueOf(S_Resource_ID)); - } - - /** Get Resource. - @return Resource - */ - public int getS_Resource_ID () - { - Integer ii = (Integer)get_Value(COLUMNNAME_S_Resource_ID); - if (ii == null) - return 0; - return ii.intValue(); - } - public org.adempiere.core.domains.models.I_AD_User getSalesRep() throws RuntimeException { return (org.adempiere.core.domains.models.I_AD_User)MTable.get(getCtx(), org.adempiere.core.domains.models.I_AD_User.Table_Name) @@ -1414,24 +1358,52 @@ public int getSalesRep_ID () return ii.intValue(); } + public org.adempiere.core.domains.models.I_S_ExpenseType getS_ExpenseType() throws RuntimeException + { + return (org.adempiere.core.domains.models.I_S_ExpenseType)MTable.get(getCtx(), org.adempiere.core.domains.models.I_S_ExpenseType.Table_Name) + .getPO(getS_ExpenseType_ID(), get_TrxName()); } + + /** Set Expense Type. + @param S_ExpenseType_ID + Expense report type + */ + public void setS_ExpenseType_ID (int S_ExpenseType_ID) + { + if (S_ExpenseType_ID < 1) + set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, null); + else + set_ValueNoCheck (COLUMNNAME_S_ExpenseType_ID, Integer.valueOf(S_ExpenseType_ID)); + } + + /** Get Expense Type. + @return Expense report type + */ + public int getS_ExpenseType_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_S_ExpenseType_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set Shelf Depth. @param ShelfDepth Shelf depth required */ - public void setShelfDepth (int ShelfDepth) + public void setShelfDepth (BigDecimal ShelfDepth) { - set_Value (COLUMNNAME_ShelfDepth, Integer.valueOf(ShelfDepth)); + set_Value (COLUMNNAME_ShelfDepth, ShelfDepth); } /** Get Shelf Depth. @return Shelf depth required */ - public int getShelfDepth () + public BigDecimal getShelfDepth () { - Integer ii = (Integer)get_Value(COLUMNNAME_ShelfDepth); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ShelfDepth); + if (bd == null) + return Env.ZERO; + return bd; } /** Set Shelf Height. @@ -1458,20 +1430,20 @@ public BigDecimal getShelfHeight () @param ShelfWidth Shelf width required */ - public void setShelfWidth (int ShelfWidth) + public void setShelfWidth (BigDecimal ShelfWidth) { - set_Value (COLUMNNAME_ShelfWidth, Integer.valueOf(ShelfWidth)); + set_Value (COLUMNNAME_ShelfWidth, ShelfWidth); } /** Get Shelf Width. @return Shelf width required */ - public int getShelfWidth () + public BigDecimal getShelfWidth () { - Integer ii = (Integer)get_Value(COLUMNNAME_ShelfWidth); - if (ii == null) - return 0; - return ii.intValue(); + BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ShelfWidth); + if (bd == null) + return Env.ZERO; + return bd; } /** Set SKU. @@ -1491,6 +1463,34 @@ public String getSKU () return (String)get_Value(COLUMNNAME_SKU); } + public org.adempiere.core.domains.models.I_S_Resource getS_Resource() throws RuntimeException + { + return (org.adempiere.core.domains.models.I_S_Resource)MTable.get(getCtx(), org.adempiere.core.domains.models.I_S_Resource.Table_Name) + .getPO(getS_Resource_ID(), get_TrxName()); } + + /** Set Resource. + @param S_Resource_ID + Resource + */ + public void setS_Resource_ID (int S_Resource_ID) + { + if (S_Resource_ID < 1) + set_ValueNoCheck (COLUMNNAME_S_Resource_ID, null); + else + set_ValueNoCheck (COLUMNNAME_S_Resource_ID, Integer.valueOf(S_Resource_ID)); + } + + /** Get Resource. + @return Resource + */ + public int getS_Resource_ID () + { + Integer ii = (Integer)get_Value(COLUMNNAME_S_Resource_ID); + if (ii == null) + return 0; + return ii.intValue(); + } + /** Set UnitsPerPack. @param UnitsPerPack The Units Per Pack indicates the no of units of a product packed together. diff --git a/migration/394lts-3.9.4.002/10350_Fixed_error_with_Wrong_Definition_Import_Column_for_Product.xml b/migration/394lts-3.9.4.002/10350_Fixed_error_with_Wrong_Definition_Import_Column_for_Product.xml index 105fc15acd..4c084d6e48 100644 --- a/migration/394lts-3.9.4.002/10350_Fixed_error_with_Wrong_Definition_Import_Column_for_Product.xml +++ b/migration/394lts-3.9.4.002/10350_Fixed_error_with_Wrong_Definition_Import_Column_for_Product.xml @@ -8,5 +8,95 @@ 12 + + + 22 + + + + + ShelfDepth + true + 29 + + + + + 29 + + + + + ShelfWidth + true + 29 + + + + + ShelfDepth + true + 29 + + + + + ShelfHeight + true + 29 + + + + + ShelfWidth + true + 29 + + + + + Volume + true + 29 + + + + + Weight + true + 29 + + + + + Volume + true + 29 + + + + + Weight + true + 29 + + + + + ShelfHeight + true + 29 + + + + + 29 + + + + + 29 + +