Package org.compiere.model
Class MDocType
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_C_DocType
-
- org.compiere.model.MDocType
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_DocType
,I_Persistent
,Evaluatee
,ImmutablePOSupport
public class MDocType extends X_C_DocType implements ImmutablePOSupport
Document Type Model- Version:
- $Id: MDocType.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $
- Author:
- Jorg Janke, Karsten Thiemann FR [ 1782412 ], Teo Sarca, www.arhipac.ro
- BF [ 2476824 ] MDocType.getOfDocBaseType should return ONLY active records
- BF [ - ] MDocType.getOfClient should return ONLY active records. See https://sourceforge.net/forum/message.php?msg_id=6499893
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.model.X_C_DocType
DOCBASETYPE_AD_Reference_ID, DOCBASETYPE_APCreditMemo, DOCBASETYPE_APInvoice, DOCBASETYPE_APPayment, DOCBASETYPE_ARCreditMemo, DOCBASETYPE_ARInvoice, DOCBASETYPE_ARProFormaInvoice, DOCBASETYPE_ARReceipt, DOCBASETYPE_BankStatement, DOCBASETYPE_CashJournal, DOCBASETYPE_DistributionOrder, DOCBASETYPE_FixedAssetsAddition, DOCBASETYPE_FixedAssetsDepreciation, DOCBASETYPE_FixedAssetsDisposal, DOCBASETYPE_GLDocument, DOCBASETYPE_GLJournal, DOCBASETYPE_MaintenanceOrder, DOCBASETYPE_ManufacturingCostCollector, DOCBASETYPE_ManufacturingOrder, DOCBASETYPE_MatchInvoice, DOCBASETYPE_MatchPO, DOCBASETYPE_MaterialDelivery, DOCBASETYPE_MaterialMovement, DOCBASETYPE_MaterialPhysicalInventory, DOCBASETYPE_MaterialProduction, DOCBASETYPE_MaterialReceipt, DOCBASETYPE_PaymentAllocation, DOCBASETYPE_Payroll, DOCBASETYPE_ProjectIssue, DOCBASETYPE_PurchaseOrder, DOCBASETYPE_PurchaseRequisition, DOCBASETYPE_QualityOrder, DOCBASETYPE_SalesOrder, DOCSUBTYPEINV_AD_Reference_ID, DOCSUBTYPEINV_CostAdjustment, DOCSUBTYPEINV_InternalUseInventory, DOCSUBTYPEINV_PhysicalInventory, DOCSUBTYPESO_AD_Reference_ID, DOCSUBTYPESO_OnCreditOrder, DOCSUBTYPESO_POSOrder, DOCSUBTYPESO_PrepayOrder, DOCSUBTYPESO_Proposal, DOCSUBTYPESO_Quotation, DOCSUBTYPESO_ReturnMaterial, DOCSUBTYPESO_StandardOrder, DOCSUBTYPESO_WarehouseOrder
-
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
-
Fields inherited from interface org.compiere.model.I_C_DocType
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_PrintFormat_ID, COLUMNNAME_C_DocType_ID, COLUMNNAME_C_DocType_UU, COLUMNNAME_C_DocTypeDifference_ID, COLUMNNAME_C_DocTypeInvoice_ID, COLUMNNAME_C_DocTypeProforma_ID, COLUMNNAME_C_DocTypeShipment_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_DefiniteSequence_ID, COLUMNNAME_Description, COLUMNNAME_DocBaseType, COLUMNNAME_DocNoSequence_ID, COLUMNNAME_DocSubTypeInv, COLUMNNAME_DocSubTypeSO, COLUMNNAME_DocumentCopies, COLUMNNAME_DocumentNote, COLUMNNAME_GL_Category_ID, COLUMNNAME_HasCharges, COLUMNNAME_HasProforma, COLUMNNAME_IsActive, COLUMNNAME_IsChargeOrProductMandatory, COLUMNNAME_IsCreateCounter, COLUMNNAME_IsDefault, COLUMNNAME_IsDefaultCounterDoc, COLUMNNAME_IsDocNoControlled, COLUMNNAME_IsIndexed, COLUMNNAME_IsInTransit, COLUMNNAME_IsNoPriceListCheck, COLUMNNAME_IsOverwriteDateOnComplete, COLUMNNAME_IsOverwriteSeqOnComplete, COLUMNNAME_IsPickQAConfirm, COLUMNNAME_IsPrepareSplitDocument, COLUMNNAME_IsShipConfirm, COLUMNNAME_IsSOTrx, COLUMNNAME_IsSplitWhenDifference, COLUMNNAME_Name, COLUMNNAME_PrintName, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MDocType(Properties ctx, int C_DocType_ID, String trxName)
Standard ConstructorMDocType(Properties ctx, String DocBaseType, String Name, String trxName)
New ConstructorMDocType(Properties ctx, ResultSet rs, String trxName)
Load ConstructorMDocType(Properties ctx, MDocType copy)
MDocType(Properties ctx, MDocType copy, String trxName)
MDocType(MDocType copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
afterSave(boolean newRecord, boolean success)
After Saveprotected boolean
beforeDelete()
Executed before Delete operation.protected boolean
beforeSave(boolean newRecord)
Before Savestatic MDocType
get(int C_DocType_ID)
Get Document Type (cached) (immutable)static MDocType
get(Properties ctx, int C_DocType_ID)
Get Document Type (cached) (immutable)static int
getDocType(String DocBaseType)
Return the first Doc Type for this BaseTypeString
getNameTrl()
Get translated doctype namestatic MDocType[]
getOfClient(Properties ctx)
Get Client Document Typesstatic MDocType[]
getOfDocBaseType(Properties ctx, String DocBaseType)
Get Client Document Type with DocBaseTypeString
getPrintName(String AD_Language)
Get Print Namestatic int
getShipmentReceiptDocType(int docTypeId)
Returns Document type for the shipment/receipt based on Document type provided for order/rmaboolean
isOffer()
Is this a Proposal or Quotationboolean
isProposal()
Is this a Proposal (Not binding)boolean
isQuotation()
Is this a Quotation (Binding)MDocType
markImmutable()
mark PO as immutablevoid
setGL_Category_ID()
Set Default GL Categoryvoid
setIsSOTrx()
Set SOTrx based on document base typeString
toString()
String Representation-
Methods inherited from class org.compiere.model.X_C_DocType
get_AccessLevel, getAD_PrintFormat, getAD_PrintFormat_ID, getC_DocType_ID, getC_DocType_UU, getC_DocTypeDifference, getC_DocTypeDifference_ID, getC_DocTypeInvoice, getC_DocTypeInvoice_ID, getC_DocTypeProforma, getC_DocTypeProforma_ID, getC_DocTypeShipment, getC_DocTypeShipment_ID, getDefiniteSequence, getDefiniteSequence_ID, getDescription, getDocBaseType, getDocNoSequence, getDocNoSequence_ID, getDocSubTypeInv, getDocSubTypeSO, getDocumentCopies, getDocumentNote, getGL_Category, getGL_Category_ID, getKeyNamePair, getName, getPrintName, initPO, isChargeOrProductMandatory, isCreateCounter, isDefault, isDefaultCounterDoc, isDocNoControlled, isHasCharges, isHasProforma, isIndexed, isInTransit, isNoPriceListCheck, isOverwriteDateOnComplete, isOverwriteSeqOnComplete, isPickQAConfirm, isPrepareSplitDocument, isShipConfirm, isSOTrx, isSplitWhenDifference, setAD_PrintFormat_ID, setC_DocType_ID, setC_DocType_UU, setC_DocTypeDifference_ID, setC_DocTypeInvoice_ID, setC_DocTypeProforma_ID, setC_DocTypeShipment_ID, setDefiniteSequence_ID, setDescription, setDocBaseType, setDocNoSequence_ID, setDocSubTypeInv, setDocSubTypeSO, setDocumentCopies, setDocumentNote, setGL_Category_ID, setHasCharges, setHasProforma, setIsChargeOrProductMandatory, setIsCreateCounter, setIsDefault, setIsDefaultCounterDoc, setIsDocNoControlled, setIsIndexed, setIsInTransit, setIsNoPriceListCheck, setIsOverwriteDateOnComplete, setIsOverwriteSeqOnComplete, setIsPickQAConfirm, setIsPrepareSplitDocument, setIsShipConfirm, setIsSOTrx, setIsSplitWhenDifference, setName, setPrintName
-
Methods inherited from class org.compiere.model.PO
afterDelete, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.compiere.model.I_C_DocType
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
-
Methods inherited from interface org.compiere.model.I_Persistent
save
-
-
-
-
Constructor Detail
-
MDocType
public MDocType(Properties ctx, int C_DocType_ID, String trxName)
Standard Constructor- Parameters:
ctx
- contextC_DocType_ID
- idtrxName
- transaction
-
MDocType
public MDocType(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx
- contextrs
- result settrxName
- transaction
-
MDocType
public MDocType(Properties ctx, String DocBaseType, String Name, String trxName)
New Constructor- Parameters:
ctx
- contextDocBaseType
- document base typeName
- nametrxName
- transaction
-
MDocType
public MDocType(MDocType copy)
- Parameters:
copy
-
-
MDocType
public MDocType(Properties ctx, MDocType copy)
- Parameters:
ctx
-copy
-
-
MDocType
public MDocType(Properties ctx, MDocType copy, String trxName)
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Detail
-
getDocType
public static int getDocType(String DocBaseType)
Return the first Doc Type for this BaseType- Parameters:
DocBaseType
-- Returns:
-
getOfDocBaseType
public static MDocType[] getOfDocBaseType(Properties ctx, String DocBaseType)
Get Client Document Type with DocBaseType- Parameters:
ctx
- contextDocBaseType
- base document type- Returns:
- array of doc types
-
getOfClient
public static MDocType[] getOfClient(Properties ctx)
Get Client Document Types- Parameters:
ctx
- context- Returns:
- array of doc types
-
get
public static MDocType get(int C_DocType_ID)
Get Document Type (cached) (immutable)- Parameters:
C_DocType_ID
- id- Returns:
- document type
-
get
public static MDocType get(Properties ctx, int C_DocType_ID)
Get Document Type (cached) (immutable)- Parameters:
ctx
- contextC_DocType_ID
- id- Returns:
- document type
-
setGL_Category_ID
public void setGL_Category_ID()
Set Default GL Category
-
setIsSOTrx
public void setIsSOTrx()
Set SOTrx based on document base type
-
toString
public String toString()
String Representation- Overrides:
toString
in classX_C_DocType
- Returns:
- info
-
isQuotation
public boolean isQuotation()
Is this a Quotation (Binding)- Returns:
- true if Quotation
-
isProposal
public boolean isProposal()
Is this a Proposal (Not binding)- Returns:
- true if proposal
-
isOffer
public boolean isOffer()
Is this a Proposal or Quotation- Returns:
- true if proposal or quotation
-
getPrintName
public String getPrintName(String AD_Language)
Get Print Name- Parameters:
AD_Language
- language- Returns:
- print Name if available translated
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- true
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success)
After Save
-
beforeDelete
protected boolean beforeDelete()
Executed before Delete operation.- Overrides:
beforeDelete
in classPO
- Returns:
- true if delete is a success
-
getShipmentReceiptDocType
public static int getShipmentReceiptDocType(int docTypeId)
Returns Document type for the shipment/receipt based on Document type provided for order/rma- Parameters:
docTypeId
-- Returns:
- shipment/receipt doctype id
-
getNameTrl
public String getNameTrl()
Get translated doctype name- Returns:
- Name if available translated
-
markImmutable
public MDocType markImmutable()
Description copied from interface:ImmutablePOSupport
mark PO as immutable- Specified by:
markImmutable
in interfaceImmutablePOSupport
- Returns:
- PO
-
-