Package org.compiere.model
Class MPayment
java.lang.Object
org.compiere.model.PO
org.compiere.model.X_C_Payment
org.compiere.model.MPayment
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparator<Object>
,I_C_Payment
,I_Persistent
,PaymentInterface
,DocAction
,IDocsPostProcess
,ProcessCall
,Evaluatee
public class MPayment
extends X_C_Payment
implements DocAction, ProcessCall, PaymentInterface, IDocsPostProcess
Payment Model.
- Version:
- $Id: MPayment.java,v 1.4 2006/10/02 05:18:39 jjanke Exp $
- Author:
- Jorg Janke, victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
- FR [ 1948157 ] Is necessary the reference for document reverse, Carlos Ruiz - globalqss [ 2141475 ] Payment <> allocations must not be completed - implement lots of validations on prepareIt
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
Error Messageprotected MAllocationHdr
protected boolean
Just Prepared Flagprotected MBankAccountProcessor
Temporary Bank Account Processorprotected MBankAccountProcessor[]
Temporary Bank Account Processorsprotected String
Process Messageprotected IProcessUI
static String
Reversal Indicatorprotected static CLogger
Loggerstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
Index constants for Vectorstatic final int
static final int
static final int
static final int
Fields inherited from class org.compiere.model.X_C_Payment
CREDITCARDTYPE_AD_Reference_ID, CREDITCARDTYPE_Amex, CREDITCARDTYPE_ATM, CREDITCARDTYPE_Diners, CREDITCARDTYPE_Discover, CREDITCARDTYPE_MasterCard, CREDITCARDTYPE_PurchaseCard, CREDITCARDTYPE_Visa, 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, R_AVSADDR_AD_Reference_ID, R_AVSADDR_Match, R_AVSADDR_NoMatch, R_AVSADDR_Unavailable, R_AVSZIP_AD_Reference_ID, R_AVSZIP_Match, R_AVSZIP_NoMatch, R_AVSZIP_Unavailable, TENDERTYPE_Account, TENDERTYPE_AD_Reference_ID, TENDERTYPE_Cash, TENDERTYPE_Check, TENDERTYPE_CreditCard, TENDERTYPE_DirectDebit, TENDERTYPE_DirectDeposit, TRXTYPE_AD_Reference_ID, TRXTYPE_Authorization, TRXTYPE_CreditPayment, TRXTYPE_DelayedCapture, TRXTYPE_Sales, TRXTYPE_VoiceAuthorization, TRXTYPE_Void
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_Payment
accessLevel, COLUMNNAME_A_City, COLUMNNAME_A_Country, COLUMNNAME_A_EMail, COLUMNNAME_A_Ident_DL, COLUMNNAME_A_Ident_SSN, COLUMNNAME_A_Name, COLUMNNAME_A_State, COLUMNNAME_A_Street, COLUMNNAME_A_Zip, COLUMNNAME_AccountNo, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_C_Activity_ID, COLUMNNAME_C_BankAccount_ID, COLUMNNAME_C_BankTransfer_ID, COLUMNNAME_C_BP_BankAccount_ID, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_Campaign_ID, COLUMNNAME_C_CashBook_ID, COLUMNNAME_C_Charge_ID, COLUMNNAME_C_ConversionType_ID, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_DepositBatch_ID, COLUMNNAME_C_DocType_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_Order_ID, COLUMNNAME_C_Payment_ID, COLUMNNAME_C_Payment_UU, COLUMNNAME_C_PaymentBatch_ID, COLUMNNAME_C_PaymentProcessor_ID, COLUMNNAME_C_POSTenderType_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_ChargeAmt, COLUMNNAME_CheckNo, COLUMNNAME_ConvertedAmt, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_CreditCardExpMM, COLUMNNAME_CreditCardExpYY, COLUMNNAME_CreditCardNumber, COLUMNNAME_CreditCardType, COLUMNNAME_CreditCardVV, COLUMNNAME_CurrencyRate, COLUMNNAME_CustomerAddressID, COLUMNNAME_CustomerPaymentProfileID, COLUMNNAME_CustomerProfileID, COLUMNNAME_DateAcct, COLUMNNAME_DateTrx, COLUMNNAME_Description, COLUMNNAME_DiscountAmt, COLUMNNAME_DocAction, COLUMNNAME_DocStatus, COLUMNNAME_DocumentNo, COLUMNNAME_IBAN, COLUMNNAME_IsActive, COLUMNNAME_IsAllocated, COLUMNNAME_IsApproved, COLUMNNAME_IsDelayedCapture, COLUMNNAME_IsOnline, COLUMNNAME_IsOverrideCurrencyRate, COLUMNNAME_IsOverUnderPayment, COLUMNNAME_IsPrepayment, COLUMNNAME_IsReceipt, COLUMNNAME_IsReconciled, COLUMNNAME_IsSelfService, COLUMNNAME_IsVoided, COLUMNNAME_Micr, COLUMNNAME_OProcessing, COLUMNNAME_Orig_TrxID, COLUMNNAME_OverUnderAmt, COLUMNNAME_PayAmt, COLUMNNAME_PONum, COLUMNNAME_Posted, COLUMNNAME_Processed, COLUMNNAME_ProcessedOn, COLUMNNAME_Processing, COLUMNNAME_R_AuthCode, COLUMNNAME_R_AuthCode_DC, COLUMNNAME_R_AvsAddr, COLUMNNAME_R_AvsZip, COLUMNNAME_R_CVV2Match, COLUMNNAME_R_Info, COLUMNNAME_R_PnRef, COLUMNNAME_R_PnRef_DC, COLUMNNAME_R_RespMsg, COLUMNNAME_R_Result, COLUMNNAME_R_VoidMsg, COLUMNNAME_Ref_Payment_ID, COLUMNNAME_Reversal_ID, COLUMNNAME_RoutingNo, COLUMNNAME_SwiftCode, COLUMNNAME_Swipe, COLUMNNAME_TaxAmt, COLUMNNAME_TenderType, COLUMNNAME_TrxType, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, COLUMNNAME_VoiceAuthCode, COLUMNNAME_WriteOffAmt, Model, Table_ID, Table_Name
-
Constructor Summary
ConstructorDescriptionMPayment
(Properties ctx, int C_Payment_ID, String trxName) Default ConstructorMPayment
(Properties ctx, String C_Payment_UU, String trxName) UUID based ConstructorMPayment
(Properties ctx, ResultSet rs, String trxName) Load Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescription
(String description) Add to Descriptionprotected void
addDocsPostProcess
(PO doc) Add document for processing after document actionprotected boolean
Allocate to single AP/AR Invoiceboolean
Allocate this payment.
Only call this when there is NO allocations (MAllocationHdr and MAllocationLine) as it will create duplicates.
If an invoice exists, it will allocates that, otherwise it will allocates to Payment Selection.protected boolean
Allocate to Payment Selectionboolean
Approve Documentprotected boolean
beforeSave
(boolean newRecord) Before Saveboolean
closeIt()
Close Document.Complete Documentprotected MPayment
Create Counter DocumentcreatePaymentTransaction
(String trxName) Create online payment transactionCreate PDFCreate PDF fileprotected void
deAllocate
(boolean accrual) Deallocate Payment.Get Allocated Amt in Payment CurrencyGet Document Approval Amountprotected int
Get Bank Statement Line of payment or 0static int[]
getCompletedPaymentIDs
(int C_Order_ID, int C_Invoice_ID, String trxName) Get ids of completed credit card paymentgetCreditCardExp
(String delimiter) CreditCard Exp MMYYGet Name of Credit Card TypegetCreditCardName
(String CreditCardType) Get Name of Credit Card Typeprotected ValueNamePair
getCreditCardPair
(String CreditCardType) Get Type and name pairGet Accepted Credit Cards for PayAmt (default 0)getCreditCards
(BigDecimal amt) Get Accepted Credit Cards for amountGet ISO Code of Currencyint
Get Document Owner (Responsible)Get Document Status NameGet Document InfoGet Error MessagegetLinhaAlocacao
(Integer cPayment_ID) static MPayment[]
getOfBankTransfer
(Properties ctx, int C_BankTransfer_ID, String trxName) Get Payments of Bank Transferstatic MPayment[]
getOfBPartner
(Properties ctx, int C_BPartner_ID, String trxName) Get Payments Of BPartnergetPayAmt
(boolean absolute) Get Pay Amtint
Get Pay Amt in centsgetPO()
Get Persistent ObjectGet Process MessageGet SummarygetUnAllocatedPaymentData
(int C_BPartner_ID, int C_Currency_ID, boolean isMultiCurrency, Timestamp date, int AD_Org_ID, String trxName) boolean
Invalidate Documentboolean
Is Cashbook Trxboolean
Is Cash Trxboolean
Document Status is Complete or ClosedPrepare Documentboolean
Process documentboolean
Execute online processing of paymentboolean
Re-activateboolean
rejectIt()
Reject Approvalvoid
resetNew()
Reset Payment to new statusprotected StringBuilder
reverse
(boolean accrual) Reverse this paymentboolean
Reverse Accrualboolean
Reverse Correctionboolean
Save Info to BP Bank Accountvoid
setAccountAddress
(String name, String street, String city, String state, String zip, String country) Set Account Addressvoid
setAccountNo
(String AccountNo) Bank Account Novoid
setAmount
(int C_Currency_ID, BigDecimal payAmt) Set Payment Amount and Currencyvoid
setBankAccountDetails
(int C_BankAccount_ID) Set Bank Account Details.boolean
setBankACH
(int C_BankAccount_ID, boolean isReceipt, String tenderType, String routingNo, String accountNo) Set ACH BankAccount Infoboolean
setBankACH
(MPaySelectionCheck preparedPayment) Set ACH BankAccount Infoboolean
setBankCash
(int C_BankAccount_ID, boolean isReceipt, String tenderType) Set Cash BankAccount Infoboolean
setBankCheck
(int C_BankAccount_ID, boolean isReceipt, String checkNo) Set Check BankAccount Infoboolean
setBankCheck
(int C_BankAccount_ID, boolean isReceipt, String routingNo, String accountNo, String checkNo) Set Check BankAccount Infovoid
Set Info from BP Bank Accountvoid
setC_BankAccount_ID
(int C_BankAccount_ID) Set Bank Account for Payment.protected void
Set Doc Type bases on IsReceiptvoid
setC_DocType_ID
(boolean isReceipt) Set Doc Typevoid
setC_DocType_ID
(int C_DocType_ID) Set Document Typevoid
setCheckNo
(String CheckNo) Check Noboolean
setCreditCard
(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY) Set Credit Card details.boolean
setCreditCard
(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) Set Credit Card details.boolean
setCreditCardExp
(String mmyy) Set CreditCard Exp MMYYvoid
setCreditCardExpMM
(int CreditCardExpMM) Set Two Digit CreditCard MMvoid
setCreditCardExpYY
(int newCreditCardExpYY) Set Two digit CreditCard YY (til 2020)void
setCreditCardNumber
(String CreditCardNumber) Set Credit Card Number.void
setCreditCardVV
(String newCreditCardVV) Set Verification Codeprotected void
Set the definite document number after completedvoid
setDiscountAmt
(BigDecimal DiscountAmt) Discount Amtprotected void
Derive DocumentNo from Payment info.void
setErrorMessage
(String errorMessage) Set Error Messagestatic void
setIsAllocated
(Properties ctx, int C_BPartner_ID, String trxName) Set Allocated Flag for paymentsvoid
MICRvoid
setOverUnderAmt
(BigDecimal OverUnderAmt) OverUnder Amtvoid
setPayAmt
(BigDecimal PayAmt) Set Payment Amountboolean
Set BankAccount and PaymentProcessorboolean
setPaymentProcessor
(String tender, String CCType, int C_PaymentProcessor_ID) Find and Set BankAccount and PaymentProcessorvoid
setProcessUI
(IProcessUI processMonitor) void
setR_PnRef
(String R_PnRef) Set Reference No (and Document No)void
setRoutingNo
(String RoutingNo) Routing Novoid
setTaxAmt
(BigDecimal TaxAmt) Tax Amtvoid
setWriteOffAmt
(BigDecimal WriteOffAmt) WriteOff Amtboolean
startProcess
(Properties ctx, ProcessInfo pi, Trx trx) Execute online processing of payment (delegate toprocessOnline()
).boolean
Test Allocation (and set allocated flag)toString()
String Representationboolean
unlockIt()
Unlock Document.protected boolean
verifyDocType
(MPaymentAllocate[] pAllocs) Verify Document Type with Invoiceprotected boolean
verifyPaymentAllocateSum
(MPaymentAllocate[] pAllocs) Verify Payment Allocate Sum must be equal to the Payment Amountprotected boolean
verifyPaymentAllocateVsHeader
(MPaymentAllocate[] pAllocs) Verify that payment has no Payment Allocate records if the payment header has charge/invoice/order.boolean
voidIt()
Void Document.protected boolean
Methods inherited from class org.compiere.model.X_C_Payment
get_AccessLevel, getA_City, getA_Country, getA_EMail, getA_Ident_DL, getA_Ident_SSN, getA_Name, getA_State, getA_Street, getA_Zip, getAccountNo, getAD_OrgTrx_ID, getC_Activity, getC_Activity_ID, getC_BankAccount, getC_BankAccount_ID, getC_BankTransfer, getC_BankTransfer_ID, getC_BP_BankAccount, getC_BP_BankAccount_ID, getC_BPartner, getC_BPartner_ID, getC_Campaign, getC_Campaign_ID, getC_CashBook, getC_CashBook_ID, getC_Charge, getC_Charge_ID, getC_ConversionType, getC_ConversionType_ID, getC_Currency, getC_Currency_ID, getC_DepositBatch, getC_DepositBatch_ID, getC_DocType, getC_DocType_ID, getC_Invoice, getC_Invoice_ID, getC_Order, getC_Order_ID, getC_Payment_ID, getC_Payment_UU, getC_PaymentBatch, getC_PaymentBatch_ID, getC_PaymentProcessor, getC_PaymentProcessor_ID, getC_POSTenderType, getC_POSTenderType_ID, getC_Project, getC_Project_ID, getChargeAmt, getCheckNo, getConvertedAmt, getCreditCardExpMM, getCreditCardExpYY, getCreditCardNumber, getCreditCardType, getCreditCardVV, getCurrencyRate, getCustomerAddressID, getCustomerPaymentProfileID, getCustomerProfileID, getDateAcct, getDateTrx, getDescription, getDiscountAmt, getDocAction, getDocStatus, getDocumentNo, getIBAN, getKeyNamePair, getMicr, getOProcessing, getOrig_TrxID, getOverUnderAmt, getPayAmt, getPONum, getProcessedOn, getR_AuthCode, getR_AuthCode_DC, getR_AvsAddr, getR_AvsZip, getR_Info, getR_PnRef, getR_PnRef_DC, getR_RespMsg, getR_Result, getR_VoidMsg, getRef_Payment, getRef_Payment_ID, getReversal, getReversal_ID, getRoutingNo, getSwiftCode, getSwipe, getTaxAmt, getTenderType, getTrxType, getUser1, getUser1_ID, getUser2, getUser2_ID, getVoiceAuthCode, getWriteOffAmt, initPO, isAllocated, isApproved, isDelayedCapture, isOnline, isOverrideCurrencyRate, isOverUnderPayment, isPosted, isPrepayment, isProcessed, isProcessing, isR_CVV2Match, isReceipt, isReconciled, isSelfService, isVoided, setA_City, setA_Country, setA_EMail, setA_Ident_DL, setA_Ident_SSN, setA_Name, setA_State, setA_Street, setA_Zip, setAD_OrgTrx_ID, setC_Activity_ID, setC_BankTransfer_ID, setC_BP_BankAccount_ID, setC_BPartner_ID, setC_Campaign_ID, setC_CashBook_ID, setC_Charge_ID, setC_ConversionType_ID, setC_Currency_ID, setC_DepositBatch_ID, setC_Invoice_ID, setC_Order_ID, setC_Payment_ID, setC_Payment_UU, setC_PaymentBatch_ID, setC_PaymentProcessor_ID, setC_POSTenderType_ID, setC_Project_ID, setChargeAmt, setConvertedAmt, setCreditCardType, setCurrencyRate, setCustomerAddressID, setCustomerPaymentProfileID, setCustomerProfileID, setDateAcct, setDateTrx, setDescription, setDocAction, setDocStatus, setDocumentNo, setIBAN, setIsAllocated, setIsApproved, setIsDelayedCapture, setIsOnline, setIsOverrideCurrencyRate, setIsOverUnderPayment, setIsPrepayment, setIsReceipt, setIsReconciled, setIsSelfService, setIsVoided, setOProcessing, setOrig_TrxID, setPONum, setPosted, setProcessed, setProcessedOn, setProcessing, setR_AuthCode, setR_AuthCode_DC, setR_AvsAddr, setR_AvsZip, setR_CVV2Match, setR_Info, setR_PnRef_DC, setR_RespMsg, setR_Result, setR_VoidMsg, setRef_Payment_ID, setReversal_ID, setSwiftCode, setSwipe, setTenderType, setTrxType, setUser1_ID, setUser2_ID, setVoiceAuthCode
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, 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, 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_Payment
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
Methods inherited from interface org.compiere.model.PaymentInterface
getA_City, getA_Country, getA_EMail, getA_Ident_DL, getA_Ident_SSN, getA_Name, getA_State, getA_Street, getA_Zip, getAccountNo, getC_BankAccount, getC_BankAccount_ID, getC_BP_BankAccount, getC_BP_BankAccount_ID, getC_BPartner, getC_BPartner_ID, getC_ConversionType, getC_ConversionType_ID, getC_Currency, getC_Currency_ID, getC_Invoice, getC_Invoice_ID, getC_Order, getC_Order_ID, getC_PaymentProcessor, getC_PaymentProcessor_ID, getC_POSTenderType, getC_POSTenderType_ID, getCheckNo, getCreditCardExpMM, getCreditCardExpYY, getCreditCardNumber, getCreditCardType, getCreditCardVV, getCustomerAddressID, getCustomerPaymentProfileID, getCustomerProfileID, getDateTrx, getDescription, getMicr, getOrig_TrxID, getPayAmt, getPONum, getR_AuthCode, getR_AvsAddr, getR_AvsZip, getR_Info, getR_PnRef, getR_RespMsg, getR_Result, getR_VoidMsg, getRoutingNo, getTaxAmt, getTenderType, getTrxType, getVoiceAuthCode, isApproved, isDelayedCapture, isOnline, isProcessed, isR_CVV2Match, isReceipt, isSelfService, isVoided, setA_City, setA_Country, setA_EMail, setA_Ident_DL, setA_Ident_SSN, setA_Name, setA_State, setA_Street, setA_Zip, setC_BP_BankAccount_ID, setC_BPartner_ID, setC_ConversionType_ID, setC_Currency_ID, setC_Invoice_ID, setC_Order_ID, setC_PaymentProcessor_ID, setC_POSTenderType_ID, setCreditCardType, setCustomerAddressID, setCustomerPaymentProfileID, setCustomerProfileID, setDateTrx, setDescription, setIsApproved, setIsDelayedCapture, setIsOnline, setIsReceipt, setIsSelfService, setIsVoided, setOrig_TrxID, setPONum, setProcessed, setR_AuthCode, setR_AvsAddr, setR_AvsZip, setR_CVV2Match, setR_Info, setR_RespMsg, setR_Result, setR_VoidMsg, setTenderType, setTrxType, setVoiceAuthCode
-
Field Details
-
m_mBankAccountProcessors
Temporary Bank Account Processors -
m_mBankAccountProcessor
Temporary Bank Account Processor -
s_log
Logger -
m_errorMessage
Error Message -
REVERSE_INDICATOR
Reversal Indicator -
m_processMsg
Process Message -
m_justPrepared
protected boolean m_justPreparedJust Prepared Flag -
m_processUI
-
docsPostProcess
-
m_justCreatedAllocInv
-
UNALLOCATED_PAYMENT_SELECTED
public static final int UNALLOCATED_PAYMENT_SELECTEDIndex constants for Vector- See Also:
-
UNALLOCATED_PAYMENT_TRX_DATE
public static final int UNALLOCATED_PAYMENT_TRX_DATE- See Also:
-
UNALLOCATED_PAYMENT_DOCUMENT_KEY_NAME_PAIR
public static final int UNALLOCATED_PAYMENT_DOCUMENT_KEY_NAME_PAIR- See Also:
-
UNALLOCATED_PAYMENT_MULTI_CURRENCY_ISO
public static final int UNALLOCATED_PAYMENT_MULTI_CURRENCY_ISO- See Also:
-
UNALLOCATED_PAYMENT_MULTI_CURRENCY_PAYMENT_AMT
public static final int UNALLOCATED_PAYMENT_MULTI_CURRENCY_PAYMENT_AMT- See Also:
-
UNALLOCATED_PAYMENT_MULTI_CURRENCY_CONVERTED_AMT
public static final int UNALLOCATED_PAYMENT_MULTI_CURRENCY_CONVERTED_AMT- See Also:
-
UNALLOCATED_PAYMENT_MULTI_CURRENCY_OPEN_AMT
public static final int UNALLOCATED_PAYMENT_MULTI_CURRENCY_OPEN_AMT- See Also:
-
UNALLOCATED_PAYMENT_MULTI_CURRENCY_APPLIED_AMT
public static final int UNALLOCATED_PAYMENT_MULTI_CURRENCY_APPLIED_AMT- See Also:
-
UNALLOCATED_PAYMENT_SINGLE_CURRENCY_AMT
public static final int UNALLOCATED_PAYMENT_SINGLE_CURRENCY_AMT- See Also:
-
UNALLOCATED_PAYMENT_SINGLE_CURRENCY_OPEN_AMT
public static final int UNALLOCATED_PAYMENT_SINGLE_CURRENCY_OPEN_AMT- See Also:
-
UNALLOCATED_PAYMENT_SINGLE_CURRENCY_APPLIED_AMT
public static final int UNALLOCATED_PAYMENT_SINGLE_CURRENCY_APPLIED_AMT- See Also:
-
-
Constructor Details
-
MPayment
UUID based Constructor- Parameters:
ctx
- ContextC_Payment_UU
- UUID keytrxName
- Transaction
-
MPayment
Default Constructor- Parameters:
ctx
- contextC_Payment_ID
- payment to load, (0 create new payment)trxName
- trx name
-
MPayment
Load Constructor- Parameters:
ctx
- contextrs
- result set recordtrxName
- transaction
-
-
Method Details
-
getOfBPartner
Get Payments Of BPartner- Parameters:
ctx
- contextC_BPartner_ID
- idtrxName
- transaction- Returns:
- array of payment
-
getOfBankTransfer
Get Payments of Bank Transfer- Parameters:
ctx
- contextC_BankTransfer_ID
- idtrxName
- transaction- Returns:
- array of payment
-
resetNew
public void resetNew()Reset Payment to new status -
isCashTrx
public boolean isCashTrx()Is Cash Trx- Returns:
- true if Cash Trx
-
isCashbookTrx
public boolean isCashbookTrx()Is Cashbook Trx- Returns:
- true if this is a cashbook trx
-
setCreditCard
public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY) Set Credit Card details. Need to set PatmentProcessor after Amount/Currency Set.- Parameters:
TrxType
- Transaction Type see TRX_creditCardType
- CC typecreditCardNumber
- CC numbercreditCardVV
- CC verificationcreditCardExpMM
- CC Exp MMcreditCardExpYY
- CC Exp YY- Returns:
- true if valid
-
setCreditCard
public boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) Set Credit Card details. Need to set PatmentProcessor after Amount/Currency Set.- Parameters:
TrxType
- Transaction Type see TRX_creditCardType
- CC typecreditCardNumber
- CC numbercreditCardVV
- CC verificationcreditCardExp
- CC Exp (include both year and month)- Returns:
- true if valid
-
setBankACH
Set ACH BankAccount Info- Parameters:
preparedPayment
-- Returns:
- true if valid
-
setBankACH
public boolean setBankACH(int C_BankAccount_ID, boolean isReceipt, String tenderType, String routingNo, String accountNo) Set ACH BankAccount Info- Parameters:
C_BankAccount_ID
- bank accountisReceipt
- true if receipttenderType
- - Direct Debit or Direct DepositroutingNo
- routingaccountNo
- account- Returns:
- true if valid
-
setBankCash
Set Cash BankAccount Info- Parameters:
C_BankAccount_ID
- bank accountisReceipt
- true if receipttenderType
- - Cash (Payment)- Returns:
- true if valid
-
setBankCheck
Set Check BankAccount Info- Parameters:
C_BankAccount_ID
- bank accountisReceipt
- true if receiptcheckNo
- check no- Returns:
- true if valid
-
setBankCheck
public boolean setBankCheck(int C_BankAccount_ID, boolean isReceipt, String routingNo, String accountNo, String checkNo) Set Check BankAccount Info- Parameters:
C_BankAccount_ID
- bank accountisReceipt
- true if receiptroutingNo
- routing noaccountNo
- account nocheckNo
- check no- Returns:
- true if valid
-
setBankAccountDetails
public void setBankAccountDetails(int C_BankAccount_ID) Set Bank Account Details. Look up Routing No and Bank Acct No- Parameters:
C_BankAccount_ID
- bank account
-
setAccountAddress
public void setAccountAddress(String name, String street, String city, String state, String zip, String country) Set Account Address- Parameters:
name
- namestreet
- streetcity
- citystate
- statezip
- zipcountry
- country
-
processOnline
public boolean processOnline()Execute online processing of payment- Returns:
- true if approved
-
startProcess
Execute online processing of payment (delegate toprocessOnline()
).- Specified by:
startProcess
in interfaceProcessCall
- Parameters:
ctx
- Contextpi
- Process Infotrx
- transaction- Returns:
- true if the next process should be performed
-
beforeSave
protected boolean beforeSave(boolean newRecord) Before Save- Overrides:
beforeSave
in classPO
- Parameters:
newRecord
- new- Returns:
- save
-
isComplete
public boolean isComplete()Document Status is Complete or Closed- Returns:
- true if CO, CL or RE
-
getAllocatedAmt
Get Allocated Amt in Payment Currency- Returns:
- allocated amount or null
-
testAllocation
public boolean testAllocation()Test Allocation (and set allocated flag)- Returns:
- true if IsAllocated updated
-
setIsAllocated
Set Allocated Flag for payments- Parameters:
ctx
- contextC_BPartner_ID
- if 0 alltrxName
- trx
-
setErrorMessage
Set Error Message- Parameters:
errorMessage
- error message
-
getErrorMessage
Get Error Message- Returns:
- error message
-
setC_BankAccount_ID
public void setC_BankAccount_ID(int C_BankAccount_ID) Set Bank Account for Payment.- Specified by:
setC_BankAccount_ID
in interfaceI_C_Payment
- Specified by:
setC_BankAccount_ID
in interfacePaymentInterface
- Overrides:
setC_BankAccount_ID
in classX_C_Payment
- Parameters:
C_BankAccount_ID
- C_BankAccount_ID
-
setPaymentProcessor
public boolean setPaymentProcessor()Set BankAccount and PaymentProcessor- Returns:
- true if found
-
setPaymentProcessor
Find and Set BankAccount and PaymentProcessor- Parameters:
tender
- TenderType see TENDER_CCType
- CC Type see CC_- Returns:
- true if found
-
getCreditCards
Get Accepted Credit Cards for PayAmt (default 0)- Returns:
- credit cards
-
getCreditCards
Get Accepted Credit Cards for amount- Parameters:
amt
- trx amount- Returns:
- credit cards
-
getCreditCardPair
Get Type and name pair- Parameters:
CreditCardType
- credit card Type- Returns:
- ValueNamePair (CreditCardType, Name)
-
setCreditCardNumber
Set Credit Card Number.- Specified by:
setCreditCardNumber
in interfaceI_C_Payment
- Specified by:
setCreditCardNumber
in interfacePaymentInterface
- Overrides:
setCreditCardNumber
in classX_C_Payment
- Parameters:
CreditCardNumber
- CreditCard Number
-
setCreditCardVV
Set Verification Code- Specified by:
setCreditCardVV
in interfaceI_C_Payment
- Specified by:
setCreditCardVV
in interfacePaymentInterface
- Overrides:
setCreditCardVV
in classX_C_Payment
- Parameters:
newCreditCardVV
- CC verification
-
setCreditCardExpMM
public void setCreditCardExpMM(int CreditCardExpMM) Set Two Digit CreditCard MM- Specified by:
setCreditCardExpMM
in interfaceI_C_Payment
- Specified by:
setCreditCardExpMM
in interfacePaymentInterface
- Overrides:
setCreditCardExpMM
in classX_C_Payment
- Parameters:
CreditCardExpMM
- Exp month
-
setCreditCardExpYY
public void setCreditCardExpYY(int newCreditCardExpYY) Set Two digit CreditCard YY (til 2020)- Specified by:
setCreditCardExpYY
in interfaceI_C_Payment
- Specified by:
setCreditCardExpYY
in interfacePaymentInterface
- Overrides:
setCreditCardExpYY
in classX_C_Payment
- Parameters:
newCreditCardExpYY
- 2 or 4 digit year
-
setCreditCardExp
Set CreditCard Exp MMYY- Parameters:
mmyy
- Exp in form of mmyy- Returns:
- true if valid
-
getCreditCardExp
CreditCard Exp MMYY- Parameters:
delimiter
- / - or null- Returns:
- Exp (mm + delimiter + yy)
-
setMicr
MICR- Specified by:
setMicr
in interfaceI_C_Payment
- Specified by:
setMicr
in interfacePaymentInterface
- Overrides:
setMicr
in classX_C_Payment
- Parameters:
MICR
- MICR
-
setRoutingNo
Routing No- Specified by:
setRoutingNo
in interfaceI_C_Payment
- Specified by:
setRoutingNo
in interfacePaymentInterface
- Overrides:
setRoutingNo
in classX_C_Payment
- Parameters:
RoutingNo
- Routing No
-
setAccountNo
Bank Account No- Specified by:
setAccountNo
in interfaceI_C_Payment
- Specified by:
setAccountNo
in interfacePaymentInterface
- Overrides:
setAccountNo
in classX_C_Payment
- Parameters:
AccountNo
- AccountNo
-
setCheckNo
Check No- Specified by:
setCheckNo
in interfaceI_C_Payment
- Specified by:
setCheckNo
in interfacePaymentInterface
- Overrides:
setCheckNo
in classX_C_Payment
- Parameters:
CheckNo
- Check No
-
setDocumentNo
protected void setDocumentNo()Derive DocumentNo from Payment info. If there is a R_PnRef, take R_PnRef as DocumentNo. -
setR_PnRef
Set Reference No (and Document No)- Specified by:
setR_PnRef
in interfaceI_C_Payment
- Specified by:
setR_PnRef
in interfacePaymentInterface
- Overrides:
setR_PnRef
in classX_C_Payment
- Parameters:
R_PnRef
- reference
-
setPayAmt
Set Payment Amount- Specified by:
setPayAmt
in interfaceI_C_Payment
- Specified by:
setPayAmt
in interfacePaymentInterface
- Overrides:
setPayAmt
in classX_C_Payment
- Parameters:
PayAmt
- Pay Amt
-
setAmount
Set Payment Amount and Currency- Parameters:
C_Currency_ID
- currencypayAmt
- amount
-
setDiscountAmt
Discount Amt- Specified by:
setDiscountAmt
in interfaceI_C_Payment
- Overrides:
setDiscountAmt
in classX_C_Payment
- Parameters:
DiscountAmt
- Discount
-
setWriteOffAmt
WriteOff Amt- Specified by:
setWriteOffAmt
in interfaceI_C_Payment
- Overrides:
setWriteOffAmt
in classX_C_Payment
- Parameters:
WriteOffAmt
- WriteOff
-
setOverUnderAmt
OverUnder Amt- Specified by:
setOverUnderAmt
in interfaceI_C_Payment
- Overrides:
setOverUnderAmt
in classX_C_Payment
- Parameters:
OverUnderAmt
- OverUnder
-
setTaxAmt
Tax Amt- Specified by:
setTaxAmt
in interfaceI_C_Payment
- Specified by:
setTaxAmt
in interfacePaymentInterface
- Overrides:
setTaxAmt
in classX_C_Payment
- Parameters:
TaxAmt
- Tax
-
setBP_BankAccount
Set Info from BP Bank Account- Parameters:
ba
- BP bank account
-
saveToBP_BankAccount
Save Info to BP Bank Account- Parameters:
ba
- BP bank account- Returns:
- true if saved
-
setC_DocType_ID
protected void setC_DocType_ID()Set Doc Type bases on IsReceipt -
setC_DocType_ID
public void setC_DocType_ID(boolean isReceipt) Set Doc Type- Parameters:
isReceipt
- true for receipt, false for payment
-
setC_DocType_ID
public void setC_DocType_ID(int C_DocType_ID) Set Document Type- Specified by:
setC_DocType_ID
in interfaceI_C_Payment
- Overrides:
setC_DocType_ID
in classX_C_Payment
- Parameters:
C_DocType_ID
- doc type
-
verifyDocType
Verify Document Type with Invoice- Parameters:
pAllocs
-- Returns:
- true if ok
-
verifyPaymentAllocateVsHeader
Verify that payment has no Payment Allocate records if the payment header has charge/invoice/order.- Parameters:
pAllocs
-- Returns:
- true if pAllocs is empty
-
verifyPaymentAllocateSum
Verify Payment Allocate Sum must be equal to the Payment Amount- Parameters:
pAllocs
-- Returns:
- true if ok
-
getCurrencyISO
Get ISO Code of Currency- Returns:
- Currency ISO code
-
getDocStatusName
Get Document Status Name- Returns:
- Document Status Name
-
getCreditCardName
Get Name of Credit Card Type- Returns:
- Name of Credit Card Type (Master, Visa, etc)
-
getCreditCardName
Get Name of Credit Card Type- Parameters:
CreditCardType
- credit card type- Returns:
- Name of Credit Card Type (Master, Visa, etc)
-
addDescription
Add to Description- Parameters:
description
- text
-
getPayAmt
Get Pay Amt- Parameters:
absolute
- ignore- Returns:
- pay amt if this is receipt, otherwise it return the negate of pay amt
-
getPayAmtInCents
public int getPayAmtInCents()Get Pay Amt in cents- Returns:
- amount in cents (multiply by 100 and truncate to integer)
-
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 -
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 ..)
-
addDocsPostProcess
Add document for processing after document action- Parameters:
doc
-
-
getDocsPostProcess
- Specified by:
getDocsPostProcess
in interfaceIDocsPostProcess
- Returns:
- List of doc to process after Complete
-
setDefiniteDocumentNo
protected void setDefiniteDocumentNo()Set the definite document number after completed -
createCounterDoc
Create Counter Document- Returns:
- payment
-
allocateIt
public boolean allocateIt()Allocate this payment.
Only call this when there is NO allocations (MAllocationHdr and MAllocationLine) as it will create duplicates.
If an invoice exists, it will allocates that, otherwise it will allocates to Payment Selection.- Returns:
- true if allocated
-
allocateInvoice
protected boolean allocateInvoice()Allocate to single AP/AR Invoice- Returns:
- true if allocated
-
allocatePaySelection
protected boolean allocatePaySelection()Allocate to Payment Selection- Returns:
- true if allocated
-
deAllocate
protected void deAllocate(boolean accrual) Deallocate Payment. Unlink Invoices and Orders and delete Allocations.- Parameters:
accrual
-
-
voidIt
public boolean voidIt()Void Document. -
closeIt
public boolean closeIt()Close Document. -
reverseCorrectIt
public boolean reverseCorrectIt()Reverse Correction- Specified by:
reverseCorrectIt
in interfaceDocAction
- Returns:
- true if success
-
reverse
Reverse this payment- Parameters:
accrual
- true to use current date, false to use this document's accounting date- Returns:
- process message or null if there's error
-
getC_BankStatementLine_ID
protected int getC_BankStatementLine_ID()Get Bank Statement Line of payment or 0- Returns:
- C_BankStatementLine_ID or 0
-
reverseAccrualIt
public boolean reverseAccrualIt()Reverse Accrual- Specified by:
reverseAccrualIt
in interfaceDocAction
- Returns:
- true if success
-
reActivateIt
public boolean reActivateIt()Re-activate- Specified by:
reActivateIt
in interfaceDocAction
- Returns:
- true if success
-
toString
String Representation- Overrides:
toString
in classX_C_Payment
- Returns:
- info
-
getDocumentInfo
Get Document Info- Specified by:
getDocumentInfo
in interfaceDocAction
- Returns:
- document info (untranslated)
-
createPDF
Create PDF -
createPDF
Create PDF file- Parameters:
file
- output file- Returns:
- not implemented, always return null
-
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 payment(AP) or write-off(AR)
-
setProcessUI
- Specified by:
setProcessUI
in interfaceProcessCall
-
createPaymentTransaction
Create online payment transaction- Parameters:
trxName
-- Returns:
- MPaymentTransaction
-
voidOnlinePayment
protected boolean voidOnlinePayment()- Returns:
- true if success
-
getPO
Description copied from interface:PaymentInterface
Get Persistent Object- Specified by:
getPO
in interfacePaymentInterface
- Returns:
- PO
-
getCompletedPaymentIDs
Get ids of completed credit card payment- Parameters:
C_Order_ID
-C_Invoice_ID
-trxName
-- Returns:
- array of C_Payment_ID
-
getJustCreatedAllocInv
- Returns:
- just created invoice allocation (inside
allocateInvoice()
)
-
getLinhaAlocacao
-
getUnAllocatedPaymentData
public static Vector<Vector<Object>> getUnAllocatedPaymentData(int C_BPartner_ID, int C_Currency_ID, boolean isMultiCurrency, Timestamp date, int AD_Org_ID, String trxName) - Parameters:
C_BPartner_ID
- mandatory bpartner filterC_Currency_ID
- 0 to use login currency. use for payment filter if isMultiCurrency=falseisMultiCurrency
- false to apply currency filterdate
- payment allocation as at dateAD_Org_ID
- 0 for all orgtrxName
- optional transaction name- Returns:
- list of unallocated payment records.
- Payment record: Boolean.False, DateTrx, KeyNamePair(C_Payment_ID,DocumentNo), Currency ISO_Code, PayAmt, Converted Amt,Open Amt, 0
- Without Currency ISO_Code and PayAmt if isMultiCurrency is false.
-