Private Sub cmdCreateDownPaymentInv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCreateDownPaymentInv.Click
Try
oDPM = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments)
oDPM.CardCode = Some Card code
oDPM.DocDueDate = Suitable Date
oDPM.DownPaymentPercentage = Numeric value (Double)
oDPM.DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice
oDPM.Lines.ItemCode = Some Item Code
oDPM.Lines.Quantity = Quantity
oDPM.Lines.Price = Item Price
lRetCode = oDPM.Add
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(lErrCode & " " & sErrMsg)
Else
MsgBox("Down Paymeny Invoice Added to DataBase", MsgBoxStyle.Information, "Invoice Added")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub |