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. - retrieve and create payments for invoiceEvent chain - Payment inserted C_Payment_Trg fires update DocumentNo with payment summary - Payment posted (C_Payment_Post) create allocation line C_Allocation_Trg fires Update C_BPartner Open Item Amount update invoice (IsPaid) link invoice-payment if batch Lifeline: - Created by VPayment or directly - When changed in VPayment - old payment is reversed - new payment created When Payment is posed, the Allocation is made- 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_errorMessageError Messageprotected MAllocationHdrm_justCreatedAllocInvprotected booleanm_justPreparedJust Prepared Flagprotected MBankAccountProcessorm_mBankAccountProcessorTemporary Bank Account Processorprotected MBankAccountProcessor[]m_mBankAccountProcessorsTemporary Bank Account Processorsprotected Stringm_processMsgProcess Messageprotected IProcessUIm_processUIstatic StringREVERSE_INDICATORReversal Indicatorprotected static CLoggers_logLogger-
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, 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_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
Constructors Constructor Description MPayment(Properties ctx, int C_Payment_ID, String trxName)Default ConstructorMPayment(Properties ctx, ResultSet rs, String trxName)Load Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDescription(String description)Add to Descriptionprotected voidaddDocsPostProcess(PO doc)protected booleanallocateInvoice()Allocate single AP/AR InvoicebooleanallocateIt()Allocate It.protected booleanallocatePaySelection()Allocate Payment SelectionbooleanapproveIt()Approve Documentprotected booleanbeforeSave(boolean newRecord)Before SavebooleancloseIt()Close Document.StringcompleteIt()Complete Documentprotected MPaymentcreateCounterDoc()Create Counter DocumentMPaymentTransactioncreatePaymentTransaction(String trxName)FilecreatePDF()Create PDFFilecreatePDF(File file)Create PDF fileprotected voiddeAllocate(boolean accrual)De-allocate Payment.BigDecimalgetAllocatedAmt()Get Allocated Amt in Payment CurrencyBigDecimalgetApprovalAmt()Get Document Approval Amountprotected intgetC_BankStatementLine_ID()Get Bank Statement Line of payment or 0static int[]getCompletedPaymentIDs(int C_Order_ID, int C_Invoice_ID, String trxName)StringgetCreditCardExp(String delimiter)CreditCard Exp MMYYStringgetCreditCardName()Get Name of Credit CardStringgetCreditCardName(String CreditCardType)Get Name of Credit Cardprotected ValueNamePairgetCreditCardPair(String CreditCardType)Get Type and name pairValueNamePair[]getCreditCards()Get Accepted Credit Cards for PayAmt (default 0)ValueNamePair[]getCreditCards(BigDecimal amt)Get Accepted Credit Cards for amountStringgetCurrencyISO()Get ISO Code of CurrencyintgetDoc_User_ID()Get Document Owner (Responsible)List<PO>getDocsPostProcess()StringgetDocStatusName()Get Document StatusStringgetDocumentInfo()Get Document InfoStringgetErrorMessage()Get Error MessageMAllocationHdrgetJustCreatedAllocInv()static MPayment[]getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)Get Payments Of BPartnerBigDecimalgetPayAmt(boolean absolute)Get Pay AmtintgetPayAmtInCents()Get Pay Amt in centsPOgetPO()Get Persistent ObjectStringgetProcessMsg()Get Process MessageStringgetSummary()Get SummarybooleaninvalidateIt()Invalidate DocumentbooleanisCashbookTrx()Is Cashbook TrxbooleanisCashTrx()Is Cash TrxbooleanisComplete()Document Status is Complete or ClosedStringprepareIt()Prepare DocumentbooleanprocessIt(String processAction)Process documentbooleanprocessOnline()Process PaymentbooleanreActivateIt()Re-activatebooleanrejectIt()Reject ApprovalvoidresetNew()Reset Payment to new statusprotected StringBuilderreverse(boolean accrual)booleanreverseAccrualIt()Reverse Accrual - nonebooleanreverseCorrectIt()Reverse CorrectionbooleansaveToBP_BankAccount(MBPBankAccount ba)Save Info from BP Bank AccountvoidsetAccountAddress(String name, String street, String city, String state, String zip, String country)Set Account AddressvoidsetAccountNo(String AccountNo)Bank Account NovoidsetAmount(int C_Currency_ID, BigDecimal payAmt)Set Payment AmountvoidsetBankAccountDetails(int C_BankAccount_ID)Set Bank Account Details.booleansetBankACH(int C_BankAccount_ID, boolean isReceipt, String tenderType, String routingNo, String accountNo)Set ACH BankAccount InfobooleansetBankACH(MPaySelectionCheck preparedPayment)Set ACH BankAccount InfobooleansetBankCash(int C_BankAccount_ID, boolean isReceipt, String tenderType)Set Cash BankAccount InfobooleansetBankCheck(int C_BankAccount_ID, boolean isReceipt, String checkNo)Set Check BankAccount InfobooleansetBankCheck(int C_BankAccount_ID, boolean isReceipt, String routingNo, String accountNo, String checkNo)Set Check BankAccount InfovoidsetBP_BankAccount(MBPBankAccount ba)Set Info from BP Bank AccountvoidsetC_BankAccount_ID(int C_BankAccount_ID)Set Bank Account for Payment.protected voidsetC_DocType_ID()Set Doc Type bases on IsReceiptvoidsetC_DocType_ID(boolean isReceipt)Set Doc TypevoidsetC_DocType_ID(int C_DocType_ID)Set Document TypevoidsetCheckNo(String CheckNo)Check NobooleansetCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY)Set Credit Card.booleansetCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp)Set Credit Card - Exp.booleansetCreditCardExp(String mmyy)CreditCard Exp MMYYvoidsetCreditCardExpMM(int CreditCardExpMM)Two Digit CreditCard MMvoidsetCreditCardExpYY(int newCreditCardExpYY)Two digit CreditCard YY (til 2020)voidsetCreditCardNumber(String CreditCardNumber)Credit Card NumbervoidsetCreditCardVV(String newCreditCardVV)Verification Codeprotected voidsetDefiniteDocumentNo()Set the definite document number after completedvoidsetDiscountAmt(BigDecimal DiscountAmt)Discount Amtprotected voidsetDocumentNo()Set DocumentNo to Payment info.voidsetErrorMessage(String errorMessage)Set Error Messagestatic voidsetIsAllocated(Properties ctx, int C_BPartner_ID, String trxName)Set Allocated Flag for paymentsvoidsetMicr(String MICR)MICRvoidsetOverUnderAmt(BigDecimal OverUnderAmt)OverUnder AmtvoidsetPayAmt(BigDecimal PayAmt)Set Payment AmountbooleansetPaymentProcessor()Set BankAccount and PaymentProcessorbooleansetPaymentProcessor(String tender, String CCType, int C_PaymentProcessor_ID)Set BankAccount and PaymentProcessorvoidsetProcessUI(IProcessUI processMonitor)voidsetR_PnRef(String R_PnRef)Set Refernce No (and Document No)voidsetRoutingNo(String RoutingNo)Routing NovoidsetTaxAmt(BigDecimal TaxAmt)Tax AmtvoidsetWriteOffAmt(BigDecimal WriteOffAmt)WriteOff AmtbooleanstartProcess(Properties ctx, ProcessInfo pi, Trx trx)Process Online Payment.booleantestAllocation()Test Allocation (and set allocated flag)StringtoString()String RepresentationbooleanunlockIt()Unlock Document.protected booleanverifyDocType(MPaymentAllocate[] pAllocs)Verify Document Type with Invoiceprotected booleanverifyPaymentAllocateSum(MPaymentAllocate[] pAllocs)Verify Payment Allocate Sum must be equal to the Payment Amountprotected booleanverifyPaymentAllocateVsHeader(MPaymentAllocate[] pAllocs)Verify Payment Allocate is ignored (must not exists) if the payment header has charge/invoice/orderbooleanvoidIt()Void Document.protected booleanvoidOnlinePayment()-
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_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_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, 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, 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_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 Detail
-
m_mBankAccountProcessors
protected MBankAccountProcessor[] m_mBankAccountProcessors
Temporary Bank Account Processors
-
m_mBankAccountProcessor
protected MBankAccountProcessor m_mBankAccountProcessor
Temporary Bank Account Processor
-
s_log
protected static CLogger s_log
Logger
-
m_errorMessage
protected String m_errorMessage
Error Message
-
REVERSE_INDICATOR
public static String REVERSE_INDICATOR
Reversal Indicator
-
m_processMsg
protected String m_processMsg
Process Message
-
m_justPrepared
protected boolean m_justPrepared
Just Prepared Flag
-
m_processUI
protected IProcessUI m_processUI
-
m_justCreatedAllocInv
protected MAllocationHdr m_justCreatedAllocInv
-
-
Constructor Detail
-
MPayment
public MPayment(Properties ctx, int C_Payment_ID, String trxName)
Default Constructor- Parameters:
ctx- contextC_Payment_ID- payment to load, (0 create new payment)trxName- trx name
-
MPayment
public MPayment(Properties ctx, ResultSet rs, String trxName)
Load Constructor- Parameters:
ctx- contextrs- result set recordtrxName- transaction
-
-
Method Detail
-
getOfBPartner
public static MPayment[] getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)
Get Payments Of BPartner- Parameters:
ctx- contextC_BPartner_ID- idtrxName- transaction- Returns:
- array
-
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. 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 - Exp. Need to set PatmentProcessor after Amount/Currency Set- Parameters:
TrxType- Transaction Type see TRX_creditCardType- CC typecreditCardNumber- CC numbercreditCardVV- CC verificationcreditCardExp- CC Exp- Returns:
- true if valid
-
setBankACH
public boolean setBankACH(MPaySelectionCheck preparedPayment)
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
public boolean setBankCash(int C_BankAccount_ID, boolean isReceipt, String tenderType)Set Cash BankAccount Info- Parameters:
C_BankAccount_ID- bank accountisReceipt- true if receipttenderType- - Cash (Payment)- Returns:
- true if valid
-
setBankCheck
public boolean setBankCheck(int C_BankAccount_ID, boolean isReceipt, String checkNo)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- chack 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()
Process Payment- Returns:
- true if approved
-
startProcess
public boolean startProcess(Properties ctx, ProcessInfo pi, Trx trx)
Process Online Payment. implements ProcessCall after standard constructor Called when pressing the Process_Online button in C_Payment- Specified by:
startProcessin 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:
beforeSavein classPO- Parameters:
newRecord- new- Returns:
- save
-
isComplete
public boolean isComplete()
Document Status is Complete or Closed- Returns:
- true if CO, CL or RE
-
getAllocatedAmt
public BigDecimal getAllocatedAmt()
Get Allocated Amt in Payment Currency- Returns:
- amount or null
-
testAllocation
public boolean testAllocation()
Test Allocation (and set allocated flag)- Returns:
- true if updated
-
setIsAllocated
public static void setIsAllocated(Properties ctx, int C_BPartner_ID, String trxName)
Set Allocated Flag for payments- Parameters:
ctx- contextC_BPartner_ID- if 0 alltrxName- trx
-
setErrorMessage
public void setErrorMessage(String errorMessage)
Set Error Message- Parameters:
errorMessage- error message
-
getErrorMessage
public String 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_IDin interfaceI_C_Payment- Specified by:
setC_BankAccount_IDin interfacePaymentInterface- Overrides:
setC_BankAccount_IDin classX_C_Payment- Parameters:
C_BankAccount_ID- C_BankAccount_ID
-
setPaymentProcessor
public boolean setPaymentProcessor()
Set BankAccount and PaymentProcessor- Returns:
- true if found
-
setPaymentProcessor
public boolean setPaymentProcessor(String tender, String CCType, int C_PaymentProcessor_ID)
Set BankAccount and PaymentProcessor- Parameters:
tender- TenderType see TENDER_CCType- CC Type see CC_- Returns:
- true if found
-
getCreditCards
public ValueNamePair[] getCreditCards()
Get Accepted Credit Cards for PayAmt (default 0)- Returns:
- credit cards
-
getCreditCards
public ValueNamePair[] getCreditCards(BigDecimal amt)
Get Accepted Credit Cards for amount- Parameters:
amt- trx amount- Returns:
- credit cards
-
getCreditCardPair
protected ValueNamePair getCreditCardPair(String CreditCardType)
Get Type and name pair- Parameters:
CreditCardType- credit card Type- Returns:
- pair
-
setCreditCardNumber
public void setCreditCardNumber(String CreditCardNumber)
Credit Card Number- Specified by:
setCreditCardNumberin interfaceI_C_Payment- Specified by:
setCreditCardNumberin interfacePaymentInterface- Overrides:
setCreditCardNumberin classX_C_Payment- Parameters:
CreditCardNumber- CreditCard Number
-
setCreditCardVV
public void setCreditCardVV(String newCreditCardVV)
Verification Code- Specified by:
setCreditCardVVin interfaceI_C_Payment- Specified by:
setCreditCardVVin interfacePaymentInterface- Overrides:
setCreditCardVVin classX_C_Payment- Parameters:
newCreditCardVV- CC verification
-
setCreditCardExpMM
public void setCreditCardExpMM(int CreditCardExpMM)
Two Digit CreditCard MM- Specified by:
setCreditCardExpMMin interfaceI_C_Payment- Specified by:
setCreditCardExpMMin interfacePaymentInterface- Overrides:
setCreditCardExpMMin classX_C_Payment- Parameters:
CreditCardExpMM- Exp month
-
setCreditCardExpYY
public void setCreditCardExpYY(int newCreditCardExpYY)
Two digit CreditCard YY (til 2020)- Specified by:
setCreditCardExpYYin interfaceI_C_Payment- Specified by:
setCreditCardExpYYin interfacePaymentInterface- Overrides:
setCreditCardExpYYin classX_C_Payment- Parameters:
newCreditCardExpYY- 2 or 4 digit year
-
setCreditCardExp
public boolean setCreditCardExp(String mmyy)
CreditCard Exp MMYY- Parameters:
mmyy- Exp in form of mmyy- Returns:
- true if valid
-
getCreditCardExp
public String getCreditCardExp(String delimiter)
CreditCard Exp MMYY- Parameters:
delimiter- / - or null- Returns:
- Exp
-
setMicr
public void setMicr(String MICR)
MICR- Specified by:
setMicrin interfaceI_C_Payment- Specified by:
setMicrin interfacePaymentInterface- Overrides:
setMicrin classX_C_Payment- Parameters:
MICR- MICR
-
setRoutingNo
public void setRoutingNo(String RoutingNo)
Routing No- Specified by:
setRoutingNoin interfaceI_C_Payment- Specified by:
setRoutingNoin interfacePaymentInterface- Overrides:
setRoutingNoin classX_C_Payment- Parameters:
RoutingNo- Routing No
-
setAccountNo
public void setAccountNo(String AccountNo)
Bank Account No- Specified by:
setAccountNoin interfaceI_C_Payment- Specified by:
setAccountNoin interfacePaymentInterface- Overrides:
setAccountNoin classX_C_Payment- Parameters:
AccountNo- AccountNo
-
setCheckNo
public void setCheckNo(String CheckNo)
Check No- Specified by:
setCheckNoin interfaceI_C_Payment- Specified by:
setCheckNoin interfacePaymentInterface- Overrides:
setCheckNoin classX_C_Payment- Parameters:
CheckNo- Check No
-
setDocumentNo
protected void setDocumentNo()
Set DocumentNo to Payment info. If there is a R_PnRef that is set automatically
-
setR_PnRef
public void setR_PnRef(String R_PnRef)
Set Refernce No (and Document No)- Specified by:
setR_PnRefin interfaceI_C_Payment- Specified by:
setR_PnRefin interfacePaymentInterface- Overrides:
setR_PnRefin classX_C_Payment- Parameters:
R_PnRef- reference
-
setPayAmt
public void setPayAmt(BigDecimal PayAmt)
Set Payment Amount- Specified by:
setPayAmtin interfaceI_C_Payment- Specified by:
setPayAmtin interfacePaymentInterface- Overrides:
setPayAmtin classX_C_Payment- Parameters:
PayAmt- Pay Amt
-
setAmount
public void setAmount(int C_Currency_ID, BigDecimal payAmt)Set Payment Amount- Parameters:
C_Currency_ID- currencypayAmt- amount
-
setDiscountAmt
public void setDiscountAmt(BigDecimal DiscountAmt)
Discount Amt- Specified by:
setDiscountAmtin interfaceI_C_Payment- Overrides:
setDiscountAmtin classX_C_Payment- Parameters:
DiscountAmt- Discount
-
setWriteOffAmt
public void setWriteOffAmt(BigDecimal WriteOffAmt)
WriteOff Amt- Specified by:
setWriteOffAmtin interfaceI_C_Payment- Overrides:
setWriteOffAmtin classX_C_Payment- Parameters:
WriteOffAmt- WriteOff
-
setOverUnderAmt
public void setOverUnderAmt(BigDecimal OverUnderAmt)
OverUnder Amt- Specified by:
setOverUnderAmtin interfaceI_C_Payment- Overrides:
setOverUnderAmtin classX_C_Payment- Parameters:
OverUnderAmt- OverUnder
-
setTaxAmt
public void setTaxAmt(BigDecimal TaxAmt)
Tax Amt- Specified by:
setTaxAmtin interfaceI_C_Payment- Specified by:
setTaxAmtin interfacePaymentInterface- Overrides:
setTaxAmtin classX_C_Payment- Parameters:
TaxAmt- Tax
-
setBP_BankAccount
public void setBP_BankAccount(MBPBankAccount ba)
Set Info from BP Bank Account- Parameters:
ba- BP bank account
-
saveToBP_BankAccount
public boolean saveToBP_BankAccount(MBPBankAccount ba)
Save Info from 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- is receipt
-
setC_DocType_ID
public void setC_DocType_ID(int C_DocType_ID)
Set Document Type- Specified by:
setC_DocType_IDin interfaceI_C_Payment- Overrides:
setC_DocType_IDin classX_C_Payment- Parameters:
C_DocType_ID- doc type
-
verifyDocType
protected boolean verifyDocType(MPaymentAllocate[] pAllocs)
Verify Document Type with Invoice- Parameters:
pAllocs-- Returns:
- true if ok
-
verifyPaymentAllocateVsHeader
protected boolean verifyPaymentAllocateVsHeader(MPaymentAllocate[] pAllocs)
Verify Payment Allocate is ignored (must not exists) if the payment header has charge/invoice/order- Parameters:
pAllocs-- Returns:
- true if ok
-
verifyPaymentAllocateSum
protected boolean verifyPaymentAllocateSum(MPaymentAllocate[] pAllocs)
Verify Payment Allocate Sum must be equal to the Payment Amount- Parameters:
pAllocs-- Returns:
- true if ok
-
getCurrencyISO
public String getCurrencyISO()
Get ISO Code of Currency- Returns:
- Currency ISO
-
getDocStatusName
public String getDocStatusName()
Get Document Status- Returns:
- Document Status Clear Text
-
getCreditCardName
public String getCreditCardName()
Get Name of Credit Card- Returns:
- Name
-
getCreditCardName
public String getCreditCardName(String CreditCardType)
Get Name of Credit Card- Parameters:
CreditCardType- credit card type- Returns:
- Name
-
addDescription
public void addDescription(String description)
Add to Description- Parameters:
description- text
-
getPayAmt
public BigDecimal getPayAmt(boolean absolute)
Get Pay Amt- Parameters:
absolute- if true the absolute amount (i.e. negative if payment)- Returns:
- amount
-
getPayAmtInCents
public int getPayAmtInCents()
Get Pay Amt in cents- Returns:
- amount in cents
-
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
-
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 ..)
-
addDocsPostProcess
protected void addDocsPostProcess(PO doc)
-
getDocsPostProcess
public List<PO> getDocsPostProcess()
- Specified by:
getDocsPostProcessin interfaceIDocsPostProcess- Returns:
- List of doc to process after Complete
-
setDefiniteDocumentNo
protected void setDefiniteDocumentNo()
Set the definite document number after completed
-
createCounterDoc
protected MPayment createCounterDoc()
Create Counter Document- Returns:
- payment
-
allocateIt
public boolean allocateIt()
Allocate It. Only call when there is NO allocation as it will create duplicates. If an invoice exists, it allocates that otherwise it allocates Payment Selection.- Returns:
- true if allocated
-
allocateInvoice
protected boolean allocateInvoice()
Allocate single AP/AR Invoice- Returns:
- true if allocated
-
allocatePaySelection
protected boolean allocatePaySelection()
Allocate Payment Selection- Returns:
- true if allocated
-
deAllocate
protected void deAllocate(boolean accrual)
De-allocate Payment. Unkink 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:
reverseCorrectItin interfaceDocAction- Returns:
- true if success
-
reverse
protected StringBuilder reverse(boolean accrual)
-
getC_BankStatementLine_ID
protected int getC_BankStatementLine_ID()
Get Bank Statement Line of payment or 0- Returns:
- id or 0
-
reverseAccrualIt
public boolean reverseAccrualIt()
Reverse Accrual - none- Specified by:
reverseAccrualItin interfaceDocAction- Returns:
- true if success
-
reActivateIt
public boolean reActivateIt()
Re-activate- Specified by:
reActivateItin interfaceDocAction- Returns:
- true if success
-
toString
public String toString()
String Representation- Overrides:
toStringin classX_C_Payment- Returns:
- info
-
getDocumentInfo
public String getDocumentInfo()
Get Document Info- Specified by:
getDocumentInfoin interfaceDocAction- Returns:
- document info (untranslated)
-
createPDF
public File createPDF()
Create PDF
-
createPDF
public File createPDF(File file)
Create PDF file- Parameters:
file- output file- Returns:
- file if success
-
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 payment(AP) or write-off(AR)
-
setProcessUI
public void setProcessUI(IProcessUI processMonitor)
- Specified by:
setProcessUIin interfaceProcessCall
-
createPaymentTransaction
public MPaymentTransaction createPaymentTransaction(String trxName)
-
voidOnlinePayment
protected boolean voidOnlinePayment()
-
getPO
public PO getPO()
Description copied from interface:PaymentInterfaceGet Persistent Object- Specified by:
getPOin interfacePaymentInterface- Returns:
- PO
-
getCompletedPaymentIDs
public static int[] getCompletedPaymentIDs(int C_Order_ID, int C_Invoice_ID, String trxName)
-
getJustCreatedAllocInv
public MAllocationHdr getJustCreatedAllocInv()
-
-