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
FieldsModifier and TypeFieldDescriptionprotected StringError Messageprotected MAllocationHdrprotected booleanJust Prepared Flagprotected MBankAccountProcessorTemporary Bank Account Processorprotected MBankAccountProcessor[]Temporary Bank Account Processorsprotected StringProcess Messageprotected IProcessUIstatic StringReversal Indicatorprotected static CLoggerLoggerstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intIndex constants for Vectorstatic final intstatic final intstatic final intstatic final intFields 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_VoidFields 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_IDFields 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_WaitingPaymentFields 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_CostCenter_ID, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_Department_ID, COLUMNNAME_C_DepositBatch_ID, COLUMNNAME_C_DocType_ID, COLUMNNAME_C_Employee_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
ConstructorsConstructorDescriptionMPayment(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 TypeMethodDescriptionvoidaddDescription(String description) Add to Descriptionprotected voidaddDocsPostProcess(PO doc) Add document for processing after document actionprotected booleanAllocate to single AP/AR InvoicebooleanAllocate 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 booleanAllocate to Payment SelectionbooleanApprove Documentprotected booleanExecute before Delete operations.
Default implementation is nop, to be implemented in sub-classes that needed it.protected booleanbeforeSave(boolean newRecord) Called before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.booleancloseIt()Close Document.Complete Documentprotected MPaymentCreate Counter DocumentcreatePaymentTransaction(String trxName) Create online payment transactionCreate PDFCreate PDF fileprotected voiddeAllocate(boolean accrual) Deallocate Payment.Get Allocated Amt in Payment CurrencyGet Document Approval Amountprotected intGet 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 ValueNamePairgetCreditCardPair(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 CurrencyintGet Document Owner (Responsible)Get documents to process after Complete or after PostingGet Document Status NameGet Document InfoGet Error Messagestatic 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 AmtintGet 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) booleanInvalidate DocumentbooleanIs Cashbook TrxbooleanIs Cash TrxbooleanDocument Status is Complete or ClosedPrepare DocumentbooleanProcess documentbooleanExecute online processing of paymentbooleanRe-activatebooleanrejectIt()Reject ApprovalvoidresetNew()Reset Payment to new statusprotected StringBuilderreverse(boolean accrual) Reverse this paymentbooleanReverse AccrualbooleanReverse CorrectionbooleanSave Info to 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 Amount and CurrencyvoidsetBankAccountDetails(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 InfovoidSet Info from BP Bank AccountvoidsetC_BankAccount_ID(int C_BankAccount_ID) Set Bank Account for Payment.protected voidSet 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 details.booleansetCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp) Set Credit Card details.booleansetCreditCardExp(String mmyy) Set CreditCard Exp MMYYvoidsetCreditCardExpMM(int CreditCardExpMM) Set Two Digit CreditCard MMvoidsetCreditCardExpYY(int newCreditCardExpYY) Set Two digit CreditCard YY (til 2020)voidsetCreditCardNumber(String CreditCardNumber) Set Credit Card Number.voidsetCreditCardVV(String newCreditCardVV) Set Verification Codeprotected voidSet the definite document number after completedvoidsetDiscountAmt(BigDecimal DiscountAmt) Discount Amtprotected voidDerive DocumentNo from Payment info.voidsetErrorMessage(String errorMessage) Set Error Messagestatic voidsetIsAllocated(Properties ctx, int C_BPartner_ID, String trxName) Set Allocated Flag for paymentsvoidMICRvoidsetOverUnderAmt(BigDecimal OverUnderAmt) OverUnder AmtvoidsetPayAmt(BigDecimal PayAmt) Set Payment AmountbooleanSet BankAccount and PaymentProcessorbooleansetPaymentProcessor(String tender, String CCType, int C_PaymentProcessor_ID) Find and Set BankAccount and PaymentProcessorvoidsetProcessUI(IProcessUI processMonitor) Set process UI interfacevoidsetR_PnRef(String R_PnRef) Set Reference No (and Document No)voidsetRoutingNo(String RoutingNo) Routing NovoidsetTaxAmt(BigDecimal TaxAmt) Tax AmtvoidsetWriteOffAmt(BigDecimal WriteOffAmt) WriteOff AmtbooleanstartProcess(Properties ctx, ProcessInfo pi, Trx trx) Execute online processing of payment (delegate toprocessOnline()).booleanTest Allocation (and set allocated flag)toString()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 that payment has no Payment Allocate records if the payment header has charge/invoice/order.booleanvoidIt()Void Document.protected booleanMethods 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_CostCenter, getC_CostCenter_ID, getC_Currency, getC_Currency_ID, getC_Department, getC_Department_ID, getC_DepositBatch, getC_DepositBatch_ID, getC_DocType, getC_DocType_ID, getC_Employee, getC_Employee_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_CostCenter_ID, setC_Currency_ID, setC_Department_ID, setC_DepositBatch_ID, setC_Employee_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, setVoiceAuthCodeMethods inherited from class org.compiere.model.PO
afterDelete, afterSave, 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_TableAttribute, get_TableAttributeAsBoolean, get_TableAttributeAsInt, get_TableAttributes, 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, validForeignKeysExMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods 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, setDocStatusMethods inherited from interface org.compiere.model.I_C_Payment
getAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActiveMethods inherited from interface org.compiere.model.I_Persistent
saveMethods 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:
startProcessin interfaceProcessCall- Parameters:
ctx- Contextpi- Process Infotrx- transaction- Returns:
- true if the next process should be performed
-
beforeSave
protected boolean beforeSave(boolean newRecord) Description copied from class:POCalled before Save for Pre-Save Operation.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeSavein classPO- Parameters:
newRecord- true if it is a new record- Returns:
- true if record can be saved
-
beforeDelete
protected boolean beforeDelete()Description copied from class:POExecute before Delete operations.
Default implementation is nop, to be implemented in sub-classes that needed it.- Overrides:
beforeDeletein classPO- Returns:
- true if record can be deleted
-
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_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
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:
setCreditCardNumberin interfaceI_C_Payment- Specified by:
setCreditCardNumberin interfacePaymentInterface- Overrides:
setCreditCardNumberin classX_C_Payment- Parameters:
CreditCardNumber- CreditCard Number
-
setCreditCardVV
Set 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) Set 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) Set 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
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:
setMicrin interfaceI_C_Payment- Specified by:
setMicrin interfacePaymentInterface- Overrides:
setMicrin classX_C_Payment- Parameters:
MICR- MICR
-
setRoutingNo
Routing No- Specified by:
setRoutingNoin interfaceI_C_Payment- Specified by:
setRoutingNoin interfacePaymentInterface- Overrides:
setRoutingNoin classX_C_Payment- Parameters:
RoutingNo- Routing No
-
setAccountNo
Bank Account No- Specified by:
setAccountNoin interfaceI_C_Payment- Specified by:
setAccountNoin interfacePaymentInterface- Overrides:
setAccountNoin classX_C_Payment- Parameters:
AccountNo- AccountNo
-
setCheckNo
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()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_PnRefin interfaceI_C_Payment- Specified by:
setR_PnRefin interfacePaymentInterface- Overrides:
setR_PnRefin classX_C_Payment- Parameters:
R_PnRef- reference
-
setPayAmt
Set Payment Amount- Specified by:
setPayAmtin interfaceI_C_Payment- Specified by:
setPayAmtin interfacePaymentInterface- Overrides:
setPayAmtin classX_C_Payment- Parameters:
PayAmt- Pay Amt
-
setAmount
Set Payment Amount and Currency- Parameters:
C_Currency_ID- currencypayAmt- amount
-
setDiscountAmt
Discount Amt- Specified by:
setDiscountAmtin interfaceI_C_Payment- Overrides:
setDiscountAmtin classX_C_Payment- Parameters:
DiscountAmt- Discount
-
setWriteOffAmt
WriteOff Amt- Specified by:
setWriteOffAmtin interfaceI_C_Payment- Overrides:
setWriteOffAmtin classX_C_Payment- Parameters:
WriteOffAmt- WriteOff
-
setOverUnderAmt
OverUnder Amt- Specified by:
setOverUnderAmtin interfaceI_C_Payment- Overrides:
setOverUnderAmtin classX_C_Payment- Parameters:
OverUnderAmt- OverUnder
-
setTaxAmt
Tax Amt- Specified by:
setTaxAmtin interfaceI_C_Payment- Specified by:
setTaxAmtin interfacePaymentInterface- Overrides:
setTaxAmtin 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_IDin interfaceI_C_Payment- Overrides:
setC_DocType_IDin 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:
invalidateItin 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:
completeItin interfaceDocAction- Returns:
- new status (Complete, In Progress, Invalid, Waiting ..)
-
addDocsPostProcess
Add document for processing after document action- Parameters:
doc-
-
getDocsPostProcess
Description copied from interface:IDocsPostProcessGet documents to process after Complete or after Posting- Specified by:
getDocsPostProcessin interfaceIDocsPostProcess- Returns:
- List of doc to process after Complete or after Posting
-
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:
reverseCorrectItin 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:
reverseAccrualItin interfaceDocAction- Returns:
- true if success
-
reActivateIt
public boolean reActivateIt()Re-activate- Specified by:
reActivateItin interfaceDocAction- Returns:
- true if success
-
toString
String Representation- Overrides:
toStringin classX_C_Payment- Returns:
- info
-
getDocumentInfo
Get Document Info- Specified by:
getDocumentInfoin 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:
getSummaryin interfaceDocAction- Returns:
- Summary of Document
-
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
Get Document Approval Amount- Specified by:
getApprovalAmtin interfaceDocAction- Returns:
- amount payment(AP) or write-off(AR)
-
setProcessUI
Description copied from interface:ProcessCallSet process UI interface- Specified by:
setProcessUIin interfaceProcessCall
-
createPaymentTransaction
Create online payment transaction- Parameters:
trxName-- Returns:
- MPaymentTransaction
-
voidOnlinePayment
protected boolean voidOnlinePayment()- Returns:
- true if success
-
getPO
Description copied from interface:PaymentInterfaceGet Persistent Object- Specified by:
getPOin 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())
-
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.
-