Click or drag to resize

clsImportPayment Class

This Import Class can attach one single playment to a SBO document via DI-API

Please make sure, that SAP Business One DI-API in 32 or 64 bit is installed according to the usage of this interface. The logon user in MARIProject has to have a corresponding user linked to the selected company database.

Use MPInterface.bImportERPPayment(clsImportPayment, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportPayment

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportPayment : clsImportBase

The clsImportPayment type exposes the following members.

Constructors
  NameDescription
Public methodclsImportPayment
Initializes a new instance of the clsImportPayment class
Top
Properties
  NameDescription
Public propertyCompanyID
Company ID [Mandatory]
Top
Fields
  NameDescription
Public fieldCancelPayment
This will create directly a cancelation Journal Entry for the payment
Public fieldCardCode
business partner reference for the payment. ORCD.CardCode
Public fieldCashAccount
Account OACT.AcctCode for the payment (Bank, Cash, or 9999..)
Public fieldChangeBusinessPartner
This will exchange the business partner code for the cancelation journal entry
Public fieldJournalEntryNewBP
Field for the new business partner to be exchanged in the cancelation journal entry
Public fieldPaymentDate
Day of payment
Public fieldPaymentDirection
1:Outgoing 2: Incomming
Public fieldPaymentLineID
Internal Counter for the MDB Database
Public fieldPaymentType
0:Customer 1:Account 2: Supplier
Public fieldPaymentValue
Amount in document currency paid
Public fieldPrjCode
ORCT.PrjCode
Public fieldRefDocEntry
DocEnty of the linked document
Public fieldRefDocObjType
Type of the linked document 13:OINV, 18=OPOH
Public fieldReference1
Reference. When null then from document
Public fieldReference2
Reference. When null then from document
Public fieldTaxDate
When null, then the payment date
Public fieldTransAccount
Account ORCT.TrsfrAcct for the payment (Bank, Cash, or 9999..)
Public fieldTransferRef
Top
Examples
Create a payment to SBO via DI-API
public bool CreatePayment(string sCardCode, int lInvoiceDocEntry, decimal cPaymentAmount, DateTime dtPayment) {

    clsImportPayment NewPayment = new clsImportPayment();
    NewPayment.CompanyID = 1;
    NewPayment.PaymentDirection = clsImportPayment.ePaymentDirection.Incomming;
    NewPayment.PaymentType = clsImportPayment.ePaymentType.Customer;
    NewPayment.PaymentDate = dtPayment;
    NewPayment.PaymentValue = cPaymentAmount;
    NewPayment.CashAccount = "1000";
    NewPayment.CardCode = sCardCode;

    NewPayment.RefDocObjType = (int)clsImportERPDocument.eERPDocTypes.AR_Invoice;
    NewPayment.RefDocEntry = lInvoiceDocEntry;
    NewPayment.Reference1 = "Ref to doc num";

    if (oMPInterface.bImportERPPayment(NewPayment, clsImportBase.eImportMode.ValidateAndImport)) {
        return true;
    } else {
        LogFail(oMPInterface.oErrors.PrintErrors());
        return false;
    }
}
See Also