Package org.compiere.model
Class MInvoiceLine
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_C_InvoiceLine
-
- org.compiere.model.MInvoiceLine
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_C_InvoiceLine,I_Persistent,Evaluatee
public class MInvoiceLine extends X_C_InvoiceLine
Invoice Line Model- Version:
- $Id: MInvoiceLine.java,v 1.5 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- BF [ 2804142 ] MInvoice.setRMALine should work only for CreditMemo invoices https://sourceforge.net/p/adempiere/bugs/1937/, red1 FR: [ 2214883 ] Remove SQL code and Replace for Query
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_C_BPartner_IDprotected intm_C_BPartner_Location_IDprotected MChargem_chargeChargeprotected Timestampm_DateInvoicedprotected booleanm_IsSOTrxprotected intm_M_PriceList_IDprotected Stringm_nameCached Name of the lineprotected MInvoicem_parentParentprotected Integerm_precisionCached Precisionprotected booleanm_priceSetprotected MProductm_productprotected IProductPricingm_productPricingProduct Pricingprotected MTaxm_taxTaxprotected static CLoggers_logStatic Logger-
Fields inherited from class org.compiere.model.X_C_InvoiceLine
A_CAPVSEXP_AD_Reference_ID, A_CAPVSEXP_Capital, A_CAPVSEXP_Expense
-
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_InvoiceLine
accessLevel, COLUMNNAME_A_Asset_Group_ID, COLUMNNAME_A_Asset_ID, COLUMNNAME_A_CapvsExp, COLUMNNAME_A_CreateAsset, COLUMNNAME_A_Processed, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_C_1099Box_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_Charge_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_InvoiceLine_ID, COLUMNNAME_C_InvoiceLine_UU, COLUMNNAME_C_OrderLine_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_C_ProjectPhase_ID, COLUMNNAME_C_ProjectTask_ID, COLUMNNAME_C_Tax_ID, COLUMNNAME_C_UOM_ID, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_Description, COLUMNNAME_IsActive, COLUMNNAME_IsDescription, COLUMNNAME_IsFixedAssetInvoice, COLUMNNAME_IsPrinted, COLUMNNAME_Line, COLUMNNAME_LineNetAmt, COLUMNNAME_LineTotalAmt, COLUMNNAME_M_AttributeSetInstance_ID, COLUMNNAME_M_InOutLine_ID, COLUMNNAME_M_Product_ID, COLUMNNAME_M_RMALine_ID, COLUMNNAME_PriceActual, COLUMNNAME_PriceEntered, COLUMNNAME_PriceLimit, COLUMNNAME_PriceList, COLUMNNAME_Processed, COLUMNNAME_QtyEntered, COLUMNNAME_QtyInvoiced, COLUMNNAME_Ref_InvoiceLine_ID, COLUMNNAME_RRAmt, COLUMNNAME_RRStartDate, COLUMNNAME_S_ResourceAssignment_ID, COLUMNNAME_TaxAmt, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MInvoiceLine(Properties ctx, int C_InvoiceLine_ID, String trxName)Invoice Line ConstructorMInvoiceLine(Properties ctx, ResultSet rs, String trxName)Load ConstructorMInvoiceLine(Properties ctx, MInvoiceLine copy)MInvoiceLine(Properties ctx, MInvoiceLine copy, String trxName)MInvoiceLine(MInvoice invoice)Parent ConstructorMInvoiceLine(MInvoiceLine copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDescription(String description)Add to Descriptionprotected booleanafterDelete(boolean success)After Deleteprotected booleanafterSave(boolean newRecord, boolean success)After Saveprotected voidallocateLandedCostRounding()Allocate Landed Cost - Enforce RoundingStringallocateLandedCosts()Allocate Landed Costsprotected booleanbeforeSave(boolean newRecord)Before SavevoidclearParent()intcopyLandedCostFrom(MInvoiceLine otherInvoiceLine)Copy LandedCost From other InvoiceLine.intgetAD_OrgTrx_ID()Get AD_OrgTrx_IDintgetC_Activity_ID()Get C_Activity_IDintgetC_Campaign_ID()Get C_Campaign_IDintgetC_Project_ID()Get C_Project_IDMChargegetCharge()Get ChargeStringgetDescriptionText()Get Description Text.MLandedCost[]getLandedCost(String whereClause)Get LandedCost of InvoiceLineBigDecimalgetMatchedQty()StringgetName()Get (Product/Charge) Namestatic MInvoiceLinegetOfInOutLine(MInOutLine sLine)Get Invoice Line referencing InOut Linestatic MInvoiceLinegetOfInOutLineFromMatchInv(MInOutLine sLine)Get Invoice Line referencing InOut Line - from MatchInvMInvoicegetParent()Get ParentintgetPrecision()Get Currency PrecisionMProductgetProduct()Get Productprotected MTaxgetTax()Get Tax (immutable)intgetUser1_ID()Get User2_IDintgetUser2_ID()Get User2_IDbooleanisTaxIncluded()Is Tax Included in AmountvoidsetInvoice(MInvoice invoice)Set Defaults from Order.voidsetLineNetAmt()Calculate Extended Amt.voidsetM_AttributeSetInstance_ID(int M_AttributeSetInstance_ID)Set M_AttributeSetInstance_IDvoidsetM_Product_ID(int M_Product_ID, boolean setUOM)Set M_Product_IDvoidsetM_Product_ID(int M_Product_ID, int C_UOM_ID)Set Product and UOMvoidsetName(String tempName)Set Temporary (cached) NamevoidsetOrderLine(MOrderLine oLine)Set values from Order Line.voidsetPrice()Set Price for Product and PriceList.voidsetPrice(int M_PriceList_ID, int C_BPartner_ID)Set Price for Product and PriceListvoidsetPrice(BigDecimal PriceActual)Set Price Entered/Actual.voidsetPriceActual(BigDecimal PriceActual)Set Price Actual.voidsetProduct(MProduct product)Set ProductvoidsetQty(int Qty)Set Qty Invoiced/Entered.voidsetQty(BigDecimal Qty)Set Qty InvoicedvoidsetQtyEntered(BigDecimal QtyEntered)Set Qty Entered - enforce entered UOMvoidsetQtyInvoiced(BigDecimal QtyInvoiced)Set Qty Invoiced - enforce Product UOMvoidsetRMALine(MRMALine rmaLine)voidsetShipLine(MInOutLine sLine)Set values from Shipment Line.booleansetTax()Set Tax - requires WarehousevoidsetTaxAmt()Calculate Tax Amt.StringtoString()String RepresentationbooleanupdateHeaderTax()Update Tax and Headerprotected booleanupdateInvoiceTax(boolean oldTax)Recalculate invoice tax-
Methods inherited from class org.compiere.model.X_C_InvoiceLine
get_AccessLevel, getA_Asset, getA_Asset_Group, getA_Asset_Group_ID, getA_Asset_ID, getA_CapvsExp, getC_1099Box, getC_1099Box_ID, getC_Activity, getC_Campaign, getC_Charge, getC_Charge_ID, getC_Invoice, getC_Invoice_ID, getC_InvoiceLine_ID, getC_InvoiceLine_UU, getC_OrderLine, getC_OrderLine_ID, getC_Project, getC_ProjectPhase, getC_ProjectPhase_ID, getC_ProjectTask, getC_ProjectTask_ID, getC_Tax, getC_Tax_ID, getC_UOM, getC_UOM_ID, getDescription, getKeyNamePair, getLine, getLineNetAmt, getLineTotalAmt, getM_AttributeSetInstance, getM_AttributeSetInstance_ID, getM_InOutLine, getM_InOutLine_ID, getM_Product, getM_Product_ID, getM_RMALine, getM_RMALine_ID, getPriceActual, getPriceEntered, getPriceLimit, getPriceList, getQtyEntered, getQtyInvoiced, getRef_InvoiceLine_ID, getRRAmt, getRRStartDate, getS_ResourceAssignment_ID, getTaxAmt, getUser1, getUser2, initPO, isA_CreateAsset, isA_Processed, isDescription, isFixedAssetInvoice, isPrinted, isProcessed, setA_Asset_Group_ID, setA_Asset_ID, setA_CapvsExp, setA_CreateAsset, setA_Processed, setAD_OrgTrx_ID, setC_1099Box_ID, setC_Activity_ID, setC_Campaign_ID, setC_Charge_ID, setC_Invoice_ID, setC_InvoiceLine_ID, setC_InvoiceLine_UU, setC_OrderLine_ID, setC_Project_ID, setC_ProjectPhase_ID, setC_ProjectTask_ID, setC_Tax_ID, setC_UOM_ID, setDescription, setIsDescription, setIsFixedAssetInvoice, setIsPrinted, setLine, setLineNetAmt, setLineTotalAmt, setM_InOutLine_ID, setM_Product_ID, setM_RMALine_ID, setPriceEntered, setPriceLimit, setPriceList, setProcessed, setRef_InvoiceLine_ID, setRRAmt, setRRStartDate, setS_ResourceAssignment_ID, setTaxAmt, setUser1_ID, setUser2_ID
-
Methods inherited from class org.compiere.model.PO
beforeDelete, 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_InvoiceLine
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
-
s_log
protected static CLogger s_log
Static Logger
-
m_tax
protected MTax m_tax
Tax
-
m_M_PriceList_ID
protected int m_M_PriceList_ID
-
m_DateInvoiced
protected Timestamp m_DateInvoiced
-
m_C_BPartner_ID
protected int m_C_BPartner_ID
-
m_C_BPartner_Location_ID
protected int m_C_BPartner_Location_ID
-
m_IsSOTrx
protected boolean m_IsSOTrx
-
m_priceSet
protected boolean m_priceSet
-
m_product
protected MProduct m_product
-
m_charge
protected MCharge m_charge
Charge
-
m_name
protected String m_name
Cached Name of the line
-
m_precision
protected Integer m_precision
Cached Precision
-
m_productPricing
protected IProductPricing m_productPricing
Product Pricing
-
m_parent
protected MInvoice m_parent
Parent
-
-
Constructor Detail
-
MInvoiceLine
public MInvoiceLine(Properties ctx, int C_InvoiceLine_ID, String trxName)
Invoice Line Constructor- Parameters:
ctx- contextC_InvoiceLine_ID- invoice line or 0trxName- transaction name
-
MInvoiceLine
public MInvoiceLine(MInvoice invoice)
Parent Constructor- Parameters:
invoice- parent
-
MInvoiceLine
public MInvoiceLine(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- result set recordtrxName- transaction
-
MInvoiceLine
public MInvoiceLine(MInvoiceLine copy)
- Parameters:
copy-
-
MInvoiceLine
public MInvoiceLine(Properties ctx, MInvoiceLine copy)
- Parameters:
ctx-copy-
-
MInvoiceLine
public MInvoiceLine(Properties ctx, MInvoiceLine copy, String trxName)
- Parameters:
ctx-copy-trxName-
-
-
Method Detail
-
getOfInOutLine
public static MInvoiceLine getOfInOutLine(MInOutLine sLine)
Get Invoice Line referencing InOut Line- Parameters:
sLine- shipment line- Returns:
- (first) invoice line
-
getOfInOutLineFromMatchInv
public static MInvoiceLine getOfInOutLineFromMatchInv(MInOutLine sLine)
Get Invoice Line referencing InOut Line - from MatchInv- Parameters:
sLine- shipment line- Returns:
- (first) invoice line
-
setInvoice
public void setInvoice(MInvoice invoice)
Set Defaults from Order. Called also from copy lines from invoice Does not set Parent !!- Parameters:
invoice- invoice
-
getParent
public MInvoice getParent()
Get Parent- Returns:
- parent
-
setOrderLine
public void setOrderLine(MOrderLine oLine)
Set values from Order Line. Does not set quantity!- Parameters:
oLine- line
-
setShipLine
public void setShipLine(MInOutLine sLine)
Set values from Shipment Line. Does not set quantity!- Parameters:
sLine- ship line
-
addDescription
public void addDescription(String description)
Add to Description- Parameters:
description- text
-
setM_AttributeSetInstance_ID
public void setM_AttributeSetInstance_ID(int M_AttributeSetInstance_ID)
Set M_AttributeSetInstance_ID- Specified by:
setM_AttributeSetInstance_IDin interfaceI_C_InvoiceLine- Overrides:
setM_AttributeSetInstance_IDin classX_C_InvoiceLine- Parameters:
M_AttributeSetInstance_ID- id
-
setPrice
public void setPrice()
Set Price for Product and PriceList. Uses standard SO price list of not set by invoice constructor
-
setPrice
public void setPrice(int M_PriceList_ID, int C_BPartner_ID)Set Price for Product and PriceList- Parameters:
M_PriceList_ID- price listC_BPartner_ID- business partner
-
setPrice
public void setPrice(BigDecimal PriceActual)
Set Price Entered/Actual. Use this Method if the Line UOM is the Product UOM- Parameters:
PriceActual- price
-
setPriceActual
public void setPriceActual(BigDecimal PriceActual)
Set Price Actual. (actual price is not updateable)- Specified by:
setPriceActualin interfaceI_C_InvoiceLine- Overrides:
setPriceActualin classX_C_InvoiceLine- Parameters:
PriceActual- actual price
-
setTax
public boolean setTax()
Set Tax - requires Warehouse- Returns:
- true if found
-
setTaxAmt
public void setTaxAmt()
Calculate Tax Amt. Assumes Line Net is calculated
-
setLineNetAmt
public void setLineNetAmt()
Calculate Extended Amt. May or may not include tax
-
getCharge
public MCharge getCharge()
Get Charge- Returns:
- product or null
-
getTax
protected MTax getTax()
Get Tax (immutable)- Returns:
- tax
-
setQty
public void setQty(int Qty)
Set Qty Invoiced/Entered.- Parameters:
Qty- Invoiced/Ordered
-
setQty
public void setQty(BigDecimal Qty)
Set Qty Invoiced- Parameters:
Qty- Invoiced/Entered
-
setQtyEntered
public void setQtyEntered(BigDecimal QtyEntered)
Set Qty Entered - enforce entered UOM- Specified by:
setQtyEnteredin interfaceI_C_InvoiceLine- Overrides:
setQtyEnteredin classX_C_InvoiceLine- Parameters:
QtyEntered-
-
setQtyInvoiced
public void setQtyInvoiced(BigDecimal QtyInvoiced)
Set Qty Invoiced - enforce Product UOM- Specified by:
setQtyInvoicedin interfaceI_C_InvoiceLine- Overrides:
setQtyInvoicedin classX_C_InvoiceLine- Parameters:
QtyInvoiced-
-
setProduct
public void setProduct(MProduct product)
Set Product- Parameters:
product- product
-
setM_Product_ID
public void setM_Product_ID(int M_Product_ID, boolean setUOM)Set M_Product_ID- Parameters:
M_Product_ID- productsetUOM- set UOM from product
-
setM_Product_ID
public void setM_Product_ID(int M_Product_ID, int C_UOM_ID)Set Product and UOM- Parameters:
M_Product_ID- productC_UOM_ID- uom
-
getProduct
public MProduct getProduct()
Get Product- Returns:
- product or null
-
getC_Project_ID
public int getC_Project_ID()
Get C_Project_ID- Specified by:
getC_Project_IDin interfaceI_C_InvoiceLine- Overrides:
getC_Project_IDin classX_C_InvoiceLine- Returns:
- project
-
getC_Activity_ID
public int getC_Activity_ID()
Get C_Activity_ID- Specified by:
getC_Activity_IDin interfaceI_C_InvoiceLine- Overrides:
getC_Activity_IDin classX_C_InvoiceLine- Returns:
- Activity
-
getC_Campaign_ID
public int getC_Campaign_ID()
Get C_Campaign_ID- Specified by:
getC_Campaign_IDin interfaceI_C_InvoiceLine- Overrides:
getC_Campaign_IDin classX_C_InvoiceLine- Returns:
- Campaign
-
getUser1_ID
public int getUser1_ID()
Get User2_ID- Specified by:
getUser1_IDin interfaceI_C_InvoiceLine- Overrides:
getUser1_IDin classX_C_InvoiceLine- Returns:
- User2
-
getUser2_ID
public int getUser2_ID()
Get User2_ID- Specified by:
getUser2_IDin interfaceI_C_InvoiceLine- Overrides:
getUser2_IDin classX_C_InvoiceLine- Returns:
- User2
-
getAD_OrgTrx_ID
public int getAD_OrgTrx_ID()
Get AD_OrgTrx_ID- Specified by:
getAD_OrgTrx_IDin interfaceI_C_InvoiceLine- Overrides:
getAD_OrgTrx_IDin classX_C_InvoiceLine- Returns:
- trx org
-
toString
public String toString()
String Representation- Overrides:
toStringin classX_C_InvoiceLine- Returns:
- info
-
getName
public String getName()
Get (Product/Charge) Name- Returns:
- name
-
setName
public void setName(String tempName)
Set Temporary (cached) Name- Parameters:
tempName- Cached Name
-
getDescriptionText
public String getDescriptionText()
Get Description Text. For jsp access (vs. isDescription)- Returns:
- description
-
getPrecision
public int getPrecision()
Get Currency Precision- Returns:
- precision
-
isTaxIncluded
public boolean isTaxIncluded()
Is Tax Included in Amount- Returns:
- true if tax is included
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Before Save- Overrides:
beforeSavein classPO- Parameters:
newRecord-- Returns:
- true if save
-
updateInvoiceTax
protected boolean updateInvoiceTax(boolean oldTax)
Recalculate invoice tax- Parameters:
oldTax- true if the old C_Tax_ID should be used- Returns:
- true if success, false otherwise author teo_sarca [ 1583825 ]
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success)After Save
-
afterDelete
protected boolean afterDelete(boolean success)
After Delete- Overrides:
afterDeletein classPO- Parameters:
success- success- Returns:
- deleted
-
updateHeaderTax
public boolean updateHeaderTax()
Update Tax and Header- Returns:
- true if header updated with tax
-
allocateLandedCosts
public String allocateLandedCosts()
Allocate Landed Costs- Returns:
- error message or ""
-
allocateLandedCostRounding
protected void allocateLandedCostRounding()
Allocate Landed Cost - Enforce Rounding
-
getLandedCost
public MLandedCost[] getLandedCost(String whereClause)
Get LandedCost of InvoiceLine- Parameters:
whereClause- starting with AND- Returns:
- landedCost
-
copyLandedCostFrom
public int copyLandedCostFrom(MInvoiceLine otherInvoiceLine)
Copy LandedCost From other InvoiceLine.- Parameters:
otherInvoiceLine- invoiceline- Returns:
- number of lines copied
-
setRMALine
public void setRMALine(MRMALine rmaLine)
- Parameters:
rmaLine-
-
getMatchedQty
public BigDecimal getMatchedQty()
- Returns:
- matched qty
-
clearParent
public void clearParent()
-
-