Package org.compiere.model
Class MInvoice
- java.lang.Object
-
- org.compiere.model.PO
-
- org.compiere.model.X_C_Invoice
-
- org.compiere.model.MInvoice
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparator<Object>,I_C_Invoice,I_Persistent,DocAction,IDocsPostProcess,Evaluatee
public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess
Invoice Model. Please do not set DocStatus and C_DocType_ID directly. They are set in the process() method. Use DocAction and C_DocTypeTarget_ID instead.- Version:
- $Id: MInvoice.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.model.X_C_Invoice
DOCACTION_AD_Reference_ID, DOCACTION_Approve, DOCACTION_Close, DOCACTION_Complete, DOCACTION_Invalidate, DOCACTION_None, DOCACTION_Post, DOCACTION_Prepare, DOCACTION_Re_Activate, DOCACTION_Reject, DOCACTION_Reverse_Accrual, DOCACTION_Reverse_Correct, DOCACTION_Unlock, DOCACTION_Void, DOCACTION_WaitComplete, DOCSTATUS_AD_Reference_ID, DOCSTATUS_Approved, DOCSTATUS_Closed, DOCSTATUS_Completed, DOCSTATUS_Drafted, DOCSTATUS_InProgress, DOCSTATUS_Invalid, DOCSTATUS_NotApproved, DOCSTATUS_Reversed, DOCSTATUS_Unknown, DOCSTATUS_Voided, DOCSTATUS_WaitingConfirmation, DOCSTATUS_WaitingPayment, INVOICECOLLECTIONTYPE_AD_Reference_ID, INVOICECOLLECTIONTYPE_CollectionAgency, INVOICECOLLECTIONTYPE_Dunning, INVOICECOLLECTIONTYPE_LegalProcedure, INVOICECOLLECTIONTYPE_Uncollectable, PAYMENTRULE_AD_Reference_ID, PAYMENTRULE_Cash, PAYMENTRULE_Check, PAYMENTRULE_CreditCard, PAYMENTRULE_DirectDebit, PAYMENTRULE_DirectDeposit, PAYMENTRULE_MixedPOSPayment, PAYMENTRULE_OnCredit
-
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.process.DocAction
ACTION_Approve, ACTION_Close, ACTION_Complete, ACTION_Invalidate, ACTION_None, ACTION_Post, ACTION_Prepare, ACTION_ReActivate, ACTION_Reject, ACTION_Reverse_Accrual, ACTION_Reverse_Correct, ACTION_Unlock, ACTION_Void, ACTION_WaitComplete, AD_REFERENCE_ID, DOC_COLUMNNAME_AD_User_ID, DOC_COLUMNNAME_C_Currency_ID, DOC_COLUMNNAME_C_DocType_ID, DOC_COLUMNNAME_C_DocTypeTarget_ID, DOC_COLUMNNAME_DateAcct, DOC_COLUMNNAME_DateTrx, DOC_COLUMNNAME_Description, DOC_COLUMNNAME_DocAction, DOC_COLUMNNAME_DocStatus, DOC_COLUMNNAME_DocumentNo, DOC_COLUMNNAME_IsApproved, DOC_COLUMNNAME_Processed, DOC_COLUMNNAME_Processing, DOC_COLUMNNAME_SalesRep_ID, STATUS_Approved, STATUS_Closed, STATUS_Completed, STATUS_Drafted, STATUS_InProgress, STATUS_Invalid, STATUS_NotApproved, STATUS_Reversed, STATUS_Unknown, STATUS_Voided, STATUS_WaitingConfirmation, STATUS_WaitingPayment
-
Fields inherited from interface org.compiere.model.I_C_Invoice
accessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_BPartner_Location_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_CashLine_ID, COLUMNNAME_C_CashPlanLine_ID, COLUMNNAME_C_Charge_ID, COLUMNNAME_C_ConversionType_ID, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_DocType_ID, COLUMNNAME_C_DocTypeTarget_ID, COLUMNNAME_C_DunningLevel_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_Invoice_UU, COLUMNNAME_C_Order_ID, COLUMNNAME_C_Payment_ID, COLUMNNAME_C_PaymentTerm_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_ChargeAmt, COLUMNNAME_CopyFrom, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_CreateFrom, COLUMNNAME_CurrencyRate, COLUMNNAME_DateAcct, COLUMNNAME_DateInvoiced, COLUMNNAME_DateOrdered, COLUMNNAME_DatePrinted, COLUMNNAME_Description, COLUMNNAME_DocAction, COLUMNNAME_DocStatus, COLUMNNAME_DocumentNo, COLUMNNAME_DunningGrace, COLUMNNAME_GenerateTo, COLUMNNAME_GrandTotal, COLUMNNAME_InvoiceCollectionType, COLUMNNAME_IsActive, COLUMNNAME_IsApproved, COLUMNNAME_IsDiscountPrinted, COLUMNNAME_IsFixedAssetInvoice, COLUMNNAME_IsInDispute, COLUMNNAME_IsOverrideCurrencyRate, COLUMNNAME_IsPaid, COLUMNNAME_IsPayScheduleValid, COLUMNNAME_IsPrinted, COLUMNNAME_IsSelfService, COLUMNNAME_IsSOTrx, COLUMNNAME_IsTaxIncluded, COLUMNNAME_IsTransferred, COLUMNNAME_M_PriceList_ID, COLUMNNAME_M_RMA_ID, COLUMNNAME_PaymentRule, COLUMNNAME_POReference, COLUMNNAME_Posted, COLUMNNAME_Processed, COLUMNNAME_ProcessedOn, COLUMNNAME_Processing, COLUMNNAME_Ref_Invoice_ID, COLUMNNAME_RelatedInvoice_ID, COLUMNNAME_Reversal_ID, COLUMNNAME_SalesRep_ID, COLUMNNAME_SendEMail, COLUMNNAME_TotalLines, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, Model, Table_ID, Table_Name
-
-
Constructor Summary
Constructors Constructor Description MInvoice(Properties ctx, int C_Invoice_ID, String trxName)Invoice ConstructorMInvoice(Properties ctx, ResultSet rs, String trxName)Load ConstructorMInvoice(Properties ctx, MInvoice copy)MInvoice(Properties ctx, MInvoice copy, String trxName)MInvoice(MInOut ship, Timestamp invoiceDate)Create Invoice from ShipmentMInvoice(MInvoice copy)MInvoice(MInvoiceBatch batch, MInvoiceBatchLine line)Create Invoice from Batch LineMInvoice(MOrder order, int C_DocTypeTarget_ID, Timestamp invoiceDate)Create Invoice from Order
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDescription(String description)Add to Descriptionprotected booleanafterDelete(boolean success)After Deleteprotected booleanafterSave(boolean newRecord, boolean success)After SavebooleanapproveIt()Approve Documentprotected booleanbeforeDelete()Before Deleteprotected booleanbeforeSave(boolean newRecord)Before SavebooleancalculateTaxTotal()Calculate Tax and TotalbooleancloseIt()Close Document.StringcompleteIt()Complete Documentstatic MInvoicecopyFrom(MInvoice from, Timestamp dateDoc, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder)Deprecated.Create new Invoice by copyingstatic MInvoicecopyFrom(MInvoice from, Timestamp dateDoc, Timestamp dateAcct, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder)Create new Invoice by copyingstatic MInvoicecopyFrom(MInvoice from, Timestamp dateDoc, Timestamp dateAcct, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder, String documentNo)Create new Invoice by copyingintcopyLinesFrom(MInvoice otherInvoice, boolean counter, boolean setOrder)Copy Lines From other Invoice.intcopyLinesFrom(MInvoice otherInvoice, boolean counter, boolean setOrder, boolean copyClientOrg)Copy Lines From other Invoice.FilecreatePDF()Create PDFFilecreatePDF(File file)Create PDF filestatic MInvoiceget(int C_Invoice_ID)Get MInvoice from dbstatic MInvoiceget(Properties ctx, int C_Invoice_ID)Get MInvoice from dbBigDecimalgetAllocatedAmt()Get Allocated Amt in Invoice CurrencyBigDecimalgetApprovalAmt()Get Document Approval AmountStringgetCurrencyISO()Get ISO Code of CurrencyintgetDoc_User_ID()Get Document Owner (Responsible)List<PO>getDocsPostProcess()StringgetDocStatusName()Get Document StatusintgetDocTypeID()Returns C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set)StringgetDocumentInfo()Get Document InfoBigDecimalgetGrandTotal(boolean creditMemoAdjusted)Get Grand TotalMInvoiceLine[]getLines()Get Lines of InvoiceMInvoiceLine[]getLines(boolean requery)Get Invoice Linesstatic MInvoice[]getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)Get Payments Of BPartnerBigDecimalgetOpenAmt()Get Open Amount.BigDecimalgetOpenAmt(boolean creditMemoAdjusted, Timestamp paymentDate)BigDecimalgetOpenAmt(boolean creditMemoAdjusted, Timestamp paymentDate, boolean requery)Get Open AmountBigDecimalgetOpenAmt(Timestamp paymentDate)MOrdergetOriginalOrder()Get original orderStringgetPDFFileName(String documentDir)Get PDF File Namestatic StringgetPDFFileName(String documentDir, int C_Invoice_ID)Get PDF File NameintgetPrecision()Get Currency PrecisionStringgetProcessMsg()Get Process MessageStringgetSummary()Get SummaryMInvoiceTax[]getTaxes(boolean requery)Get TaxesMTaxProvider[]getTaxProviders()Get tax providersBigDecimalgetTotalLines(boolean creditMemoAdjusted)Get Total LinesbooleaninvalidateIt()Invalidate DocumentbooleanisComplete()Document Status is Complete or ClosedbooleanisCreditMemo()Is it a Credit Memo?booleanisReversal()Is ReversalStringprepareIt()Prepare DocumentbooleanprocessIt(String processAction)Process documentbooleanreActivateIt()Re-activatebooleanrejectIt()Reject ApprovalvoidrenumberLines(int step)Renumber LinesbooleanreverseAccrualIt()Reverse Accrual - nonebooleanreverseCorrectIt()Reverse Correction - same datevoidsetBPartner(MBPartner bp)Set Business Partner Defaults and DetailsvoidsetC_DocTypeTarget_ID()Set Target Document Type.voidsetC_DocTypeTarget_ID(String DocBaseType)Set Target Document TypevoidsetClientOrg(int AD_Client_ID, int AD_Org_ID)Overwrite Client/Org if requiredstatic voidsetIsPaid(Properties ctx, int C_BPartner_ID, String trxName)Set Paid Flag for invoicesvoidsetM_PriceList_ID(int M_PriceList_ID)Set Price List (and Currency) when validvoidsetOrder(MOrder order)Set Order ReferencesvoidsetProcessed(boolean processed)Set Processed.voidsetProcessMessage(String processMsg)Set process messagevoidsetReversal(boolean reversal)Set ReversalvoidsetRMA(MRMA rma)voidsetShipment(MInOut ship)Set Shipment ReferencesbooleantestAllocation()booleantestAllocation(boolean beingCompleted)Test Allocation (and set paid flag)StringtoString()String RepresentationbooleanunlockIt()Unlock Document.booleanvalidatePaySchedule()Validate Invoice Pay SchedulebooleanvoidIt()Void Document.-
Methods inherited from class org.compiere.model.X_C_Invoice
get_AccessLevel, getAD_OrgTrx_ID, getAD_User, getAD_User_ID, getC_Activity, getC_Activity_ID, getC_BPartner, getC_BPartner_ID, getC_BPartner_Location, getC_BPartner_Location_ID, getC_Campaign, getC_Campaign_ID, getC_CashLine, getC_CashLine_ID, getC_CashPlanLine, getC_CashPlanLine_ID, getC_Charge, getC_Charge_ID, getC_ConversionType, getC_ConversionType_ID, getC_Currency, getC_Currency_ID, getC_DocType, getC_DocType_ID, getC_DocTypeTarget, getC_DocTypeTarget_ID, getC_DunningLevel, getC_DunningLevel_ID, getC_Invoice_ID, getC_Invoice_UU, getC_Order, getC_Order_ID, getC_Payment, getC_Payment_ID, getC_PaymentTerm, getC_PaymentTerm_ID, getC_Project, getC_Project_ID, getChargeAmt, getCopyFrom, getCreateFrom, getCurrencyRate, getDateAcct, getDateInvoiced, getDateOrdered, getDatePrinted, getDescription, getDocAction, getDocStatus, getDocumentNo, getDunningGrace, getGenerateTo, getGrandTotal, getInvoiceCollectionType, getKeyNamePair, getM_PriceList, getM_PriceList_ID, getM_RMA, getM_RMA_ID, getPaymentRule, getPOReference, getProcessedOn, getRef_Invoice_ID, getRelatedInvoice, getRelatedInvoice_ID, getReversal, getReversal_ID, getSalesRep, getSalesRep_ID, getTotalLines, getUser1, getUser1_ID, getUser2, getUser2_ID, initPO, isApproved, isDiscountPrinted, isFixedAssetInvoice, isInDispute, isOverrideCurrencyRate, isPaid, isPayScheduleValid, isPosted, isPrinted, isProcessed, isProcessing, isSelfService, isSendEMail, isSOTrx, isTaxIncluded, isTransferred, setAD_OrgTrx_ID, setAD_User_ID, setC_Activity_ID, setC_BPartner_ID, setC_BPartner_Location_ID, setC_Campaign_ID, setC_CashLine_ID, setC_CashPlanLine_ID, setC_Charge_ID, setC_ConversionType_ID, setC_Currency_ID, setC_DocType_ID, setC_DocTypeTarget_ID, setC_DunningLevel_ID, setC_Invoice_ID, setC_Invoice_UU, setC_Order_ID, setC_Payment_ID, setC_PaymentTerm_ID, setC_Project_ID, setChargeAmt, setCopyFrom, setCreateFrom, setCurrencyRate, setDateAcct, setDateInvoiced, setDateOrdered, setDatePrinted, setDescription, setDocAction, setDocStatus, setDocumentNo, setDunningGrace, setGenerateTo, setGrandTotal, setInvoiceCollectionType, setIsApproved, setIsDiscountPrinted, setIsFixedAssetInvoice, setIsInDispute, setIsOverrideCurrencyRate, setIsPaid, setIsPayScheduleValid, setIsPrinted, setIsSelfService, setIsSOTrx, setIsTaxIncluded, setIsTransferred, setM_RMA_ID, setPaymentRule, setPOReference, setPosted, setProcessedOn, setProcessing, setRef_Invoice_ID, setRelatedInvoice_ID, setReversal_ID, setSalesRep_ID, setSendEMail, setTotalLines, setUser1_ID, setUser2_ID
-
Methods inherited from class org.compiere.model.PO
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, 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.process.DocAction
get_ID, get_Logger, get_Table_ID, get_TrxName, getAD_Client_ID, getAD_Org_ID, getC_Currency_ID, getCtx, getDocAction, getDocStatus, getDocumentNo, save, saveEx, setDocStatus
-
Methods inherited from interface org.compiere.model.I_C_Invoice
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
-
MInvoice
public MInvoice(Properties ctx, int C_Invoice_ID, String trxName)
Invoice Constructor- Parameters:
ctx- contextC_Invoice_ID- invoice or 0 for newtrxName- trx name
-
MInvoice
public MInvoice(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- result set recordtrxName- transaction
-
MInvoice
public MInvoice(MOrder order, int C_DocTypeTarget_ID, Timestamp invoiceDate)
Create Invoice from Order- Parameters:
order- orderC_DocTypeTarget_ID- target document typeinvoiceDate- date or null
-
MInvoice
public MInvoice(MInOut ship, Timestamp invoiceDate)
Create Invoice from Shipment- Parameters:
ship- shipmentinvoiceDate- date or null
-
MInvoice
public MInvoice(MInvoiceBatch batch, MInvoiceBatchLine line)
Create Invoice from Batch Line- Parameters:
batch- batchline- batch line
-
MInvoice
public MInvoice(MInvoice copy)
- Parameters:
copy-
-
MInvoice
public MInvoice(Properties ctx, MInvoice copy)
- Parameters:
ctx-copy-
-
MInvoice
public MInvoice(Properties ctx, MInvoice copy, String trxName)
- Parameters:
ctx-copy-trxName-
-
-
Method Detail
-
getOfBPartner
public static MInvoice[] getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)
Get Payments Of BPartner- Parameters:
ctx- contextC_BPartner_ID- idtrxName- transaction- Returns:
- array
-
copyFrom
public static MInvoice copyFrom(MInvoice from, Timestamp dateDoc, Timestamp dateAcct, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder)
Create new Invoice by copying- Parameters:
from- invoicedateDoc- date of the document datedateAcct- original account dateC_DocTypeTarget_ID- target doc typeisSOTrx- sales ordercounter- create counter linkstrxName- trxsetOrder- set Order links- Returns:
- Invoice
-
copyFrom
public static MInvoice copyFrom(MInvoice from, Timestamp dateDoc, Timestamp dateAcct, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder, String documentNo)
Create new Invoice by copying- Parameters:
from- invoicedateDoc- date of the document datedateAcct- original account dateC_DocTypeTarget_ID- target doc typeisSOTrx- sales ordercounter- create counter linkstrxName- trxsetOrder- set Order linksdocumentNo- Document Number for reversed invoices- Returns:
- Invoice
-
copyFrom
public static MInvoice copyFrom(MInvoice from, Timestamp dateDoc, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder)
Deprecated.Create new Invoice by copying- Parameters:
from- invoicedateDoc- date of the document dateC_DocTypeTarget_ID- target doc typeisSOTrx- sales ordercounter- create counter linkstrxName- trxsetOrder- set Order links- Returns:
- Invoice
-
getPDFFileName
public static String getPDFFileName(String documentDir, int C_Invoice_ID)
Get PDF File Name- Parameters:
documentDir- directoryC_Invoice_ID- invoice- Returns:
- file name
-
get
public static MInvoice get(int C_Invoice_ID)
Get MInvoice from db- Parameters:
C_Invoice_ID- id- Returns:
- MInvoice
-
get
public static MInvoice get(Properties ctx, int C_Invoice_ID)
Get MInvoice from db- Parameters:
C_Invoice_ID- id- Returns:
- MInvoice
-
setClientOrg
public void setClientOrg(int AD_Client_ID, int AD_Org_ID)Overwrite Client/Org if required- Overrides:
setClientOrgin classPO- Parameters:
AD_Client_ID- clientAD_Org_ID- org
-
setBPartner
public void setBPartner(MBPartner bp)
Set Business Partner Defaults and Details- Parameters:
bp- business partner
-
setOrder
public void setOrder(MOrder order)
Set Order References- Parameters:
order- order
-
setShipment
public void setShipment(MInOut ship)
Set Shipment References- Parameters:
ship- shipment
-
setC_DocTypeTarget_ID
public void setC_DocTypeTarget_ID(String DocBaseType)
Set Target Document Type- Parameters:
DocBaseType- doc type MDocType.DOCBASETYPE_
-
setC_DocTypeTarget_ID
public void setC_DocTypeTarget_ID()
Set Target Document Type. Based on SO flag AP/AP Invoice
-
getGrandTotal
public BigDecimal getGrandTotal(boolean creditMemoAdjusted)
Get Grand Total- Parameters:
creditMemoAdjusted- adjusted for CM (negative)- Returns:
- grand total
-
getTotalLines
public BigDecimal getTotalLines(boolean creditMemoAdjusted)
Get Total Lines- Parameters:
creditMemoAdjusted- adjusted for CM (negative)- Returns:
- total lines
-
getLines
public MInvoiceLine[] getLines(boolean requery)
Get Invoice Lines- Parameters:
requery-- Returns:
- lines
-
getLines
public MInvoiceLine[] getLines()
Get Lines of Invoice- Returns:
- lines
-
renumberLines
public void renumberLines(int step)
Renumber Lines- Parameters:
step- start and step
-
copyLinesFrom
public int copyLinesFrom(MInvoice otherInvoice, boolean counter, boolean setOrder)
Copy Lines From other Invoice.- Parameters:
otherInvoice- invoicecounter- create counter linkssetOrder- set order links- Returns:
- number of lines copied
-
copyLinesFrom
public int copyLinesFrom(MInvoice otherInvoice, boolean counter, boolean setOrder, boolean copyClientOrg)
Copy Lines From other Invoice.- Parameters:
otherInvoice- invoicecounter- create counter linkssetOrder- set order linkscopyClientOrg- copy also Client and Org- Returns:
- number of lines copied
-
setReversal
public void setReversal(boolean reversal)
Set Reversal- Parameters:
reversal- reversal
-
isReversal
public boolean isReversal()
Is Reversal- Returns:
- reversal
-
getTaxes
public MInvoiceTax[] getTaxes(boolean requery)
Get Taxes- Parameters:
requery- requery- Returns:
- array of taxes
-
addDescription
public void addDescription(String description)
Add to Description- Parameters:
description- text
-
isCreditMemo
public boolean isCreditMemo()
Is it a Credit Memo?- Returns:
- true if CM
-
setProcessed
public void setProcessed(boolean processed)
Set Processed. Propergate to Lines/Taxes- Specified by:
setProcessedin interfaceI_C_Invoice- Overrides:
setProcessedin classX_C_Invoice- Parameters:
processed- processed
-
validatePaySchedule
public boolean validatePaySchedule()
Validate Invoice Pay Schedule- Returns:
- pay schedule is valid
-
beforeSave
protected boolean beforeSave(boolean newRecord)
Before Save- Overrides:
beforeSavein classPO- Parameters:
newRecord- new- Returns:
- true
-
beforeDelete
protected boolean beforeDelete()
Before Delete- Overrides:
beforeDeletein classPO- Returns:
- true if it can be deleted
-
afterDelete
protected boolean afterDelete(boolean success)
After Delete- Overrides:
afterDeletein classPO- Parameters:
success- success- Returns:
- deleted
-
toString
public String toString()
String Representation- Overrides:
toStringin classX_C_Invoice- Returns:
- info
-
getDocumentInfo
public String getDocumentInfo()
Get Document Info- Specified by:
getDocumentInfoin interfaceDocAction- Returns:
- document info (untranslated)
-
afterSave
protected boolean afterSave(boolean newRecord, boolean success)After Save
-
setM_PriceList_ID
public void setM_PriceList_ID(int M_PriceList_ID)
Set Price List (and Currency) when valid- Specified by:
setM_PriceList_IDin interfaceI_C_Invoice- Overrides:
setM_PriceList_IDin classX_C_Invoice- Parameters:
M_PriceList_ID- price list
-
getAllocatedAmt
public BigDecimal getAllocatedAmt()
Get Allocated Amt in Invoice Currency- Returns:
- pos/neg amount or null
-
testAllocation
public boolean testAllocation(boolean beingCompleted)
Test Allocation (and set paid flag)- Returns:
- true if updated
-
testAllocation
public boolean testAllocation()
-
setIsPaid
public static void setIsPaid(Properties ctx, int C_BPartner_ID, String trxName)
Set Paid Flag for invoices- Parameters:
ctx- contextC_BPartner_ID- if 0 alltrxName- transaction
-
getOpenAmt
public BigDecimal getOpenAmt()
Get Open Amount. Used by web interface- Returns:
- Open Amt
-
getOpenAmt
public BigDecimal getOpenAmt(boolean creditMemoAdjusted, Timestamp paymentDate)
-
getOpenAmt
public BigDecimal getOpenAmt(boolean creditMemoAdjusted, Timestamp paymentDate, boolean requery)
Get Open Amount- Parameters:
creditMemoAdjusted- adjusted for CM (negative)paymentDate- Payment Date- Returns:
- Open Amt
-
getOpenAmt
public BigDecimal getOpenAmt(Timestamp paymentDate)
-
getDocStatusName
public String getDocStatusName()
Get Document Status- Returns:
- Document Status Clear Text
-
createPDF
public File createPDF()
Create PDF
-
createPDF
public File createPDF(File file)
Create PDF file- Parameters:
file- output file- Returns:
- file if success
-
getPDFFileName
public String getPDFFileName(String documentDir)
Get PDF File Name- Parameters:
documentDir- directory- Returns:
- file name
-
getCurrencyISO
public String getCurrencyISO()
Get ISO Code of Currency- Returns:
- Currency ISO
-
getPrecision
public int getPrecision()
Get Currency Precision- Returns:
- precision
-
processIt
public boolean processIt(String processAction)
Process document
-
unlockIt
public boolean unlockIt()
Unlock Document.
-
invalidateIt
public boolean invalidateIt()
Invalidate Document- Specified by:
invalidateItin interfaceDocAction- Returns:
- true if success
-
prepareIt
public String prepareIt()
Prepare Document
-
calculateTaxTotal
public boolean calculateTaxTotal()
Calculate Tax and Total- Returns:
- true if calculated
-
approveIt
public boolean approveIt()
Approve Document
-
rejectIt
public boolean rejectIt()
Reject Approval
-
completeIt
public String completeIt()
Complete Document- Specified by:
completeItin interfaceDocAction- Returns:
- new status (Complete, In Progress, Invalid, Waiting ..)
-
getDocsPostProcess
public List<PO> getDocsPostProcess()
- Specified by:
getDocsPostProcessin interfaceIDocsPostProcess- Returns:
- List of doc to process after Complete
-
voidIt
public boolean voidIt()
Void Document.
-
closeIt
public boolean closeIt()
Close Document.
-
reverseCorrectIt
public boolean reverseCorrectIt()
Reverse Correction - same date- Specified by:
reverseCorrectItin interfaceDocAction- Returns:
- true if success
-
reverseAccrualIt
public boolean reverseAccrualIt()
Reverse Accrual - none- Specified by:
reverseAccrualItin interfaceDocAction- Returns:
- false
-
reActivateIt
public boolean reActivateIt()
Re-activate- Specified by:
reActivateItin interfaceDocAction- Returns:
- false
-
getSummary
public String getSummary()
Get Summary- Specified by:
getSummaryin interfaceDocAction- Returns:
- Summary of Document
-
getProcessMsg
public String getProcessMsg()
Get Process Message- Specified by:
getProcessMsgin interfaceDocAction- Returns:
- clear text error message
-
getDoc_User_ID
public int getDoc_User_ID()
Get Document Owner (Responsible)- Specified by:
getDoc_User_IDin interfaceDocAction- Returns:
- AD_User_ID
-
getApprovalAmt
public BigDecimal getApprovalAmt()
Get Document Approval Amount- Specified by:
getApprovalAmtin interfaceDocAction- Returns:
- amount
-
setRMA
public void setRMA(MRMA rma)
- Parameters:
rma-
-
isComplete
public boolean isComplete()
Document Status is Complete or Closed- Returns:
- true if CO, CL or RE
-
getOriginalOrder
public MOrder getOriginalOrder()
Get original order- Returns:
- order
-
setProcessMessage
public void setProcessMessage(String processMsg)
Set process message- Parameters:
processMsg-
-
getTaxProviders
public MTaxProvider[] getTaxProviders()
Get tax providers- Returns:
- array of tax provider
-
getDocTypeID
public int getDocTypeID()
Returns C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set)
-
-