on 07-12-2007 5:54 PM
Hello All:
I am creating a addon that create incoming payment per invoice. And alot of time it's partial payments. Below is a sample of my code. All payment are made in cash. and it's paid to invoices and not to account.
I am keep on getting the Overlapped I/O operation is in progress (-2028) error message. But have no idea why, tried different things without help. Does anyone have a working sample or any experience with this?
Thank You!
opay = (SAPbobsCOM.Payments)(Global.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments));
opay.CardCode = Cardcode.ToString();
opay.DocDate = System.DateTime.ParseExact(row["paymentdate"].ToString(), "yyyyMMdd", null);
opay.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;
opay.DocTypte = SAPbobsCOM.BoRcptTypes.rCustomer;
if (row["reference"].ToString().Length > 😎
{
opay.CounterReference = row["reference"].ToString().Substring(0, 8);
}
else
opay.CounterReference = row["reference"].ToString();
opay.CashSum = amount;
opay.Reference1 = row["receiptno"].ToString();
opay.Invoices.DocEntry = System.Convert.ToInt32(docentry.ToString());
opay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;
opay.Invoices.SumApplied = amount;
opay.Invoices.Add();
if (opay.Add() != 0)
{}
Somehow this works.
opay = (SAPbobsCOM.Payments)(Global.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments));
opay.CardCode = Cardcode.ToString();
opay.DocDate = System.DateTime.ParseExact(row["paymentdate"].ToString(), "yyyyMMdd", null);
opay.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;
if (row["reference"].ToString().Length > 😎
{
opay.CounterReference = row["reference"].ToString().Substring(0, 8);
}
else
opay.CounterReference = row["reference"].ToString();
opay.Reference1 = row["receiptno"].ToString();
opay.Invoices.DocEntry = System.Convert.ToInt32(docentry.ToString());
opay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;
opay.Invoices.SumApplied = amount;
opay.Invoices.Add();
opay.CashSum = amount;
if (opay.Add() != 0)
{}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has any one got any sample of working incoming payment similar to this kind of situation? If I do accords to invoice with just a cashsum it works. But if I link it to a invoiceno. It doesn't. I don't know why!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.