Package org.compiere.model
Class MAsset
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_A_Asset
-
- org.compiere.model.MAsset
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_A_Asset
,I_Persistent
,Evaluatee
public class MAsset extends X_A_Asset
Asset Model- Author:
- Teo Sarca, SC ARHIPAC SERVICE SRL
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
CHANGETYPE_setAssetGroup
ChangeType - Asset Group changed-
Fields inherited from class org.compiere.model.X_A_Asset
A_ASSET_ACTION_AD_Reference_ID, A_ASSET_ACTION_Dispose, A_ASSET_ACTION_Inbound, A_ASSET_ACTION_Modify, A_ASSET_ACTION_Outbound, A_ASSET_ACTION_Reevaluate, A_ASSET_ACTION_Retire, A_ASSET_ACTION_Transfer, A_ASSET_STATUS_Activated, A_ASSET_STATUS_AD_Reference_ID, A_ASSET_STATUS_Depreciated, A_ASSET_STATUS_Disposed, A_ASSET_STATUS_New, A_ASSET_STATUS_Preservation, A_ASSET_STATUS_Retired, A_ASSET_STATUS_Sold
-
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_A_Asset
accessLevel, COLUMNNAME_A_Asset_Action, COLUMNNAME_A_Asset_Class_ID, COLUMNNAME_A_Asset_CreateDate, COLUMNNAME_A_Asset_Group_ID, COLUMNNAME_A_Asset_ID, COLUMNNAME_A_Asset_RevalDate, COLUMNNAME_A_Asset_Status, COLUMNNAME_A_Asset_Type_ID, COLUMNNAME_A_Asset_UU, COLUMNNAME_A_AssetType, COLUMNNAME_A_Parent_Asset_ID, COLUMNNAME_A_QTY_Current, COLUMNNAME_A_QTY_Original, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_AssetActivationDate, COLUMNNAME_AssetDepreciationDate, COLUMNNAME_AssetDisposalDate, COLUMNNAME_AssetServiceDate, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_BPartner_Location_ID, COLUMNNAME_C_BPartnerSR_ID, COLUMNNAME_C_Location_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_GuaranteeDate, COLUMNNAME_Help, COLUMNNAME_InventoryNo, COLUMNNAME_IsActive, COLUMNNAME_IsDepreciated, COLUMNNAME_IsDisposed, COLUMNNAME_IsFullyDepreciated, COLUMNNAME_IsInPosession, COLUMNNAME_IsOwned, COLUMNNAME_LastMaintenanceDate, COLUMNNAME_LastMaintenanceNote, COLUMNNAME_LastMaintenanceUnit, COLUMNNAME_Lease_BPartner_ID, COLUMNNAME_LeaseTerminationDate, COLUMNNAME_LifeUseUnits, COLUMNNAME_LocationComment, COLUMNNAME_Lot, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_InOutLine_ID, COLUMNNAME_M_Locator_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_ManufacturedYear, COLUMNNAME_Manufacturer, COLUMNNAME_Name, COLUMNNAME_NextMaintenenceDate, COLUMNNAME_NextMaintenenceUnit, COLUMNNAME_Processed, COLUMNNAME_Processing, COLUMNNAME_Qty, COLUMNNAME_SerNo, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_UseLifeMonths, COLUMNNAME_UseLifeYears, COLUMNNAME_UseUnits, COLUMNNAME_Value, COLUMNNAME_VersionNo, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Modifier Constructor Description MAsset(Properties ctx, int A_Asset_ID, String trxName)
Create constructorMAsset(Properties ctx, ResultSet rs, String trxName)
Load ConstructorMAsset(Properties ctx, MAsset copy)
MAsset(Properties ctx, MAsset copy, String trxName)
MAsset(MAsset copy)
protected
MAsset(MIFixedAsset ifa)
Construct from MIFixedAsset (import)MAsset(MInOut mInOut, MInOutLine sLine, int deliveryCount)
MAsset(MInventory inventory, MInventoryLine invLine, BigDecimal qty, BigDecimal costs)
Create Asset from Inventoryprotected
MAsset(MMatchInv match)
Construct from MMatchInvprotected
MAsset(MProject project)
author Edwin Ang
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
afterSave(boolean newRecord, boolean success)
Called after Save for Post-Save Operationprotected boolean
beforeDelete()
Executed before Delete operation.protected boolean
beforeSave(boolean newRecord)
Before Savevoid
changeStatus(String newStatus, Timestamp date)
Change asset status to newStatusMAssetDelivery
confirmDelivery(javax.servlet.http.HttpServletRequest request, int ad_User_ID)
MAssetDelivery
confirmDelivery(EMail email, int ad_User_ID)
static Collection<MAsset>
forASI(Properties ctx, int M_Product_ID, int M_ASI_ID)
Get Assets from given M_Product_ID and M_ASI_ID.static MAsset
get(Properties ctx, int A_Asset_ID, String trxName)
Get AssetBigDecimal
getA_Accumulated_Depr()
BigDecimal
getA_Accumulated_Depr_F()
BigDecimal
getA_Asset_Cost()
int
getA_Current_Period()
int
getA_Depreciation_F_ID()
int
getA_Depreciation_ID()
MAssetGroup
getAssetGroup()
Timestamp
getDateAcct()
MAssetDelivery[]
getDeliveries()
static MAsset
getFromShipment(Properties ctx, int i, String trxName)
MIFixedAsset
getI_FixedAsset()
MProductDownload[]
getProductDownloads()
int
getProductR_MailText_ID()
int
getUseLifeMonths_F()
boolean
isDownloadable()
void
setA_Accumulated_Depr(BigDecimal A_Accumulated_Depr)
void
setA_Accumulated_Depr_F(BigDecimal A_Accumulated_Depr_F)
void
setA_Asset_Cost(BigDecimal A_Asset_Cost)
void
setA_Current_Period(int A_Current_Period)
void
setA_Depreciation_F_ID(int A_Depreciation_F_ID)
void
setA_Depreciation_ID(int A_Depreciation_ID)
void
setASI(MAttributeSetInstance asi)
Set ASI Info (M_AttributeSetInstance_ID, Lot, SerNo)void
setAssetGroup(MAssetGroup assetGroup)
Set Asset Group; also it sets other default fieldsvoid
setDateAcct(Timestamp DateAcct)
void
setI_FixedAsset(MIFixedAsset I_FixedAsset)
void
setUseLifeMonths_F(int UseLifeMonths_F)
void
updateStatus()
-
Methods inherited from class org.compiere.model.X_A_Asset
get_AccessLevel, getA_Asset_Action, getA_Asset_Class, getA_Asset_Class_ID, getA_Asset_CreateDate, getA_Asset_Group, getA_Asset_Group_ID, getA_Asset_ID, getA_Asset_RevalDate, getA_Asset_Status, getA_Asset_Type, getA_Asset_Type_ID, getA_Asset_UU, getA_AssetType, getA_Parent_Asset, getA_Parent_Asset_ID, getA_QTY_Current, getA_QTY_Original, getAD_User, getAD_User_ID, getAssetActivationDate, getAssetDepreciationDate, getAssetDisposalDate, getAssetServiceDate, getC_Activity, getC_Activity_ID, getC_BPartner, getC_BPartner_ID, getC_BPartner_Location, getC_BPartner_Location_ID, getC_BPartnerSR, getC_BPartnerSR_ID, getC_Location, getC_Location_ID, getC_Project, getC_Project_ID, getDescription, getGuaranteeDate, getHelp, getInventoryNo, getLastMaintenanceDate, getLastMaintenanceNote, getLastMaintenanceUnit, getLease_BPartner, getLease_BPartner_ID, getLeaseTerminationDate, getLifeUseUnits, getLocationComment, getLot, getM_AttributeSetInstance, getM_AttributeSetInstance_ID, getM_InOutLine, getM_InOutLine_ID, getM_Locator, getM_Locator_ID, getM_Product, getM_Product_ID, getManufacturedYear, getManufacturer, getName, getNextMaintenenceDate, getNextMaintenenceUnit, getQty, getSerNo, getUseLifeMonths, getUseLifeYears, getUseUnits, getValue, getVersionNo, initPO, isDepreciated, isDisposed, isFullyDepreciated, isInPosession, isOwned, isProcessed, isProcessing, setA_Asset_Action, setA_Asset_Class_ID, setA_Asset_CreateDate, setA_Asset_Group_ID, setA_Asset_ID, setA_Asset_RevalDate, setA_Asset_Status, setA_Asset_Type_ID, setA_Asset_UU, setA_AssetType, setA_Parent_Asset_ID, setA_QTY_Current, setA_QTY_Original, setAD_User_ID, setAssetActivationDate, setAssetDepreciationDate, setAssetDisposalDate, setAssetServiceDate, setC_Activity_ID, setC_BPartner_ID, setC_BPartner_Location_ID, setC_BPartnerSR_ID, setC_Location_ID, setC_Project_ID, setDescription, setGuaranteeDate, setHelp, setInventoryNo, setIsDepreciated, setIsDisposed, setIsFullyDepreciated, setIsInPosession, setIsOwned, setLastMaintenanceDate, setLastMaintenanceNote, setLastMaintenanceUnit, setLease_BPartner_ID, setLeaseTerminationDate, setLifeUseUnits, setLocationComment, setLot, setM_AttributeSetInstance_ID, setM_InOutLine_ID, setM_Locator_ID, setM_Product_ID, setManufacturedYear, setManufacturer, setName, setNextMaintenenceDate, setNextMaintenenceUnit, setProcessed, setProcessing, setQty, setSerNo, setUseLifeMonths, setUseLifeYears, setUseUnits, setValue, setVersionNo, toString
-
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_A_Asset
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
-
-
-
-
Field Detail
-
CHANGETYPE_setAssetGroup
public static final int CHANGETYPE_setAssetGroup
ChangeType - Asset Group changed- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MAsset
public MAsset(Properties ctx, int A_Asset_ID, String trxName)
Create constructor
-
MAsset
public MAsset(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx
- contextrs
- result set record
-
MAsset
protected MAsset(MMatchInv match)
Construct from MMatchInv- Parameters:
match
- match invoice
-
MAsset
protected MAsset(MIFixedAsset ifa)
Construct from MIFixedAsset (import)- Parameters:
ifa
-
-
MAsset
protected MAsset(MProject project)
author Edwin Ang- Parameters:
project
-
-
MAsset
public MAsset(MInOut mInOut, MInOutLine sLine, int deliveryCount)
-
MAsset
public MAsset(MInventory inventory, MInventoryLine invLine, BigDecimal qty, BigDecimal costs)
Create Asset from Inventory- Parameters:
inventory
- inventoryinvLine
- inventory lineqty
-costs
-
-
MAsset
public MAsset(MAsset copy)
- Parameters:
copy
-
-
MAsset
public MAsset(Properties ctx, MAsset copy)
- Parameters:
ctx
-copy
-
-
MAsset
public MAsset(Properties ctx, MAsset copy, String trxName)
- Parameters:
ctx
-copy
-trxName
-
-
-
Method Detail
-
get
public static MAsset get(Properties ctx, int A_Asset_ID, String trxName)
Get Asset- Parameters:
ctx
- contextA_Asset_ID
- assettrxName
-
-
forASI
public static Collection<MAsset> forASI(Properties ctx, int M_Product_ID, int M_ASI_ID)
Get Assets from given M_Product_ID and M_ASI_ID.Note: The A_Asset_Product table is not checked !!!
- Parameters:
ctx
-M_Product_ID
- (optional)M_ASI_ID
-- Returns:
- array of MAsset
-
setAssetGroup
public void setAssetGroup(MAssetGroup assetGroup)
Set Asset Group; also it sets other default fields- Parameters:
assetGroup
-
-
getAssetGroup
public MAssetGroup getAssetGroup()
-
setASI
public void setASI(MAttributeSetInstance asi)
Set ASI Info (M_AttributeSetInstance_ID, Lot, SerNo)- Parameters:
asi
-
-
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)
Description copied from class:PO
Called after Save for Post-Save Operation
-
beforeDelete
protected boolean beforeDelete()
Description copied from class:PO
Executed before Delete operation.- Overrides:
beforeDelete
in classPO
- Returns:
- true if record can be deleted
-
updateStatus
public void updateStatus()
- See Also:
beforeSave(boolean)
-
changeStatus
public void changeStatus(String newStatus, Timestamp date)
Change asset status to newStatus- Parameters:
newStatus
- see A_ASSET_STATUS_date
- state change date; if null context "#Date" will be used
-
getUseLifeMonths_F
public int getUseLifeMonths_F()
-
setUseLifeMonths_F
public void setUseLifeMonths_F(int UseLifeMonths_F)
-
getA_Current_Period
public int getA_Current_Period()
-
setA_Current_Period
public void setA_Current_Period(int A_Current_Period)
-
getDateAcct
public Timestamp getDateAcct()
-
setDateAcct
public void setDateAcct(Timestamp DateAcct)
-
getA_Depreciation_ID
public int getA_Depreciation_ID()
-
setA_Depreciation_ID
public void setA_Depreciation_ID(int A_Depreciation_ID)
-
getA_Depreciation_F_ID
public int getA_Depreciation_F_ID()
-
setA_Depreciation_F_ID
public void setA_Depreciation_F_ID(int A_Depreciation_F_ID)
-
getA_Asset_Cost
public BigDecimal getA_Asset_Cost()
-
setA_Asset_Cost
public void setA_Asset_Cost(BigDecimal A_Asset_Cost)
-
getA_Accumulated_Depr
public BigDecimal getA_Accumulated_Depr()
-
setA_Accumulated_Depr
public void setA_Accumulated_Depr(BigDecimal A_Accumulated_Depr)
-
getA_Accumulated_Depr_F
public BigDecimal getA_Accumulated_Depr_F()
-
setA_Accumulated_Depr_F
public void setA_Accumulated_Depr_F(BigDecimal A_Accumulated_Depr_F)
-
getI_FixedAsset
public MIFixedAsset getI_FixedAsset()
-
setI_FixedAsset
public void setI_FixedAsset(MIFixedAsset I_FixedAsset)
-
confirmDelivery
public MAssetDelivery confirmDelivery(EMail email, int ad_User_ID)
-
getProductDownloads
public MProductDownload[] getProductDownloads()
-
confirmDelivery
public MAssetDelivery confirmDelivery(javax.servlet.http.HttpServletRequest request, int ad_User_ID)
-
getDeliveries
public MAssetDelivery[] getDeliveries()
-
getFromShipment
public static MAsset getFromShipment(Properties ctx, int i, String trxName)
-
getProductR_MailText_ID
public int getProductR_MailText_ID()
-
isDownloadable
public boolean isDownloadable()
-
-