on 2006 Jul 28 8:21 AM
Hi
I will run pay for invoice in SDK, but I don't know I can Interfere in SAP tables: update OINV and add values to ORCT. I will add values in ORCT how Receipt and sign in OINV that this invoice was paid. Is it good way?
regards
KRzysztof Sala
Hi Krzystof,
You can create an invoice and payment with the following code:
Dim oDoc As SAPbobsCOM.Documents
Dim sNum As String
Dim oPmt As SAPbobsCOM.Payments
oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
oDoc.CardCode = "C1000"
oDoc.DocDate = Now
oDoc.Lines.ItemCode = "A1000"
oDoc.Lines.Quantity = 6
oDoc.Lines.Price = 66
If oDoc.Add <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
Else
MessageBox.Show("Updated")
End If
oCompany.GetNewObjectCode(sNum)
oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
oDoc.GetByKey(sNum)
oPmt = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)
oPmt.Invoices.DocEntry = sNum
oPmt.CardCode = oDoc.CardCode
oPmt.DocDate = Now
oPmt.DocTypte = SAPbobsCOM.BoRcptTypes.rCustomer
oPmt.CashSum = oDoc.DocTotal
If oPmt.Add() <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
Else
MessageBox.Show("Add Payment")
End If
Also look at this posts on invoice and payment troubleshooting:
Hope it helps,
Adele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.