cancel
Showing results for 
Search instead for 
Did you mean: 

A/R Downpayment Invoice ??

former_member209771
Active Participant
0 Kudos

Hi all,

previous we adding invoice and A?R Invoice using object.

Please help How to Add A/R Downpayment Invoice using object ?

thanks in advance

surajit

Edited by: Surojit Kundu on Oct 17, 2011 11:37 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member689126
Active Contributor
0 Kudos

Hi

Try this

'Create DownPayment Invoice Object
            oDPM = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments)

            'Set Down Payment Header Values
            oDPM.CardCode = txtCardCode.Text
            oDPM.DocDueDate = DateDue.Value
            oDPM.DownPaymentPercentage = Convert.ToDouble(numPercent.Value)

            oDPM.DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice

            'Set Down Payment Line Values
            oDPM.Lines.ItemCode = txtItemCode.Text
            oDPM.Lines.Quantity = Convert.ToDouble(txtQuantity.Text)
            oDPM.Lines.Price = Convert.ToDouble(txtPrice.Text)

            lRetCode = oDPM.Add ' Try to add the invoice to the database
            If lRetCode <> 0 Then
                oCompany.GetLastError(lErrCode, sErrMsg)
                MsgBox(lErrCode & " " & sErrMsg)  ' Display error message
            Else
                MsgBox("Down Payment Invoice Added to DataBase", MsgBoxStyle.Information, "Invoice Added")
                ' Enabling the next button in the process
           
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Regards

Arun

former_member209771
Active Participant
0 Kudos

Thanks Arun for your code.And it will be helpful for me if u give some suggestion on the following thread.

Edited by: Surojit Kundu on Oct 20, 2011 11:26 AM