Skip to Content
0
Former Member
Oct 03, 2005 at 08:20 PM

Cannot create an Invoice with a negative line

24 Views

I am tring to export an invoice with a negative row and I'm gettign an error here is an examlpe of what I'm doing .

Dim vDrafts As SAPbobsCOM.Documents

Set vDrafts = vCmp.GetBusinessObject(oDrafts)

vDrafts.DocObjectCode = oPurchaseInvoices

vDrafts.CardCode = "2"

vDrafts.ManualNumber = "222"

vDrafts.HandWritten = tNO

vDrafts.DocDate = Now

vDrafts.DocType = dDocument_Service

vDrafts.DiscountPercent = CDbl("0")

vDrafts.Lines.AccountCode = "100000"

vDrafts.Lines.ItemDescription = "TEST"

vDrafts.Lines.Price = 123

vDrafts.Lines.Quantity = 1

vDrafts.Lines.VatGroup = "6S"

vDrafts.Lines.DiscountPercent = CDbl("0")

vDrafts.Lines.Add

vDrafts.Lines.AccountCode = "100000"

vDrafts.Lines.ItemDescription = "TEST"

vDrafts.Lines.Price = -13

vDrafts.Lines.Quantity = 1

vDrafts.Lines.VatGroup = "6S"

vDrafts.Lines.DiscountPercent = CDbl("0")

RetVal = vDrafts.Add

and if I change to

vDrafts.Lines.Price = 13

vDrafts.Lines.Quantity = -1

then the invoice will be exported but the line will be positive .

Do you have any idea on what is wrong .

Thanks