Skip to Content
0
Former Member
Nov 01, 2012 at 01:24 PM

Cash Account not defined.

271 Views

Hello! I have been trying to add a payment against an invoice using DI API. The payment means is cash but when I try to add the payment against the invoice, it return cash account has not been defined. I will be absolutely grateful for any help. Here is the code:

SAPbobsCOM.Payments vPay;

vPay = TestCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);

vPay.Address = "622-7";

vPay.ApplyVAT = SAPbobsCOM.BoYesNoEnum.tNO;

vPay.CardCode = "1994-0115";

vPay.DocDate = DateTime.Today;

vPay.JournalRemarks = "Incoming - D10004";

vPay.LocalCurrency = SAPbobsCOM.BoYesNoEnum.tYES;

vPay.TaxDate = DateTime.Today;

vPay.Invoices.DocEntry = Convert.ToInt32(test1);

vPay.Invoices.DocLine = 0;

vPay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;

vPay.Invoices.SumApplied = 10;

vPay.Invoices.Add();

vPay.CashAccount = "100040100";

vPay.CashSum = 10;

vPay.Add();