Compiere 3.1

org.compiere.model
Class MCostDetail

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_M_CostDetail
          extended by org.compiere.model.MCostDetail
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MCostDetail
extends X_M_CostDetail

Cost Detail Model

Version:
$Id: MCostDetail.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_M_CostDetail
accessLevel, Model, Table_ID, Table_Name, updatedMS
 
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
MCostDetail(Ctx ctx, int M_CostDetail_ID, String trxName)
          Standard Constructor
MCostDetail(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
MCostDetail(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, String trxName)
          New Constructor
 
Method Summary
protected  boolean afterSave(boolean newRecord, boolean success)
          After Save
protected  boolean beforeDelete()
          Before Delete
static boolean createInventory(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_InventoryLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, String trxName)
          Create New Order Cost Detail for Physical Inventory.
static boolean createInvoice(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int C_InvoiceLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, String trxName)
          Create New Invoice Cost Detail for AP Invoices.
static boolean createMovement(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_MovementLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, boolean from, String Description, String trxName)
          Create New Order Cost Detail for Movements.
static boolean createOrder(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int C_OrderLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, String trxName)
          Create New Order Cost Detail for Purchase Orders.
static boolean createProduction(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_ProductionLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, String trxName)
          Create New Order Cost Detail for Production.
static boolean createShipment(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_InOutLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, boolean IsSOTrx, String trxName)
          Create New Shipment Cost Detail for SO Shipments.
static boolean createWorkOrderTransaction(MAcctSchema as, int AD_Org_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int M_WorkOrderTransactionLine_ID, int M_CostElement_ID, BigDecimal Amt, BigDecimal Qty, String Description, boolean IsSOTrx, String trxName)
          Create New Work Order Transaction Cost detail Called from Doc_WorkOrderTransaction - for Work Order Transactions
 boolean isDelta()
          Is this a Delta Record (previously processed)?
 boolean isInvoice()
          Is Invoice
 boolean isOrder()
          Is Order
 boolean isShipment()
          Is Shipment
 boolean process()
          Process Cost Detail Record.
static boolean processProduct(MProduct product, String trxName)
          Process Cost Details for product
 void setAmt(BigDecimal Amt)
          Set Amt
 void setQty(BigDecimal Qty)
          Set Qty
 String toString()
          String Representation
 
Methods inherited from class org.compiere.model.X_M_CostDetail
get_AccessLevel, getAmt, getC_AcctSchema_ID, getC_InvoiceLine_ID, getC_OrderLine_ID, getC_ProjectIssue_ID, getDeltaAmt, getDeltaQty, getDescription, getM_AttributeSetInstance_ID, getM_CostDetail_ID, getM_CostElement_ID, getM_InOutLine_ID, getM_InventoryLine_ID, getM_MovementLine_ID, getM_Product_ID, getM_ProductionLine_ID, getM_WorkOrderTransactionLine_ID, getPrice, getQty, initPO, isProcessed, isSOTrx, setC_AcctSchema_ID, setC_InvoiceLine_ID, setC_OrderLine_ID, setC_ProjectIssue_ID, setDeltaAmt, setDeltaQty, setDescription, setIsSOTrx, setM_AttributeSetInstance_ID, setM_CostDetail_ID, setM_CostElement_ID, setM_InOutLine_ID, setM_InventoryLine_ID, setM_MovementLine_ID, setM_Product_ID, setM_ProductionLine_ID, setM_WorkOrderTransactionLine_ID, setPrice, setProcessed
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, beforeSave, 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

MCostDetail

public MCostDetail(Ctx ctx,
                   int M_CostDetail_ID,
                   String trxName)
Standard Constructor

Parameters:
ctx - context
M_CostDetail_ID - id
trxName - trx

MCostDetail

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

Parameters:
ctx - context
rs - result set
trxName - trx

MCostDetail

public MCostDetail(MAcctSchema as,
                   int AD_Org_ID,
                   int M_Product_ID,
                   int M_AttributeSetInstance_ID,
                   int M_CostElement_ID,
                   BigDecimal Amt,
                   BigDecimal Qty,
                   String Description,
                   String trxName)
New Constructor

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_CostElement_ID - optional cost element for Freight
Amt - amt
Qty - qty
Description - optional description
trxName - transaction
Method Detail

createOrder

public static boolean createOrder(MAcctSchema as,
                                  int AD_Org_ID,
                                  int M_Product_ID,
                                  int M_AttributeSetInstance_ID,
                                  int C_OrderLine_ID,
                                  int M_CostElement_ID,
                                  BigDecimal Amt,
                                  BigDecimal Qty,
                                  String Description,
                                  String trxName)
Create New Order Cost Detail for Purchase Orders. Called from Doc_MatchPO

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
C_OrderLine_ID - order
M_CostElement_ID - optional cost element for Freight
Amt - amt total amount
Qty - qty
Description - optional description
trxName - transaction
Returns:
true if created

createInvoice

public static boolean createInvoice(MAcctSchema as,
                                    int AD_Org_ID,
                                    int M_Product_ID,
                                    int M_AttributeSetInstance_ID,
                                    int C_InvoiceLine_ID,
                                    int M_CostElement_ID,
                                    BigDecimal Amt,
                                    BigDecimal Qty,
                                    String Description,
                                    String trxName)
Create New Invoice Cost Detail for AP Invoices. Called from Doc_Invoice - for Invoice Adjustments

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
C_InvoiceLine_ID - invoice
M_CostElement_ID - optional cost element for Freight
Amt - amt
Qty - qty
Description - optional description
trxName - transaction
Returns:
true if created

createShipment

public static boolean createShipment(MAcctSchema as,
                                     int AD_Org_ID,
                                     int M_Product_ID,
                                     int M_AttributeSetInstance_ID,
                                     int M_InOutLine_ID,
                                     int M_CostElement_ID,
                                     BigDecimal Amt,
                                     BigDecimal Qty,
                                     String Description,
                                     boolean IsSOTrx,
                                     String trxName)
Create New Shipment Cost Detail for SO Shipments. Called from Doc_MInOut - for SO Shipments

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_InOutLine_ID - shipment
M_CostElement_ID - optional cost element for Freight
Amt - amt
Qty - qty
Description - optional description
IsSOTrx - sales order
trxName - transaction
Returns:
true if no error

createWorkOrderTransaction

public static boolean createWorkOrderTransaction(MAcctSchema as,
                                                 int AD_Org_ID,
                                                 int M_Product_ID,
                                                 int M_AttributeSetInstance_ID,
                                                 int M_WorkOrderTransactionLine_ID,
                                                 int M_CostElement_ID,
                                                 BigDecimal Amt,
                                                 BigDecimal Qty,
                                                 String Description,
                                                 boolean IsSOTrx,
                                                 String trxName)
Create New Work Order Transaction Cost detail Called from Doc_WorkOrderTransaction - for Work Order Transactions

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_InOutLine_ID - shipment
M_CostElement_ID - optional cost element for Freight
Amt - amt
Qty - qty
Description - optional description
IsSOTrx - sales order
trxName - transaction
Returns:
true if no error

createInventory

public static boolean createInventory(MAcctSchema as,
                                      int AD_Org_ID,
                                      int M_Product_ID,
                                      int M_AttributeSetInstance_ID,
                                      int M_InventoryLine_ID,
                                      int M_CostElement_ID,
                                      BigDecimal Amt,
                                      BigDecimal Qty,
                                      String Description,
                                      String trxName)
Create New Order Cost Detail for Physical Inventory. Called from Doc_Inventory

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_InventoryLine_ID - order
M_CostElement_ID - optional cost element
Amt - amt total amount
Qty - qty
Description - optional description
trxName - transaction
Returns:
true if no error

createMovement

public static boolean createMovement(MAcctSchema as,
                                     int AD_Org_ID,
                                     int M_Product_ID,
                                     int M_AttributeSetInstance_ID,
                                     int M_MovementLine_ID,
                                     int M_CostElement_ID,
                                     BigDecimal Amt,
                                     BigDecimal Qty,
                                     boolean from,
                                     String Description,
                                     String trxName)
Create New Order Cost Detail for Movements. Called from Doc_Movement

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_MovementLine_ID - movement
M_CostElement_ID - optional cost element for Freight
Amt - amt total amount
Qty - qty
from - if true the from (reduction)
Description - optional description
trxName - transaction
Returns:
true if no error

createProduction

public static boolean createProduction(MAcctSchema as,
                                       int AD_Org_ID,
                                       int M_Product_ID,
                                       int M_AttributeSetInstance_ID,
                                       int M_ProductionLine_ID,
                                       int M_CostElement_ID,
                                       BigDecimal Amt,
                                       BigDecimal Qty,
                                       String Description,
                                       String trxName)
Create New Order Cost Detail for Production. Called from Doc_Production

Parameters:
as - accounting schema
AD_Org_ID - org
M_Product_ID - product
M_AttributeSetInstance_ID - asi
M_ProductionLine_ID - production line
M_CostElement_ID - optional cost element
Amt - amt total amount
Qty - qty
Description - optional description
trxName - transaction
Returns:
true if no error

processProduct

public static boolean processProduct(MProduct product,
                                     String trxName)
Process Cost Details for product

Parameters:
product - product
trxName - transaction
Returns:
true if no error

setAmt

public void setAmt(BigDecimal Amt)
Set Amt

Overrides:
setAmt in class X_M_CostDetail
Parameters:
Amt - amt

setQty

public void setQty(BigDecimal Qty)
Set Qty

Overrides:
setQty in class X_M_CostDetail
Parameters:
Qty - qty

isOrder

public boolean isOrder()
Is Order

Returns:
true if order line

isInvoice

public boolean isInvoice()
Is Invoice

Returns:
true if invoice line

isShipment

public boolean isShipment()
Is Shipment

Returns:
true if sales order shipment

isDelta

public boolean isDelta()
Is this a Delta Record (previously processed)?

Returns:
true if delta is not null

afterSave

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

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

beforeDelete

protected boolean beforeDelete()
Before Delete

Overrides:
beforeDelete in class PO
Returns:
false if processed

toString

public String toString()
String Representation

Overrides:
toString in class X_M_CostDetail
Returns:
info

process

public boolean process()
Process Cost Detail Record. The record is saved if processed.

Returns:
true if processed

Compiere 3.1

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