Skip to Content
0
Former Member
Jun 18, 2009 at 03:41 PM

Payment reconciliation with A/R Invoice + close Invoice

21 Views

Hi Again,

I am doing a Payment directly from A/R Invoice; but the A/R Invoice is still Open and there is no reconciliation between the Payment and the A/R Invoice.

Any code sample you can give me to close A/R Invoice with reconciliation of the Payment, and if half paid I assume the A/R Invoice is still open and the A/R Invoice is reconciliated with the payment?

See my code below which is missing the reconciliation.

Thank you

Rune

oPayments = (SAPbobsCOM.Payments)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);

                    oPayments.CardCode = vmp_CardCode_string;
                    oPayments.DocDate = DateTime.Now;
                    oPayments.JournalRemarks = "Incoming - Payment Bank Transfer";
                    oPayments.TaxDate = DateTime.Now;
                    
                    SAPbobsCOM.Recordset oRecordset_BankAccount = null;
                    oRecordset_BankAccount = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
                    oRecordset_BankAccount.DoQuery("SELECT * FROM [dbo].[@PAY_TYPE] WHERE [U_PayMethod] = '01'");
                    oRecordset_BankAccount.MoveFirst();
                    if (oRecordset_BankAccount.EoF == true) // No Records
                    {
                    }
                    else
                    {
                        vmp_BankAccount_string = Convert.ToString(oRecordset_BankAccount.Fields.Item("U_BankAccount").Value);
                    }

                    oPayments.TransferAccount = vmp_BankAccount_string;// "_SYS00000000343"; //"1010140-001";
                    oPayments.TransferDate = DateTime.Now;
                    oPayments.TransferReference = vmp_CardCode_string;
                    oPayments.TransferSum = vmp_Amount_double;

                    vc_Message_Result_Int32 = oPayments.Add();