Skip to Content
0
Former Member
Apr 28, 2009 at 01:14 PM

Payment against Reserved Invoice

125 Views

Hi Experts,

We are creating Reserved Invoices through the DI API. The Reserved Invoice is received in just fine. After the Invoice is processed through the DI API, we then process a payment for the Invoice. We are getting an error that states "The Base Document Card does not match the Target Document Card".

Orginally we were processing Sales Orders and then bringing in the payment. Both were received into SAP with no errors. We discovered that we could not link the Payment to the Order, so we changed to using Reserved Invoices. Now we are getting the above mentioned error when processing the payments.

Does anyone have any suggestions has to why we could be getting this error? What would be considered the Target Document?

here is the payment code:

SAPbobsCOM.Payments vPays = default(SAPbobsCOM.Payments);

vPays = (SAPbobsCOM.Payments)vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);

SAPbobsCOM.Documents SapInvoice = default(SAPbobsCOM.Documents);

SapInvoice = (SAPbobsCOM.Documents)vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);

int SapOrder = GetSapInvoiceNumber(OrderNumber);

SapInvoice.GetByKey(SapOrder);

vPays.Address = SapInvoice.Address;

vPays.CardCode = SapInvoice.CardCode;

vPays.DocDate = PayDate;

vPays.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;

vPays.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_IncomingPayments;

vPays.CashAccount = "23500000";

vPays.JournalRemarks = journal;

vPays.Invoices.DocEntry = SapInvoice.DocEntry;

vPays.Invoices.DocLine = 0;

vPays.Invoices.SumApplied = SapInvoice.DocTotal;

vPays.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Receipt;

lRetCode = vPays.Add();

Thanks,

Josh

Edited by: Josh Mellette on Apr 28, 2009 5:09 PM