Skip to Content
Former Member
Jul 21, 2010 at 07:13 AM

Getting negative value of discount on adding ar draft through DIAPI 's



I am facing a scenario where in if I am creating the AR -draft for 1 day order through DIAPI's ADD method ,The sales invoice draft that gets created shows discount =some decimal value that on rounding off is equivalent to 10 in case 10% discount is given on order at line level.

and in case i have made draft for an order having period more than 1 day then the discount values gets negative.

For each line I am assigning the discount value in following ways:

oDraft.Lines.DiscountPercent = 10

then the draft that gets created shows me

discount%= 9.125 in case I have 1 day period


discount%= -400 in case I have period of more tahn 1 day.

I am not understanding why is it so .I mean on what values the discount on AR - invoice draft calulation actually depends.

why is it showing me decimal amount when i am assiging a roundoff value of 10 .

and why is it making discount negative.

Please help me out as early as possible.