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
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
record for matchings -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Index constant for Vectorstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
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, DOCBASETYPE_AD_Reference_ID, DOCBASETYPE_APCreditMemo, DOCBASETYPE_APInvoice, DOCBASETYPE_APPayment, DOCBASETYPE_ARCreditMemo, DOCBASETYPE_ARInvoice, DOCBASETYPE_ARProFormaInvoice, DOCBASETYPE_ARReceipt, DOCBASETYPE_BankStatement, DOCBASETYPE_CashJournal, DOCBASETYPE_DistributionOrder, DOCBASETYPE_FixedAssetsAddition, DOCBASETYPE_FixedAssetsDepreciation, DOCBASETYPE_FixedAssetsDisposal, DOCBASETYPE_GLDocument, DOCBASETYPE_GLJournal, DOCBASETYPE_MaintenanceOrder, DOCBASETYPE_ManufacturingCostCollector, DOCBASETYPE_ManufacturingOrder, DOCBASETYPE_MatchInvoice, DOCBASETYPE_MatchPO, DOCBASETYPE_MaterialDelivery, DOCBASETYPE_MaterialMovement, DOCBASETYPE_MaterialPhysicalInventory, DOCBASETYPE_MaterialProduction, DOCBASETYPE_MaterialReceipt, DOCBASETYPE_PaymentAllocation, DOCBASETYPE_Payroll, DOCBASETYPE_ProjectIssue, DOCBASETYPE_PurchaseOrder, DOCBASETYPE_PurchaseRequisition, DOCBASETYPE_QualityOrder, DOCBASETYPE_SalesOrder, 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, UUID_NEW_RECORD, 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_CreateLinesFrom, COLUMNNAME_CurrencyRate, COLUMNNAME_DateAcct, COLUMNNAME_DateInvoiced, COLUMNNAME_DateOrdered, COLUMNNAME_DatePrinted, COLUMNNAME_Description, COLUMNNAME_DocAction, COLUMNNAME_DocBaseType, 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
ConstructorDescriptionMInvoice
(Properties ctx, int C_Invoice_ID, String trxName) Invoice ConstructorMInvoice
(Properties ctx, int C_Invoice_ID, String trxName, String... virtualColumns) MInvoice
(Properties ctx, String C_Invoice_UU, String trxName) UUID based ConstructorMInvoice
(Properties ctx, ResultSet rs, String trxName) Load ConstructorMInvoice
(Properties ctx, MInvoice copy) Copy constructorMInvoice
(Properties ctx, MInvoice copy, String trxName) Copy constructorCreate Invoice from Shipment/ReceiptCopy constructorMInvoice
(MInvoiceBatch batch, MInvoiceBatchLine line) Create Invoice from Batch LineCreate Invoice from Order -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescription
(String description) Add to Descriptionprotected boolean
afterDelete
(boolean success) After Deleteprotected boolean
afterSave
(boolean newRecord, boolean success) After Saveboolean
Approve Documentprotected boolean
Before Deleteprotected boolean
beforeSave
(boolean newRecord) Before Saveboolean
Calculate Tax and Totalboolean
closeIt()
Close Document.Complete Documentstatic MInvoice
copyFrom
(MInvoice from, Timestamp dateDoc, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder) Deprecated.Create new Invoice by copyingstatic MInvoice
copyFrom
(MInvoice from, Timestamp dateDoc, Timestamp dateAcct, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, String trxName, boolean setOrder) Create new Invoice by copyingstatic 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 copyingint
copyLinesFrom
(MInvoice otherInvoice, boolean counter, boolean setOrder) Copy Lines From other Invoice.int
copyLinesFrom
(MInvoice otherInvoice, boolean counter, boolean setOrder, boolean copyClientOrg) Copy Lines From other Invoice.void
createLineFrom
(int C_OrderLine_ID, int M_InOutLine_ID, int M_RMALine_ID, int M_Product_ID, int C_UOM_ID, BigDecimal Qty) Create Line from orderline/inoutline/rmalineCreate PDFCreate PDF filestatic MInvoice
get
(int C_Invoice_ID) Get MInvoice from DBstatic MInvoice
get
(Properties ctx, int C_Invoice_ID) Get MInvoice from DBGet Allocated Amt in Invoice CurrencyGet Document Approval AmountGet ISO Code of CurrencygetDiscountAmt
(Timestamp paymentDate) Get discount amt depending on payment dateint
Get Document Owner (Responsible)Get Document Status Nameint
Get C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set)Get Document Infostatic List<MInvoice.MatchingRecord>
getFullOrPartiallyMatchedToReceipt
(int C_BPartner_ID, int M_Product_ID, int M_InOutLine_ID, Timestamp from, Timestamp to, String trxName) getGrandTotal
(boolean creditMemoAdjusted) Get Grand TotalgetLines()
Get Lines of InvoicegetLines
(boolean requery) Get Invoice Linesstatic List<MInvoice.MatchingRecord>
getNotFullyMatchedToReceipt
(int C_BPartner_ID, int M_Product_ID, int M_InOutLine_ID, Timestamp from, Timestamp to, String trxName) static MInvoice[]
getOfBPartner
(Properties ctx, int C_BPartner_ID, String trxName) Get invoices Of BPartnerGet Open Amount.getOpenAmt
(boolean creditMemoAdjusted, Timestamp paymentDate) getOpenAmt
(boolean creditMemoAdjusted, Timestamp paymentDate, boolean requery) Get Open AmountgetOpenAmt
(Timestamp paymentDate) Get open amt depending on payment dateGet original ordergetPDFFileName
(String documentDir) Get PDF File Namestatic String
getPDFFileName
(String documentDir, int C_Invoice_ID) Get PDF File Nameint
Get Currency PrecisionGet Process MessageGet SummarygetTaxes
(boolean requery) Get TaxesGet tax providersgetTotalLines
(boolean creditMemoAdjusted) Get Total LinesgetUnpaidInvoiceData
(boolean isMultiCurrency, Timestamp date, int AD_Org_ID, int C_Currency_ID, int C_BPartner_ID, String trxName) Get unpaid invoicesboolean
Invalidate Documentboolean
Document Status is Complete or Closedboolean
Is it a Credit Memo?boolean
Is ReversalPrepare Documentboolean
Process documentboolean
Re-activateboolean
rejectIt()
Reject Approvalvoid
renumberLines
(int step) Renumber Linesboolean
Reverse Accrual - use current dateboolean
Reverse Correction - same datevoid
setBPartner
(MBPartner bp) Set Business Partner Defaults and Detailsvoid
Set Target Document Type.void
setC_DocTypeTarget_ID
(String DocBaseType) Set Target Document Typevoid
setClientOrg
(int AD_Client_ID, int AD_Org_ID) Overwrite Client/Org if requiredstatic void
setIsPaid
(Properties ctx, int C_BPartner_ID, String trxName) Set Paid Flag for invoicesvoid
setM_PriceList_ID
(int M_PriceList_ID) Set Price List (and Currency) when validvoid
Set Order Referencevoid
setProcessed
(boolean processed) Set Processed.void
setProcessMessage
(String processMsg) Set process messagevoid
setReversal
(boolean reversal) Set Reversal state (in memory flag)void
void
setShipment
(MInOut ship) Set Shipment Referenceboolean
Test Allocation (and set paid flag)boolean
testAllocation
(boolean beingCompleted) Test Allocation (and set paid flag)toString()
String Representationboolean
unlockIt()
Unlock Document.void
updateFrom
(MOrder order) Update from orderboolean
Validate Invoice Pay Scheduleboolean
voidIt()
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, getCreateLinesFrom, getCurrencyRate, getDateAcct, getDateInvoiced, getDateOrdered, getDatePrinted, getDescription, getDocAction, getDocBaseType, 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, setCreateLinesFrom, setCurrencyRate, setDateAcct, setDateInvoiced, setDateOrdered, setDatePrinted, setDescription, setDocAction, setDocBaseType, 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
buildInsertSQL, 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_UUID, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, 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, loadByUU, loadComplete, loadDefaults, loadPO, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveCrossTenantSafe, saveCrossTenantSafeEx, saveCrossTenantSafeEx, 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, toInsertSQL, 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
-
Field Details
-
MATCH_TO_RECEIPT_SQL
- See Also:
-
NOT_FULLY_MATCHED_TO_RECEIPT_GROUP_BY
-
FULL_OR_PARTIALLY_MATCHED_TO_RECEIPT_GROUP_BY
-
docsPostProcess
-
UNPAID_INVOICE_SELECTED
public static final int UNPAID_INVOICE_SELECTEDIndex constant for Vector- See Also:
-
UNPAID_INVOICE_TRX_DATE
public static final int UNPAID_INVOICE_TRX_DATE- See Also:
-
UNPAID_INVOICE_DOCUMENT_KEY_NAME_PAIR
public static final int UNPAID_INVOICE_DOCUMENT_KEY_NAME_PAIR- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_ISO
public static final int UNPAID_INVOICE_MULTI_CURRENCY_ISO- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_INVOICE_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_INVOICE_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_CONVERTED_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_CONVERTED_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_OPEN_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_OPEN_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_CONVERTED_DISCOUNT_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_CONVERTED_DISCOUNT_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_WRITE_OFF_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_WRITE_OFF_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_APPLIED_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_APPLIED_AMT- See Also:
-
UNPAID_INVOICE_MULTI_CURRENCY_OVER_UNDER_AMT
public static final int UNPAID_INVOICE_MULTI_CURRENCY_OVER_UNDER_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_INVOICE_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_INVOICE_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_OPEN_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_OPEN_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_DISCOUNT_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_DISCOUNT_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_WRITE_OFF_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_WRITE_OFF_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_APPLIED_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_APPLIED_AMT- See Also:
-
UNPAID_INVOICE_SINGLE_CURRENCY_OVER_UNDER_AMT
public static final int UNPAID_INVOICE_SINGLE_CURRENCY_OVER_UNDER_AMT- See Also:
-
-
Constructor Details
-
MInvoice
UUID based Constructor- Parameters:
ctx
- ContextC_Invoice_UU
- UUID keytrxName
- Transaction
-
MInvoice
Invoice Constructor- Parameters:
ctx
- contextC_Invoice_ID
- invoice or 0 for newtrxName
- trx name
-
MInvoice
- Parameters:
ctx
-C_Invoice_ID
-trxName
-virtualColumns
-
-
MInvoice
Load Constructor- Parameters:
ctx
- contextrs
- result set recordtrxName
- transaction
-
MInvoice
Create Invoice from Order- Parameters:
order
- orderC_DocTypeTarget_ID
- target document typeinvoiceDate
- date or null
-
MInvoice
Create Invoice from Shipment/Receipt- Parameters:
ship
- shipment/receiptinvoiceDate
- date or null
-
MInvoice
Create Invoice from Batch Line- Parameters:
batch
- batchline
- batch line
-
MInvoice
Copy constructor- Parameters:
copy
-
-
MInvoice
Copy constructor- Parameters:
ctx
-copy
-
-
MInvoice
Copy constructor- Parameters:
ctx
-copy
-trxName
-
-
-
Method Details
-
getNotFullyMatchedToReceipt
public static List<MInvoice.MatchingRecord> getNotFullyMatchedToReceipt(int C_BPartner_ID, int M_Product_ID, int M_InOutLine_ID, Timestamp from, Timestamp to, String trxName) - Parameters:
C_BPartner_ID
-M_Product_ID
-M_InOutLine_ID
-from
-to
-trxName
-- Returns:
- list of invoices not fully matched to receipt
-
getFullOrPartiallyMatchedToReceipt
public static List<MInvoice.MatchingRecord> getFullOrPartiallyMatchedToReceipt(int C_BPartner_ID, int M_Product_ID, int M_InOutLine_ID, Timestamp from, Timestamp to, String trxName) - Parameters:
C_BPartner_ID
-M_Product_ID
-M_InOutLine_ID
-from
-to
-trxName
-- Returns:
- list of invoices full or partially match to receipt
-
getOfBPartner
Get invoices Of BPartner- Parameters:
ctx
- contextC_BPartner_ID
- idtrxName
- transaction- Returns:
- array of invoice
-
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
@Deprecated 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
Get PDF File Name- Parameters:
documentDir
- directoryC_Invoice_ID
- invoice- Returns:
- file name
-
get
Get MInvoice from DB- Parameters:
C_Invoice_ID
- id- Returns:
- MInvoice
-
get
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:
setClientOrg
in classPO
- Parameters:
AD_Client_ID
- clientAD_Org_ID
- org
-
setBPartner
Set Business Partner Defaults and Details- Parameters:
bp
- business partner
-
setOrder
Set Order Reference- Parameters:
order
- order
-
setShipment
Set Shipment Reference- Parameters:
ship
- shipment
-
setC_DocTypeTarget_ID
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 AR/AP Invoice. -
getGrandTotal
Get Grand Total- Parameters:
creditMemoAdjusted
- true to negate amount return- Returns:
- grand total
-
getTotalLines
Get Total Lines- Parameters:
creditMemoAdjusted
- true to negate amount return- Returns:
- total lines
-
getLines
Get Invoice Lines- Parameters:
requery
-- Returns:
- lines
-
getLines
Get Lines of Invoice- Returns:
- lines
-
renumberLines
public void renumberLines(int step) Renumber Lines- Parameters:
step
- start and step to increment
-
copyLinesFrom
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 state (in memory flag)- Parameters:
reversal
- reversal
-
isReversal
public boolean isReversal()Is Reversal- Returns:
- reversal state (in memory flag)
-
getTaxes
Get Taxes- Parameters:
requery
- true to requery from DB- Returns:
- array of taxes
-
addDescription
Add to Description- Parameters:
description
- text
-
isCreditMemo
public boolean isCreditMemo()Is it a Credit Memo?- Returns:
- true if this is CM document (DOCBASETYPE_APCreditMemo or DOCBASETYPE_ARCreditMemo)
-
setProcessed
public void setProcessed(boolean processed) Set Processed. Propagate to Lines/Taxes.- Specified by:
setProcessed
in interfaceI_C_Invoice
- Overrides:
setProcessed
in classX_C_Invoice
- Parameters:
processed
- processed
-
validatePaySchedule
public boolean validatePaySchedule()Validate Invoice Pay Schedule- Returns:
- true if pay schedule is valid
-
beforeSave
protected boolean beforeSave(boolean newRecord) Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- true
-
beforeDelete
protected boolean beforeDelete()Before Delete- Overrides:
beforeDelete
in classPO
- Returns:
- true if it can be deleted
-
afterDelete
protected boolean afterDelete(boolean success) After Delete- Overrides:
afterDelete
in classPO
- Parameters:
success
- success- Returns:
- true if deleted
-
toString
String Representation- Overrides:
toString
in classX_C_Invoice
- Returns:
- info
-
getDocumentInfo
Get Document Info- Specified by:
getDocumentInfo
in 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_ID
in interfaceI_C_Invoice
- Overrides:
setM_PriceList_ID
in classX_C_Invoice
- Parameters:
M_PriceList_ID
- price list
-
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)- Parameters:
beingCompleted
- true if call during processing of Complete document action- Returns:
- true if updated IsPaid
-
testAllocation
public boolean testAllocation()Test Allocation (and set paid flag)- Returns:
- true if updated IsPaid
-
setIsPaid
Set Paid Flag for invoices- Parameters:
ctx
- contextC_BPartner_ID
- if 0 alltrxName
- transaction
-
getOpenAmt
Get Open Amount.- Returns:
- Open Amount
-
getOpenAmt
- Parameters:
creditMemoAdjusted
-paymentDate
-- Returns:
- Open Amount
-
getOpenAmt
Get Open Amount- Parameters:
creditMemoAdjusted
- true to negate return amountpaymentDate
- Payment Date- Returns:
- Open Amt
-
getOpenAmt
Get open amt depending on payment date- Parameters:
paymentDate
-- Returns:
- open Amt
-
getDiscountAmt
Get discount amt depending on payment date- Parameters:
paymentDate
-- Returns:
- discount Amt
-
getDocStatusName
Get Document Status Name- Returns:
- Document Status Name
-
createPDF
Create PDF -
createPDF
Create PDF file- Parameters:
file
- output file- Returns:
- file if success
-
getPDFFileName
Get PDF File Name- Parameters:
documentDir
- directory- Returns:
- file name
-
getCurrencyISO
Get ISO Code of Currency- Returns:
- Currency ISO
-
getPrecision
public int getPrecision()Get Currency Precision- Returns:
- precision
-
processIt
Process document -
unlockIt
public boolean unlockIt()Unlock Document. -
invalidateIt
public boolean invalidateIt()Invalidate Document- Specified by:
invalidateIt
in interfaceDocAction
- Returns:
- true if success
-
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
Complete Document- Specified by:
completeIt
in interfaceDocAction
- Returns:
- new status (Complete, In Progress, Invalid, Waiting ..)
-
getDocsPostProcess
- Specified by:
getDocsPostProcess
in 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:
reverseCorrectIt
in interfaceDocAction
- Returns:
- true if success
-
reverseAccrualIt
public boolean reverseAccrualIt()Reverse Accrual - use current date- Specified by:
reverseAccrualIt
in interfaceDocAction
- Returns:
- false
-
reActivateIt
public boolean reActivateIt()Re-activate- Specified by:
reActivateIt
in interfaceDocAction
- Returns:
- false
-
getSummary
Get Summary- Specified by:
getSummary
in interfaceDocAction
- Returns:
- Summary of Document
-
getProcessMsg
Get Process Message- Specified by:
getProcessMsg
in interfaceDocAction
- Returns:
- clear text error message
-
getDoc_User_ID
public int getDoc_User_ID()Get Document Owner (Responsible)- Specified by:
getDoc_User_ID
in interfaceDocAction
- Returns:
- AD_User_ID
-
getApprovalAmt
Get Document Approval Amount- Specified by:
getApprovalAmt
in interfaceDocAction
- Returns:
- amount
-
setRMA
- Parameters:
rma
-
-
isComplete
public boolean isComplete()Document Status is Complete or Closed- Returns:
- true if CO, CL or RE
-
getOriginalOrder
Get original order- Returns:
- order
-
setProcessMessage
Set process message- Parameters:
processMsg
-
-
getTaxProviders
Get tax providers- Returns:
- array of tax provider
-
getDocTypeID
public int getDocTypeID()Get C_DocType_ID (or C_DocTypeTarget_ID if C_DocType_ID is not set)- Returns:
- C_DocType_ID
-
getUnpaidInvoiceData
public static Vector<Vector<Object>> getUnpaidInvoiceData(boolean isMultiCurrency, Timestamp date, int AD_Org_ID, int C_Currency_ID, int C_BPartner_ID, String trxName) Get unpaid invoices- Parameters:
isMultiCurrency
- false to apply currency filterdate
- invoice open amount as at dateAD_Org_ID
- 0 for all orgsC_Currency_ID
- mandatory, use as invoice document filter if isMultiCurrency is falseC_BPartner_ID
- mandatory bpartner filtertrxName
- optional trx name- Returns:
- list of unpaid invoice data
-
createLineFrom
public void createLineFrom(int C_OrderLine_ID, int M_InOutLine_ID, int M_RMALine_ID, int M_Product_ID, int C_UOM_ID, BigDecimal Qty) Create Line from orderline/inoutline/rmaline- Parameters:
C_OrderLine_ID
-M_InOutLine_ID
-M_RMALine_ID
-M_Product_ID
-C_UOM_ID
-Qty
-
-
updateFrom
Update from order- Parameters:
order
-
-