Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: How to add A/P Down Payment in Purchase Invoice

$
0
0

Hi Douglas,

 

Try this sample available in SDK help center:

 

Private Sub CreateInvoice()    Dim oInvoice As SAPbobsCOM.Documents    ' Add invoice    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)    oInvoice.CardCode = Card Code With DownPayment Invoice    oInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items    oInvoice.DocDate = Document Date    oInvoice.Lines.ItemCode = Some Item Code    oInvoice.Lines.Price = Item Price    oInvoice.Lines.Quantity = Quantity    oInvoice.Lines.TaxCode = Tax Code If needed    oInvoice.Lines.VatGroup = Vat Code If needed    ' Add the Invoice with Down Payment    Dim dpToDraw As SAPbobsCOM.DownPaymentsToDraw    dpToDraw = oInvoice.DownPaymentsToDraw    'oDPM is an object that contains an existing DownPayment Invoice    dpToDraw.AmountToDraw = oDPM.DownPaymentAmount    lRetCode = oInvoice.Add()    If lRetCode <> 0 Then            oCompany.GetLastError(lErrCode, sErrMsg)            MsgBox(lErrCode & " " & sErrMsg) ' Display error message    Else            MsgBox("Invoice with Downpayment created, the process of using a downpayment invoice succeeded", MsgBoxStyle.Information, "Invoice Paid")            cmdInv.Enabled = False     End If
End Sub

Hope it helps,

 

Regards,

Diego


Viewing all articles
Browse latest Browse all 9091

Trending Articles