calculate line discount in amount include tax

Hello, can anyone tell me how to get Sales Line Amount including Sales Tax,Discounts and misc. charges. through code. I have tried for sales order and i got the total invoice amount which includes sales tax etc., using salestotals class. But I couldn’t get for a sales line. Please give me a code snippet or an idea. The scenario is : Amount 100000 Line discount 20000 Cash disc 31% Tax (10%) = 5018 If I check box prices incl. Sales tax In axapta , I get value : Amount 100000 Line discount 1818 Cash disc 19163 Tax 5695 Can any body help me ? Best regards, Lily