Compiere 3.1

org.compiere.model
Class MInvoiceLine

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_C_InvoiceLine
          extended by org.compiere.model.MInvoiceLine
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, 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
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_C_InvoiceLine
accessLevel, AD_ORGTRX_ID_AD_Reference_ID, LINEDOCSTATUS_AD_Reference_ID, LINEDOCSTATUS_Approved, LINEDOCSTATUS_Closed, LINEDOCSTATUS_Completed, LINEDOCSTATUS_Drafted, LINEDOCSTATUS_InProgress, LINEDOCSTATUS_Invalid, LINEDOCSTATUS_NotApproved, LINEDOCSTATUS_Reversed, LINEDOCSTATUS_Unknown, LINEDOCSTATUS_Voided, LINEDOCSTATUS_WaitingConfirmation, LINEDOCSTATUS_WaitingPayment, Model, Table_ID, Table_Name, updatedMS, USER1_ID_AD_Reference_ID, USER2_ID_AD_Reference_ID
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MInvoiceLine(Ctx ctx, int C_InvoiceLine_ID, String trxName)
          Invoice Line Constructor
MInvoiceLine(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
MInvoiceLine(MInvoice invoice)
          Parent Constructor
 
Method Summary
 void addDescription(String description)
          Add to Description
protected  boolean afterDelete(boolean success)
          After Delete
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
 String allocateLandedCosts()
          Allocate Landed Costs
protected  boolean beforeSave(boolean newRecord)
          Before Save
 void checkPrice()
           
 void createLeadRequest(MInvoice invoice)
          Create Lead/Request
 int getAD_OrgTrx_ID()
          Get AD_OrgTrx_ID
 int getC_Activity_ID()
          Get C_Activity_ID
 int getC_Campaign_ID()
          Get C_Campaign_ID
 int getC_Project_ID()
          Get C_Project_ID
 String getDescriptionText()
          Get Description Text.
 String getName()
          Get (Product/Charge) Name
static MInvoiceLine getOfInOutLine(MInOutLine sLine)
          Get Invoice Line referencing InOut Line
 MInvoice getParent()
          Get Parent
 int getPrecision()
          Get Currency Precision
 MProduct getProduct()
          Get Product
 int getUser1_ID()
          Get User2_ID
 int getUser2_ID()
          Get User2_ID
 boolean isTaxIncluded()
          Is Tax Included in Amount
 void setC_Charge_ID(String oldC_Charge_ID, String newC_Charge_ID, int WindowNo)
          Set Charge - Callout
 void setC_Tax_ID(String oldC_Tax_ID, String newC_Tax_ID, int windowNo)
          Set C_Tax_ID - Callout
 void setC_UOM_ID(String oldC_UOM_ID, String newC_UOM_ID, int windowNo)
          Set UOM - Callout
 void setInvoice(MInvoice invoice)
          Set Defaults from Order.
 void setLineNetAmt()
          Calculate Extended Amt.
 void setM_AttributeSetInstance_ID(int M_AttributeSetInstance_ID)
          Set M_AttributeSetInstance_ID
 void setM_Product_ID(int M_Product_ID, boolean setUOM)
          Set M_Product_ID
 void setM_Product_ID(int M_Product_ID, int C_UOM_ID)
          Set Product and UOM
 void setM_Product_ID(String oldM_Product_ID, String newM_Product_ID, int WindowNo)
          Invoice Line - Product
 void setName(String tempName)
          Set Temporary (cached) Name
 void setOrderLine(MOrderLine oLine)
          Set values from Order Line.
 void setPrice()
          Set Price for Product and PriceList.
 void setPrice(BigDecimal PriceActual)
          Set Price Entered/Actual.
 void setPrice(int M_PriceList_ID, int C_BPartner_ID)
          Set Price for Product and PriceList
 void setPriceActual(BigDecimal PriceActual)
          Set Price Actual.
 void setPriceActual(String oldPriceActual, String newPriceActual, int windowNo)
          Set PriceActual - Callout
 void setPriceEntered(String oldPriceEntered, String newPriceEntered, int windowNo)
          Set PriceEntered - Callout
 void setProduct(MProduct product)
          Set Product
 void setQty(BigDecimal Qty)
          Set Qty Invoiced
 void setQty(int Qty)
          Set Qty Invoiced/Entered.
 void setQtyEntered(BigDecimal QtyEntered)
          Set Qty Entered - enforce entered UOM
 void setQtyEntered(String oldQtyEntered, String newQtyEntered, int windowNo)
          Set QtyEntered - Callout
 void setQtyInvoiced(BigDecimal QtyInvoiced)
          Set Qty Invoiced - enforce Product UOM
 void setQtyInvoiced(String oldQtyInvoiced, String newQtyInvoiced, int windowNo)
          Set QtyOrdered - Callout
 void setS_ResourceAssignment_ID(String oldS_ResourceAssignment_ID, String newS_ResourceAssignment_ID, int windowNo)
          Set Resource Assignment - Callout
 void setShipLine(MInOutLine sLine)
          Set values from Shipment Line.
 boolean setTax()
          Set Tax - requires Warehouse
 void setTaxAmt()
          Calculare Tax Amt.
 void setTaxAmt(String oldTaxAmt, String newTaxAmt, int windowNo)
          Set TaxAmt - Callout
 String toString()
          String Representation
 
Methods inherited from class org.compiere.model.X_C_InvoiceLine
get_AccessLevel, getA_Asset_ID, getC_Charge_ID, getC_Invoice_ID, getC_InvoiceLine_ID, getC_OrderLine_ID, getC_ProjectPhase_ID, getC_ProjectTask_ID, getC_Tax_ID, getC_UOM_ID, getDescription, getKeyNamePair, getLine, getLineDocStatus, getLineNetAmt, getLineTotalAmt, getM_AttributeSetInstance_ID, getM_InOutLine_ID, getM_Product_ID, getPriceActual, getPriceEntered, getPriceLimit, getPriceList, getQtyEntered, getQtyInvoiced, getRef_InvoiceLine_ID, getRRAmt, getRRStartDate, getS_ResourceAssignment_ID, getTaxAmt, initPO, isDescription, isLineDocStatusValid, isPrinted, isProcessed, setA_Asset_ID, setAD_OrgTrx_ID, setC_Activity_ID, setC_Campaign_ID, setC_Charge_ID, setC_Invoice_ID, setC_InvoiceLine_ID, setC_OrderLine_ID, setC_Project_ID, setC_ProjectPhase_ID, setC_ProjectTask_ID, setC_Tax_ID, setC_UOM_ID, setDescription, setIsDescription, setIsPrinted, setLine, setLineDocStatus, setLineNetAmt, setLineTotalAmt, setM_InOutLine_ID, setM_Product_ID, setPriceEntered, setPriceLimit, setPriceList, setProcessed, setRef_InvoiceLine_ID, setRRAmt, setRRStartDate, setS_ResourceAssignment_ID, setTaxAmt, setUser1_ID, setUser2_ID
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, beforeDelete, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveNew_getID, saveNewInsertSQL, saveNewSpecial, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MInvoiceLine

public MInvoiceLine(Ctx ctx,
                    int C_InvoiceLine_ID,
                    String trxName)
Invoice Line Constructor

Parameters:
ctx - context
C_InvoiceLine_ID - invoice line or 0
trxName - transaction name

MInvoiceLine

public MInvoiceLine(MInvoice invoice)
Parent Constructor

Parameters:
invoice - parent

MInvoiceLine

public MInvoiceLine(Ctx ctx,
                    ResultSet rs,
                    String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set record
trxName - transaction
Method Detail

getOfInOutLine

public static MInvoiceLine getOfInOutLine(MInOutLine sLine)
Get Invoice Line referencing InOut Line

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

Overrides:
setM_AttributeSetInstance_ID in class X_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 list
C_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)

Overrides:
setPriceActual in class X_C_InvoiceLine
Parameters:
PriceActual - actual price

checkPrice

public void checkPrice()

setTax

public boolean setTax()
Set Tax - requires Warehouse

Returns:
true if found

setTaxAmt

public void setTaxAmt()
Calculare Tax Amt. Assumes Line Net is calculated


setLineNetAmt

public void setLineNetAmt()
Calculate Extended Amt. May or may not include 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

Overrides:
setQtyEntered in class X_C_InvoiceLine
Parameters:
QtyEntered -

setQtyInvoiced

public void setQtyInvoiced(BigDecimal QtyInvoiced)
Set Qty Invoiced - enforce Product UOM

Overrides:
setQtyInvoiced in class X_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 - product
setUOM - 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 - product
C_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

Overrides:
getC_Project_ID in class X_C_InvoiceLine
Returns:
project

getC_Activity_ID

public int getC_Activity_ID()
Get C_Activity_ID

Overrides:
getC_Activity_ID in class X_C_InvoiceLine
Returns:
Activity

getC_Campaign_ID

public int getC_Campaign_ID()
Get C_Campaign_ID

Overrides:
getC_Campaign_ID in class X_C_InvoiceLine
Returns:
Campaign

getUser1_ID

public int getUser1_ID()
Get User2_ID

Overrides:
getUser1_ID in class X_C_InvoiceLine
Returns:
User2

getUser2_ID

public int getUser2_ID()
Get User2_ID

Overrides:
getUser2_ID in class X_C_InvoiceLine
Returns:
User2

getAD_OrgTrx_ID

public int getAD_OrgTrx_ID()
Get AD_OrgTrx_ID

Overrides:
getAD_OrgTrx_ID in class X_C_InvoiceLine
Returns:
trx org

toString

public String toString()
String Representation

Overrides:
toString in class X_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

createLeadRequest

public void createLeadRequest(MInvoice invoice)
Create Lead/Request


setS_ResourceAssignment_ID

@UICallout
public void setS_ResourceAssignment_ID(String oldS_ResourceAssignment_ID,
                                                 String newS_ResourceAssignment_ID,
                                                 int windowNo)
                                throws Exception
Set Resource Assignment - Callout

Parameters:
oldS_ResourceAssignment_ID - old value
newS_ResourceAssignment_ID - new value
windowNo - window
Throws:
Exception

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord -
Returns:
true if save

afterSave

protected boolean afterSave(boolean newRecord,
                            boolean success)
After Save

Overrides:
afterSave in class PO
Parameters:
newRecord - new
success - success
Returns:
saved

afterDelete

protected boolean afterDelete(boolean success)
After Delete

Overrides:
afterDelete in class PO
Parameters:
success - success
Returns:
deleted

allocateLandedCosts

public String allocateLandedCosts()
Allocate Landed Costs

Returns:
error message or ""

setC_UOM_ID

@UICallout
public void setC_UOM_ID(String oldC_UOM_ID,
                                  String newC_UOM_ID,
                                  int windowNo)
                 throws Exception
Set UOM - Callout

Parameters:
oldC_UOM_ID - old value
newC_UOM_ID - new value
windowNo - window
Throws:
Exception

setQtyEntered

@UICallout
public void setQtyEntered(String oldQtyEntered,
                                    String newQtyEntered,
                                    int windowNo)
                   throws Exception
Set QtyEntered - Callout

Parameters:
oldQtyEntered - old value
newQtyEntered - new value
windowNo - window
Throws:
Exception

setQtyInvoiced

@UICallout
public void setQtyInvoiced(String oldQtyInvoiced,
                                     String newQtyInvoiced,
                                     int windowNo)
                    throws Exception
Set QtyOrdered - Callout

Parameters:
oldQtyInvoiced - old value
newQtyInvoiced - new value
windowNo - window
Throws:
Exception

setC_Tax_ID

@UICallout
public void setC_Tax_ID(String oldC_Tax_ID,
                                  String newC_Tax_ID,
                                  int windowNo)
                 throws Exception
Set C_Tax_ID - Callout

Parameters:
oldC_Tax_ID - old value
newC_Tax_ID - new value
windowNo - window
Throws:
Exception

setPriceActual

@UICallout
public void setPriceActual(String oldPriceActual,
                                     String newPriceActual,
                                     int windowNo)
                    throws Exception
Set PriceActual - Callout

Parameters:
oldPriceActual - old value
newPriceActual - new value
windowNo - window
Throws:
Exception

setPriceEntered

@UICallout
public void setPriceEntered(String oldPriceEntered,
                                      String newPriceEntered,
                                      int windowNo)
                     throws Exception
Set PriceEntered - Callout

Parameters:
oldPriceEntered - old value
newPriceEntered - new value
windowNo - window
Throws:
Exception

setTaxAmt

@UICallout
public void setTaxAmt(String oldTaxAmt,
                                String newTaxAmt,
                                int windowNo)
               throws Exception
Set TaxAmt - Callout

Parameters:
oldTaxAmt - old value
newTaxAmt - new value
windowNo - window
Throws:
Exception

setM_Product_ID

@UICallout
public void setM_Product_ID(String oldM_Product_ID,
                                      String newM_Product_ID,
                                      int WindowNo)
                     throws Exception
Invoice Line - Product. - reset C_Charge_ID / M_AttributeSetInstance_ID - PriceList, PriceStd, PriceLimit, C_Currency_ID, EnforcePriceLimit - UOM Calls Tax

Parameters:
oldM_Product_ID - old value
newM_Product_ID - new value
windowNo - window
Throws:
Exception

setC_Charge_ID

@UICallout
public void setC_Charge_ID(String oldC_Charge_ID,
                                     String newC_Charge_ID,
                                     int WindowNo)
                    throws Exception
Set Charge - Callout

Parameters:
oldC_Charge_ID - old value
newC_Charge_ID - new value
windowNo - window
Throws:
Exception

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.