Adempiere 3.5.2a

org.compiere.model
Class MPayment

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_C_Payment
          extended by org.compiere.model.MPayment
All Implemented Interfaces:
Serializable, Comparator, I_C_Payment, I_Persistent, DocAction, ProcessCall, Evaluatee

public final class MPayment
extends X_C_Payment
implements DocAction, ProcessCall

Payment Model. - retrieve and create payments for invoice

  Event 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
  • FR [ 1948157 ] Is necessary the reference for document reverse, victor.perez@e-evolution.com www.e-evolution.com FR [ 1866214 ] http://sourceforge.net/tracker/index.php?func=detail&aid=1866214&group_id=176962&atid=879335
  • See Also:
    http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962, Serialized Form

    Field Summary
    static String REVERSE_INDICATOR
              Reversal Indicator
     
    Fields inherited from class org.compiere.model.X_C_Payment
    AD_ORGTRX_ID_AD_Reference_ID, 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, REF_PAYMENT_ID_AD_Reference_ID, REVERSAL_ID_AD_Reference_ID, TENDERTYPE_Account, TENDERTYPE_AD_Reference_ID, TENDERTYPE_Check, TENDERTYPE_CreditCard, TENDERTYPE_DirectDebit, TENDERTYPE_DirectDeposit, TRXTYPE_AD_Reference_ID, TRXTYPE_Authorization, TRXTYPE_CreditPayment, TRXTYPE_DelayedCapture, TRXTYPE_Sales, TRXTYPE_VoiceAuthorization, TRXTYPE_Void, USER1_ID_AD_Reference_ID, USER2_ID_AD_Reference_ID
     
    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, 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_ReOpen, ACTION_Reverse_Accrual, ACTION_Reverse_Correct, ACTION_Unlock, ACTION_Void, ACTION_WaitComplete, AD_REFERENCE_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_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_Charge_ID, COLUMNNAME_C_ConversionType_ID, COLUMNNAME_C_Currency_ID, COLUMNNAME_C_DocType_ID, COLUMNNAME_C_Invoice_ID, COLUMNNAME_C_Order_ID, COLUMNNAME_C_Payment_ID, COLUMNNAME_C_PaymentBatch_ID, COLUMNNAME_C_Project_ID, COLUMNNAME_ChargeAmt, COLUMNNAME_CheckNo, COLUMNNAME_CreditCardExpMM, COLUMNNAME_CreditCardExpYY, COLUMNNAME_CreditCardNumber, COLUMNNAME_CreditCardType, COLUMNNAME_CreditCardVV, COLUMNNAME_DateAcct, COLUMNNAME_DateTrx, COLUMNNAME_Description, COLUMNNAME_DiscountAmt, COLUMNNAME_DocAction, COLUMNNAME_DocStatus, COLUMNNAME_DocumentNo, COLUMNNAME_IsAllocated, COLUMNNAME_IsApproved, COLUMNNAME_IsDelayedCapture, COLUMNNAME_IsOnline, COLUMNNAME_IsOverUnderPayment, COLUMNNAME_IsPrepayment, COLUMNNAME_IsReceipt, COLUMNNAME_IsReconciled, COLUMNNAME_IsSelfService, COLUMNNAME_Micr, COLUMNNAME_OProcessing, COLUMNNAME_Orig_TrxID, COLUMNNAME_OverUnderAmt, COLUMNNAME_PayAmt, COLUMNNAME_PONum, COLUMNNAME_Posted, COLUMNNAME_Processed, 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_Ref_Payment_ID, COLUMNNAME_Reversal_ID, COLUMNNAME_RoutingNo, COLUMNNAME_Swipe, COLUMNNAME_TaxAmt, COLUMNNAME_TenderType, COLUMNNAME_TrxType, COLUMNNAME_User1_ID, COLUMNNAME_User2_ID, COLUMNNAME_VoiceAuthCode, COLUMNNAME_WriteOffAmt, Model, Table_ID, Table_Name
     
    Constructor Summary
    MPayment(Properties ctx, int C_Payment_ID, String trxName)
              Default Constructor
    MPayment(Properties ctx, ResultSet rs, String trxName)
              Load Constructor
     
    Method Summary
     void addDescription(String description)
              Add to Description
     boolean allocateIt()
              Allocate It.
     boolean approveIt()
              Approve Document
    protected  boolean beforeSave(boolean newRecord)
              Before Save
     boolean closeIt()
              Close Document.
     String completeIt()
              Complete Document
     File createPDF()
              Create PDF
     File createPDF(File file)
              Create PDF file
     BigDecimal getAllocatedAmt()
              Get Allocated Amt in Payment Currency
     BigDecimal getApprovalAmt()
              Get Document Approval Amount
     String getCreditCardExp(String delimiter)
              CreditCard Exp MMYY
     String getCreditCardName()
              Get Name of Credit Card
     String getCreditCardName(String CreditCardType)
              Get Name of Credit Card
     ValueNamePair[] getCreditCards()
              Get Accepted Credit Cards for PayAmt (default 0)
     ValueNamePair[] getCreditCards(BigDecimal amt)
              Get Accepted Credit Cards for amount
     String getCurrencyISO()
              Get ISO Code of Currency
     int getDoc_User_ID()
              Get Document Owner (Responsible)
     String getDocStatusName()
              Get Document Status
     String getDocumentInfo()
              Get Document Info
     String getErrorMessage()
              Get Error Message
    static MPayment[] getOfBPartner(Properties ctx, int C_BPartner_ID, String trxName)
              Get Payments Of BPartner
     BigDecimal getPayAmt(boolean absolute)
              Get Pay Amt
     int getPayAmtInCents()
              Get Pay Amt in cents
     String getProcessMsg()
              Get Process Message
     String getSummary()
              Get Summary
     boolean invalidateIt()
              Invalidate Document
     boolean isCashTrx()
              Is Cashbook Transfer Trx
     String prepareIt()
              Prepare Document
     boolean processIt(String processAction)
              Process document
     boolean processOnline()
              Process Payment
     boolean reActivateIt()
              Re-activate
     boolean rejectIt()
              Reject Approval
     void resetNew()
              Reset Payment to new status
     boolean reverseAccrualIt()
              Reverse Accrual - none
     boolean reverseCorrectIt()
              Reverse Correction
     boolean saveToBP_BankAccount(MBPBankAccount ba)
              Save Info from BP Bank Account
     void setAccountAddress(String name, String street, String city, String state, String zip, String country)
              Set Account Address
     void setAccountNo(String AccountNo)
              Bank Account No
     void setAmount(int C_Currency_ID, BigDecimal payAmt)
              Set Payment Amount
     void 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 Info
     boolean setBankACH(MPaySelectionCheck preparedPayment)
              Set ACH BankAccount Info
     boolean setBankCheck(int C_BankAccount_ID, boolean isReceipt, String checkNo)
              Set Check BankAccount Info
     boolean setBankCheck(int C_BankAccount_ID, boolean isReceipt, String routingNo, String accountNo, String checkNo)
              Set Check BankAccount Info
     void setBP_BankAccount(MBPBankAccount ba)
              Set Info from BP Bank Account
     void setC_BankAccount_ID(int C_BankAccount_ID)
              Set Bank Account for Payment.
     void setC_DocType_ID(boolean isReceipt)
              Set Doc Type
     void setC_DocType_ID(int C_DocType_ID)
              Set Document Type
     void setCheckNo(String CheckNo)
              Check No
     boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, int creditCardExpMM, int creditCardExpYY)
              Set Credit Card.
     boolean setCreditCard(String TrxType, String creditCardType, String creditCardNumber, String creditCardVV, String creditCardExp)
              Set Credit Card - Exp.
     boolean setCreditCardExp(String mmyy)
              CreditCard Exp MMYY
     void setCreditCardExpMM(int CreditCardExpMM)
              Two Digit CreditCard MM
     void setCreditCardExpYY(int newCreditCardExpYY)
              Two digit CreditCard YY (til 2020)
     void setCreditCardNumber(String CreditCardNumber)
              Credit Card Number
     void setCreditCardVV(String newCreditCardVV)
              Verification Code
     void setDiscountAmt(BigDecimal DiscountAmt)
              Discount Amt
     void setErrorMessage(String errorMessage)
              Set Error Message
    static void setIsAllocated(Properties ctx, int C_BPartner_ID, String trxName)
              Set Allocated Flag for payments
     void setMicr(String MICR)
              MICR
     void setOverUnderAmt(BigDecimal OverUnderAmt)
              OverUnder Amt
     void setPayAmt(BigDecimal PayAmt)
              Set Payment Amount
     boolean setPaymentProcessor()
              Set BankAccount and PaymentProcessor
     boolean setPaymentProcessor(String tender, String CCType)
              Set BankAccount and PaymentProcessor
     void setR_PnRef(String R_PnRef)
              Set Refernce No (and Document No)
     void setRoutingNo(String RoutingNo)
              Routing No
     void setTaxAmt(BigDecimal TaxAmt)
              Tax Amt
     void setWriteOffAmt(BigDecimal WriteOffAmt)
              WriteOff Amt
     boolean startProcess(Properties ctx, ProcessInfo pi, Trx trx)
              Process Online Payment.
     boolean testAllocation()
              Test Allocation (and set allocated flag)
     String toString()
              String Representation
     boolean unlockIt()
              Unlock Document.
     boolean voidIt()
              Void Document.
     
    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_ID, getC_Activity, getC_BankAccount_ID, getC_BankAccount, getC_BP_BankAccount_ID, getC_BP_BankAccount, getC_BPartner_ID, getC_BPartner, getC_Campaign_ID, getC_Campaign, getC_Charge_ID, getC_Charge, getC_ConversionType_ID, getC_ConversionType, getC_Currency_ID, getC_Currency, getC_DocType_ID, getC_DocType, getC_Invoice_ID, getC_Invoice, getC_Order_ID, getC_Order, getC_Payment_ID, getC_PaymentBatch_ID, getC_PaymentBatch, getC_Project_ID, getC_Project, getChargeAmt, getCheckNo, getCreditCardExpMM, getCreditCardExpYY, getCreditCardNumber, getCreditCardType, getCreditCardVV, getDateAcct, getDateTrx, getDescription, getDiscountAmt, getDocAction, getDocStatus, getDocumentNo, getKeyNamePair, getMicr, getOProcessing, getOrig_TrxID, getOverUnderAmt, getPayAmt, getPONum, getR_AuthCode_DC, getR_AuthCode, getR_AvsAddr, getR_AvsZip, getR_Info, getR_PnRef_DC, getR_PnRef, getR_RespMsg, getR_Result, getRef_Payment_ID, getReversal_ID, getRoutingNo, getSwipe, getTaxAmt, getTenderType, getTrxType, getUser1_ID, getUser2_ID, getVoiceAuthCode, getWriteOffAmt, initPO, isAllocated, isApproved, isDelayedCapture, isOnline, isOverUnderPayment, isPosted, isPrepayment, isProcessed, isProcessing, isR_CVV2Match, isReceipt, isReconciled, isSelfService, 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_Charge_ID, setC_ConversionType_ID, setC_Currency_ID, setC_Invoice_ID, setC_Order_ID, setC_Payment_ID, setC_PaymentBatch_ID, setC_Project_ID, setChargeAmt, setCreditCardType, setDateAcct, setDateTrx, setDescription, setDocAction, setDocStatus, setDocumentNo, setIsAllocated, setIsApproved, setIsDelayedCapture, setIsOnline, setIsOverUnderPayment, setIsPrepayment, setIsReceipt, setIsReconciled, setIsSelfService, setOProcessing, setOrig_TrxID, setPONum, setPosted, setProcessed, setProcessing, setR_AuthCode_DC, setR_AuthCode, setR_AvsAddr, setR_AvsZip, setR_CVV2Match, setR_Info, setR_PnRef_DC, setR_RespMsg, setR_Result, setRef_Payment_ID, setReversal_ID, setSwipe, setTenderType, setTrxType, setUser1_ID, setUser2_ID, setVoiceAuthCode
     
    Methods inherited from class org.compiere.model.PO
    afterDelete, afterSave, beforeDelete, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, equals, 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_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     
    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, setDocStatus
     
    Methods inherited from interface org.compiere.model.I_Persistent
    save
     

    Field Detail

    REVERSE_INDICATOR

    public static String REVERSE_INDICATOR
    Reversal Indicator

    Constructor Detail

    MPayment

    public MPayment(Properties ctx,
                    int C_Payment_ID,
                    String trxName)
    Default Constructor

    Parameters:
    ctx - context
    C_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 - context
    rs - result set record
    trxName - transaction
    Method Detail

    getOfBPartner

    public static MPayment[] getOfBPartner(Properties ctx,
                                           int C_BPartner_ID,
                                           String trxName)
    Get Payments Of BPartner

    Parameters:
    ctx - context
    C_BPartner_ID - id
    trxName - transaction
    Returns:
    array

    resetNew

    public void resetNew()
    Reset Payment to new status


    isCashTrx

    public boolean isCashTrx()
    Is Cashbook Transfer Trx

    Returns:
    true if Cash 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 type
    creditCardNumber - CC number
    creditCardVV - CC verification
    creditCardExpMM - CC Exp MM
    creditCardExpYY - 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 type
    creditCardNumber - CC number
    creditCardVV - CC verification
    creditCardExp - CC Exp
    Returns:
    true if valid

    setBankACH

    public boolean setBankACH(MPaySelectionCheck preparedPayment)
    Set ACH BankAccount Info

    Parameters:
    C_BankAccount_ID - bank account
    isReceipt - true if receipt
    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 account
    isReceipt - true if receipt
    tenderType - - Direct Debit or Direct Deposit
    routingNo - routing
    accountNo - account
    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 account
    isReceipt - true if receipt
    checkNo - chack 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 account
    isReceipt - true if receipt
    routingNo - routing no
    accountNo - account no
    checkNo - chack no
    Returns:
    true if valid

    setBankAccountDetails

    public void setBankAccountDetails(int C_BankAccount_ID)
    Set Bank Account Details. Look up Routing No & 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 - name
    street - street
    city - city
    state - state
    zip - zip
    country - 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:
    startProcess in interface ProcessCall
    Parameters:
    ctx - Context
    pi - Process Info
    trx - transaction
    Returns:
    true if the next process should be performed

    beforeSave

    protected boolean beforeSave(boolean newRecord)
    Before Save

    Overrides:
    beforeSave in class PO
    Parameters:
    newRecord - new
    Returns:
    save

    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 - context
    C_BPartner_ID - if 0 all
    trxName - 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_ID in interface I_C_Payment
    Overrides:
    setC_BankAccount_ID in class X_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)
    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

    setCreditCardNumber

    public void setCreditCardNumber(String CreditCardNumber)
    Credit Card Number

    Specified by:
    setCreditCardNumber in interface I_C_Payment
    Overrides:
    setCreditCardNumber in class X_C_Payment
    Parameters:
    CreditCardNumber - CreditCard Number

    setCreditCardVV

    public void setCreditCardVV(String newCreditCardVV)
    Verification Code

    Specified by:
    setCreditCardVV in interface I_C_Payment
    Overrides:
    setCreditCardVV in class X_C_Payment
    Parameters:
    newCreditCardVV - CC verification

    setCreditCardExpMM

    public void setCreditCardExpMM(int CreditCardExpMM)
    Two Digit CreditCard MM

    Specified by:
    setCreditCardExpMM in interface I_C_Payment
    Overrides:
    setCreditCardExpMM in class X_C_Payment
    Parameters:
    CreditCardExpMM - Exp month

    setCreditCardExpYY

    public void setCreditCardExpYY(int newCreditCardExpYY)
    Two digit CreditCard YY (til 2020)

    Specified by:
    setCreditCardExpYY in interface I_C_Payment
    Overrides:
    setCreditCardExpYY in class X_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:
    setMicr in interface I_C_Payment
    Overrides:
    setMicr in class X_C_Payment
    Parameters:
    MICR - MICR

    setRoutingNo

    public void setRoutingNo(String RoutingNo)
    Routing No

    Specified by:
    setRoutingNo in interface I_C_Payment
    Overrides:
    setRoutingNo in class X_C_Payment
    Parameters:
    RoutingNo - Routing No

    setAccountNo

    public void setAccountNo(String AccountNo)
    Bank Account No

    Specified by:
    setAccountNo in interface I_C_Payment
    Overrides:
    setAccountNo in class X_C_Payment
    Parameters:
    AccountNo - AccountNo

    setCheckNo

    public void setCheckNo(String CheckNo)
    Check No

    Specified by:
    setCheckNo in interface I_C_Payment
    Overrides:
    setCheckNo in class X_C_Payment
    Parameters:
    CheckNo - Check No

    setR_PnRef

    public void setR_PnRef(String R_PnRef)
    Set Refernce No (and Document No)

    Specified by:
    setR_PnRef in interface I_C_Payment
    Overrides:
    setR_PnRef in class X_C_Payment
    Parameters:
    R_PnRef - reference

    setPayAmt

    public void setPayAmt(BigDecimal PayAmt)
    Set Payment Amount

    Specified by:
    setPayAmt in interface I_C_Payment
    Overrides:
    setPayAmt in class X_C_Payment
    Parameters:
    PayAmt - Pay Amt

    setAmount

    public void setAmount(int C_Currency_ID,
                          BigDecimal payAmt)
    Set Payment Amount

    Parameters:
    C_Currency_ID - currency
    payAmt - amount

    setDiscountAmt

    public void setDiscountAmt(BigDecimal DiscountAmt)
    Discount Amt

    Specified by:
    setDiscountAmt in interface I_C_Payment
    Overrides:
    setDiscountAmt in class X_C_Payment
    Parameters:
    DiscountAmt - Discount

    setWriteOffAmt

    public void setWriteOffAmt(BigDecimal WriteOffAmt)
    WriteOff Amt

    Specified by:
    setWriteOffAmt in interface I_C_Payment
    Overrides:
    setWriteOffAmt in class X_C_Payment
    Parameters:
    WriteOffAmt - WriteOff

    setOverUnderAmt

    public void setOverUnderAmt(BigDecimal OverUnderAmt)
    OverUnder Amt

    Specified by:
    setOverUnderAmt in interface I_C_Payment
    Overrides:
    setOverUnderAmt in class X_C_Payment
    Parameters:
    OverUnderAmt - OverUnder

    setTaxAmt

    public void setTaxAmt(BigDecimal TaxAmt)
    Tax Amt

    Specified by:
    setTaxAmt in interface I_C_Payment
    Overrides:
    setTaxAmt in class X_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

    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_ID in interface I_C_Payment
    Overrides:
    setC_DocType_ID in class X_C_Payment
    Parameters:
    C_DocType_ID - doc type

    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

    Specified by:
    processIt in interface DocAction
    Parameters:
    processAction - document action
    Returns:
    true if performed

    unlockIt

    public boolean unlockIt()
    Unlock Document.

    Specified by:
    unlockIt in interface DocAction
    Returns:
    true if success

    invalidateIt

    public boolean invalidateIt()
    Invalidate Document

    Specified by:
    invalidateIt in interface DocAction
    Returns:
    true if success

    prepareIt

    public String prepareIt()
    Prepare Document

    Specified by:
    prepareIt in interface DocAction
    Returns:
    new status (In Progress or Invalid)

    approveIt

    public boolean approveIt()
    Approve Document

    Specified by:
    approveIt in interface DocAction
    Returns:
    true if success

    rejectIt

    public boolean rejectIt()
    Reject Approval

    Specified by:
    rejectIt in interface DocAction
    Returns:
    true if success

    completeIt

    public String completeIt()
    Complete Document

    Specified by:
    completeIt in interface DocAction
    Returns:
    new status (Complete, In Progress, Invalid, Waiting ..)

    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

    voidIt

    public boolean voidIt()
    Void Document.

    Specified by:
    voidIt in interface DocAction
    Returns:
    true if success

    closeIt

    public boolean closeIt()
    Close Document.

    Specified by:
    closeIt in interface DocAction
    Returns:
    true if success

    reverseCorrectIt

    public boolean reverseCorrectIt()
    Reverse Correction

    Specified by:
    reverseCorrectIt in interface DocAction
    Returns:
    true if success

    reverseAccrualIt

    public boolean reverseAccrualIt()
    Reverse Accrual - none

    Specified by:
    reverseAccrualIt in interface DocAction
    Returns:
    true if success

    reActivateIt

    public boolean reActivateIt()
    Re-activate

    Specified by:
    reActivateIt in interface DocAction
    Returns:
    true if success

    toString

    public String toString()
    String Representation

    Overrides:
    toString in class X_C_Payment
    Returns:
    info

    getDocumentInfo

    public String getDocumentInfo()
    Get Document Info

    Specified by:
    getDocumentInfo in interface DocAction
    Returns:
    document info (untranslated)

    createPDF

    public File createPDF()
    Create PDF

    Specified by:
    createPDF in interface DocAction
    Returns:
    File or null

    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:
    getSummary in interface DocAction
    Returns:
    Summary of Document

    getProcessMsg

    public String getProcessMsg()
    Get Process Message

    Specified by:
    getProcessMsg in interface DocAction
    Returns:
    clear text error message

    getDoc_User_ID

    public int getDoc_User_ID()
    Get Document Owner (Responsible)

    Specified by:
    getDoc_User_ID in interface DocAction
    Returns:
    AD_User_ID

    getApprovalAmt

    public BigDecimal getApprovalAmt()
    Get Document Approval Amount

    Specified by:
    getApprovalAmt in interface DocAction
    Returns:
    amount payment(AP) or write-off(AR)

    Adempiere 3.5.2a

    Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.